Evaluating a sample shellcode fragment using the C program is not difficult. This will include storing shellcode in an array of characters, creating a function pointer, casting the pointer into a pointer and pointing it to an array and calling the function (pointer).
Here's how it works if you can execute memory in nastycode[] :
char nastycode[] = "\x00\x00\x00..."; void (*execute_ptr) (void); execute_ptr = (void *)nastycode; execute_ptr();
Is there a way to do the same using Python code? Or does the fact that Python code translates into bytecode make such an effort impossible?
user277465
source share