Skip to content

Instantly share code, notes, and snippets.

@mpapierski
Last active October 13, 2017 22:21
Show Gist options
  • Save mpapierski/4921e4d2fc3aad1b5412005c87ae53cd to your computer and use it in GitHub Desktop.
Save mpapierski/4921e4d2fc3aad1b5412005c87ae53cd to your computer and use it in GitHub Desktop.
script = '''#!/bin/sh
tail -c{} $0|gunzip
exit
'''
with open('pwning2017.sh', 'wb') as fout:
with open('payload', 'rb') as fin:
payload = fin.read()
fout.write(script.format(len(payload)))
fout.write(payload)
______ _ _ _ _ _
| ___ \ | | | \ | (_) SECURITY
| |_/ / | | | \| |_ _ __ __ _
| __/| |/\| | . ` | | '_ \ / _` |
| | \ /\ / |\ | | | | | (_| |
\_| \/ \/\_| \_/_|_| |_|\__, |
__/ |
W a r s z a w a 2 0 1 7 |___/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment