monoxgas / sRDI

Shellcode implementation of Reflective DLL Injection. Convert DLLs to position independent shellcode
Other
2.12k stars 459 forks source link

Minor issue with python #13

Closed timwr closed 5 years ago

timwr commented 5 years ago
sRDI/Python$ cat bug.py
from ShellcodeRDI import *

dll = open("../testexploit.dll", 'rb').read()
shellcode = ConvertToShellcode(dll)

sRDI/Python$ python3 bug.py
Traceback (most recent call last):
  File "bug.py", line 4, in <module>
    shellcode = ConvertToShellcode(dll)
  File "sRDI/Python/ShellcodeRDI.py", line 212, in ConvertToShellcode
    return bootstrap + rdiShellcode + dllBytes + userData
TypeError: can't concat str to bytes

Fix is to change: https://github.com/monoxgas/sRDI/blob/master/Python/ShellcodeRDI.py#L59

    rdiShellcode32 = b"\x83\xEC......

I suspect EncodeBlobs.py already does this so I didn't send a pull request. Great project!

monoxgas commented 5 years ago

Thanks for this! I've fixed it in the latest commit.

Simple rush on my part :)