Skip to content
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

Merged
merged 2 commits into from
Sep 27, 2017
Merged

Conversation

snakems
Copy link
Contributor

@snakems snakems commented Sep 25, 2017

No description provided.

Copy link
Member

@obilodeau obilodeau left a 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.

@@ -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{
Copy link
Member

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()

"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"},
Copy link
Member

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.

@pix
Copy link
Contributor

pix commented Sep 26, 2017

I think a .ps1 file generated with jinja would be even better, I'm playing with malboxes to build kali vm too, and, moving the profile code to a generated .ps1/.sh would simplify this code

@obilodeau obilodeau merged commit 18c630a into GoSecure:master Sep 27, 2017
@obilodeau
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants