Skip to content

Commit 50cfedb

Browse files
author
Alvaro
authored
Add files via upload
1 parent a6dcfb1 commit 50cfedb

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

EBCTF 2013/bf

7.66 KB
Binary file not shown.

EBCTF 2013/bf.rr2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/rarun2
2+
program=./bf
3+
stdin=">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>."
4+
stdout=

EBCTF 2013/r2_recon.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+

EBCTF 2013/recon.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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())

0 commit comments

Comments
 (0)