Skip to content

Instantly share code, notes, and snippets.

@0x5742
Created June 16, 2015 19:16
Show Gist options
  • Select an option

  • Save 0x5742/84da422782f032f58b3b to your computer and use it in GitHub Desktop.

Select an option

Save 0x5742/84da422782f032f58b3b to your computer and use it in GitHub Desktop.
run shellcode using python ctypes
m = b'black magic'
x = b'\x31\xc0\x40\xc3' # payload: xor eax, eax; inc eax; ret (x86)
from ctypes import *
p = string_at(id(m), 64).index(m)
CDLL(None)._FuncPtr(id(x) + p)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment