Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

What is this?

This is just a fun little toy I had been playing around with. After some testing it appears as though you can convert a bytes-like object variable directly into an executable shellcode buffer. This can be done by getting the variable's memory location with the id() function and then adding 32 bytes of offset to account for the PyObject header.

After that, it's as simple as adjusting the memory permissions (VirtualProtect) and running with the method of your choice. This example uses a cast to CFUNCTYPE and spawning it off as a thread.

Where was it tested

I've tested it on python 3.10-3.12, some are more forgiving than others and some shellcodes don't work. Was still a fun little project to tinker with.

About

executing shellcode directly from a python variable

Resources

Stars

30 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages