|
| 1 | +[](ctf=trend-micro-ctf-2015) |
| 2 | +[](type=analysis,reverse) |
| 3 | +[](tags=payload,drop) |
| 4 | +[](tools=gdb-peda) |
| 5 | +[](techniques=breakpoints) |
| 6 | + |
| 7 | +I think this is the unintended solution. |
| 8 | + |
| 9 | +We are given a [zip](../vonn.zip) password:wx5tOCvU3g2FmueLEvj5np9xJX0cND3K. |
| 10 | +This gives us a binary. |
| 11 | + |
| 12 | +```sh |
| 13 | +$ file vonn |
| 14 | +vonn: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=7f89c2bb36cc9d0882a4980a99d44a7674fb09e2, not stripped |
| 15 | + |
| 16 | +$ ./vonn |
| 17 | +You are not on VMM |
| 18 | +``` |
| 19 | +Thats it! we don't know whats happening. |
| 20 | +So i quickly load it with gdb-peda and after setting some breakpoints,we're ready to step through the execution. |
| 21 | + |
| 22 | +```sh |
| 23 | +gdb-peda$ b *0x400b8d |
| 24 | +Breakpoint 1 at 0x400b8d |
| 25 | +``` |
| 26 | +After some stepping when we get to puts call for output |
| 27 | +```objdump |
| 28 | + 0x400cd3 <main+326>: cmp rax,QWORD PTR [rbp-0x8] |
| 29 | + 0x400cd7 <main+330>: je 0x400cfc <main+367> |
| 30 | + 0x400cd9 <main+332>: mov edi,0x401100 |
| 31 | +=> 0x400cde <main+337>: call 0x400990 <puts@plt> |
| 32 | + 0x400ce3 <main+342>: mov rax,QWORD PTR [rbp-0xd0] |
| 33 | + 0x400cea <main+349>: mov rax,QWORD PTR [rax] |
| 34 | + 0x400ced <main+352>: mov rdi,rax |
| 35 | + 0x400cf0 <main+355>: mov eax,0x0 |
| 36 | +Guessed arguments: |
| 37 | +arg[0]: 0x401100 ("You are on VMM!") |
| 38 | +``` |
| 39 | +And I still don't know how!! |
| 40 | +All thats left is to do a c(continue). |
| 41 | +```sh |
| 42 | +gdb-peda$ c |
| 43 | +Continuing. |
| 44 | +You are on VMM! |
| 45 | +process 9248 is executing new program: /tmp/...,,,...,, |
| 46 | +warning: the debug information found in "/lib64/ld-2.19.so" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch). |
| 47 | +``` |
| 48 | + |
| 49 | +This file dropped a payload that was automatically loaded in gdb. Nice!! |
| 50 | +Lucky for me the breakpoint 0x400b8d is still an instruction in the payload binary. |
| 51 | +```objdump |
| 52 | + 0x0000000000400b74 <+248>: call 0x400790 <MD5@plt> |
| 53 | + 0x0000000000400b79 <+253>: mov edi,0x54 |
| 54 | + 0x0000000000400b7e <+258>: call 0x400780 <putchar@plt> |
| 55 | + 0x0000000000400b83 <+263>: mov edi,0x4d |
| 56 | + 0x0000000000400b88 <+268>: call 0x400780 <putchar@plt> |
| 57 | +=> 0x0000000000400b8d <+273>: mov edi,0x43 |
| 58 | + 0x0000000000400b92 <+278>: call 0x400780 <putchar@plt> |
| 59 | + 0x0000000000400b97 <+283>: mov edi,0x54 |
| 60 | + 0x0000000000400b9c <+288>: call 0x400780 <putchar@plt> |
| 61 | + 0x0000000000400ba1 <+293>: mov edi,0x46 |
| 62 | + 0x0000000000400ba6 <+298>: call 0x400780 <putchar@plt> |
| 63 | + 0x0000000000400bab <+303>: mov edi,0x7b |
| 64 | + 0x0000000000400bb0 <+308>: call 0x400780 <putchar@plt> |
| 65 | + 0x0000000000400bb5 <+313>: mov DWORD PTR [rbp-0xc4],0x0 |
| 66 | + 0x0000000000400bbf <+323>: jmp 0x400be9 <rnktmp+365> |
| 67 | +``` |
| 68 | +Looks good. Another c(continue) |
| 69 | + |
| 70 | +```sh |
| 71 | +gdb-peda$ c |
| 72 | +Continuing. |
| 73 | +TMCTF{ce5d8bb4d5efe86d25098bec300d6954}[Inferior 1 (process 9248) exited with code 0377] |
| 74 | +/tmp/...,,,...,,: No such file or directory. |
| 75 | +``` |
| 76 | + |
| 77 | +Huh! Was easier than expected. |
| 78 | +FLAG |
| 79 | + |
| 80 | +> TMCTF{ce5d8bb4d5efe86d25098bec300d6954} |
0 commit comments