-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add shortcut mod to profiles #85
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good feature! Please see my comments for small improvements.
malboxes/malboxes.py
Outdated
@@ -565,6 +572,42 @@ def document(profile_name, modtype, docpath, fd): | |||
|
|||
fd.write(line) | |||
|
|||
def shortcut_function(fd): | |||
""" Add shortcut function to the profile """ | |||
fd.write("""function Add-Shortcut{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should extract that code in an external .ps1
file that we can inline at runtime. Add it in here: malboxes/scripts/windows/
Then you can replace shortcut_function(fd) with an open(...).read()
malboxes/profile-example.js
Outdated
"shortcut": [ | ||
//Create shortcuts for exe files | ||
{"dest": "$env:USERPROFILE\\Desktop\\Fiddler.lnk", "target": "$env:LOCALAPPDATA\\Programs\\Fiddler\\Fiddler.exe"}, | ||
{"dest": "$env:USERPROFILE\\Desktop\\Fiddler Port 9999.lnk", "target": "$env:LOCALAPPDATA\\Programs\\Fiddler\\Fiddler.exe", "arguments": "/port:9999"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of these exemples should be a desktop shortcut with the shorter syntax since you explicitly support it.
I think a |
Thanks @snakems! @pix, I think in this case this is clearly a function and we can include it and call it instead of generating a ton of code through jinja templates. That said, I'm looking forward to see what you come up with regarding building Linux boxes and we'll see what kind of generalization we can do there. |
No description provided.