Advertisement
Guest User

Untitled

a guest
Sep 10th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GDB 17.42 KB | None | 0 0
  1. gef➤  r < inn
  2. Starting program: /home/jesse/Downloads/robot_city_identify < inn
  3. [ Legend: Modified register | Code | Heap | Stack | String ]
  4. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ registers ]────
  5. $eax   : 0x0      
  6. $ebx   : 0x0      
  7. $ecx   : 0xf7fa7890  →  0x00000000
  8. $edx   : 0x0      
  9. $esp   : 0xffffcf50  →  0x08048c83  →  "/bin/false"
  10. $ebp   : 0xffffcf78  →  0xffffcf98  →  0x00000000
  11. $esi   : 0xf7fa6000  →  0x001d7d6c ("l}"?)
  12. $edi   : 0x0      
  13. $eip   : 0x804898b   →  <sys+19> call 0x8048530 <system@plt>
  14. $eflags: [zero carry parity ADJUST SIGN trap INTERRUPT direction overflow resume virtualx86 identification]
  15. $es: 0x002b  $fs: 0x0000  $ss: 0x002b  $cs: 0x0023  $gs: 0x0063  $ds: 0x002b  
  16. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ stack ]────
  17. 0xffffcf50│+0x00: 0x08048c83  →  "/bin/false"    ← $esp
  18. 0xffffcf54│+0x04: 0x00000000
  19. 0xffffcf58│+0x08: 0xf7fa6000  →  0x001d7d6c ("l}"?)
  20. 0xffffcf5c│+0x0c: 0x00000002
  21. 0xffffcf60│+0x10: 0xffffcf98  →  0x00000000
  22. 0xffffcf64│+0x14: 0xf7feae20  →  <_dl_runtime_resolve+16> pop edx
  23. 0xffffcf68│+0x18: 0xf7e362bb  →  <setvbuf+11> add edi, 0x16fd45
  24. 0xffffcf6c│+0x1c: 0x00000001
  25. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ code:i386 ]────
  26.     0x804897e <sys+6>          mov    DWORD PTR [ebp-0xc], 0x1
  27.     0x8048985 <sys+13>         sub    esp, 0xc
  28.     0x8048988 <sys+16>         push   DWORD PTR [ebp+0x8]
  29.  →  0x804898b <sys+19>         call   0x8048530 <system@plt>
  30.    ↳   0x8048530 <system@plt+0>   jmp    DWORD PTR ds:0x804a024
  31.        0x8048536 <system@plt+6>   push   0x30
  32.        0x804853b <system@plt+11>  jmp    0x80484c0
  33.        0x8048540 <exit@plt+0>     jmp    DWORD PTR ds:0x804a028
  34.        0x8048546 <exit@plt+6>     push   0x38
  35.        0x804854b <exit@plt+11>    jmp    0x80484c0
  36. ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ arguments (guessed) ]────
  37. system@plt (
  38.    [sp + 0x0] = 0x00000000
  39. )
  40. ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ threads ]────
  41. [#0] Id 1, Name: "robot_city_iden", stopped, reason: BREAKPOINT
  42. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ trace ]────
  43. [#0] 0x804898b → Name: sys()
  44. [#1] 0x80489f3 → Name: main()
  45. ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  46.  
  47. Breakpoint 1, 0x0804898b in sys ()
  48. gef➤  c
  49. Continuing.
  50. Identify yourself robot!
  51.  
  52. Enter your name:
  53. [ Legend: Modified register | Code | Heap | Stack | String ]
  54. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ registers ]────
  55. $eax   : 0x8048978   →  <sys+0> push ebp
  56. $ebx   : 0x0      
  57. $ecx   : 0xffffcf64  →  0x41414141 ("AAAA"?)
  58. $edx   : 0xf7fa789c  →  0x00000000
  59. $esp   : 0xffffcf10  →  0x08048c4f  →  "/bin/sh"
  60. $ebp   : 0xffffcf38  →  0xffffcf88  →  0xffffcf98  →  0x00000000
  61. $esi   : 0xf7fa6000  →  0x001d7d6c ("l}"?)
  62. $edi   : 0x0      
  63. $eip   : 0x804898b   →  <sys+19> call 0x8048530 <system@plt>
  64. $eflags: [zero carry PARITY ADJUST SIGN trap INTERRUPT direction overflow resume virtualx86 identification]
  65. $es: 0x002b  $fs: 0x0000  $ss: 0x002b  $cs: 0x0023  $gs: 0x0063  $ds: 0x002b  
  66. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ stack ]────
  67. 0xffffcf10│+0x00: 0x08048c4f  →  "/bin/sh"   ← $esp
  68. 0xffffcf14│+0x04: 0x00000000
  69. 0xffffcf18│+0x08: 0xf7fd00c0  →  0xf7fd00c0  →  [loop detected]
  70. 0xffffcf1c│+0x0c: 0x00000000
  71. 0xffffcf20│+0x10: 0xffffcf88  →  0xffffcf98  →  0x00000000
  72. 0xffffcf24│+0x14: 0xf7feae20  →  <_dl_runtime_resolve+16> pop edx
  73. 0xffffcf28│+0x18: 0xf7e33fbb  →  <fgets+11> add edi, 0x172045
  74. 0xffffcf2c│+0x1c: 0x00000001
  75. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ code:i386 ]────
  76.     0x804897e <sys+6>          mov    DWORD PTR [ebp-0xc], 0x1
  77.     0x8048985 <sys+13>         sub    esp, 0xc
  78.     0x8048988 <sys+16>         push   DWORD PTR [ebp+0x8]
  79.  →  0x804898b <sys+19>         call   0x8048530 <system@plt>
  80.    ↳   0x8048530 <system@plt+0>   jmp    DWORD PTR ds:0x804a024
  81.        0x8048536 <system@plt+6>   push   0x30
  82.        0x804853b <system@plt+11>  jmp    0x80484c0
  83.        0x8048540 <exit@plt+0>     jmp    DWORD PTR ds:0x804a028
  84.        0x8048546 <exit@plt+6>     push   0x38
  85.        0x804854b <exit@plt+11>    jmp    0x80484c0
  86. ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ arguments (guessed) ]────
  87. system@plt (
  88.    [sp + 0x0] = 0x00000000
  89. )
  90. ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ threads ]────
  91. [#0] Id 1, Name: "robot_city_iden", stopped, reason: BREAKPOINT
  92. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ trace ]────
  93. [#0] 0x804898b → Name: sys()
  94. [#1] 0x8048972 → Name: identify()
  95. [#2] 0x8048a04 → Name: main()
  96. ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  97.  
  98. Breakpoint 1, 0x0804898b in sys ()
  99. gef➤  ni
  100. [ Legend: Modified register | Code | Heap | Stack | String ]
  101. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ registers ]────
  102. $eax   : 0x0      
  103. $ebx   : 0x0      
  104. $ecx   : 0xffffcde0  →  0x00000000
  105. $edx   : 0x0      
  106. $esp   : 0xffffcf10  →  0x08048c4f  →  "/bin/sh"
  107. $ebp   : 0xffffcf38  →  0xffffcf88  →  0xffffcf98  →  0x00000000
  108. $esi   : 0xf7fa6000  →  0x001d7d6c ("l}"?)
  109. $edi   : 0x0      
  110. $eip   : 0x8048990   →  <sys+24> add esp, 0x10
  111. $eflags: [zero carry PARITY adjust SIGN trap INTERRUPT direction overflow resume virtualx86 identification]
  112. $es: 0x002b  $fs: 0x0000  $ss: 0x002b  $cs: 0x0023  $gs: 0x0063  $ds: 0x002b  
  113. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ stack ]────
  114. 0xffffcf10│+0x00: 0x08048c4f  →  "/bin/sh"   ← $esp
  115. 0xffffcf14│+0x04: 0x00000000
  116. 0xffffcf18│+0x08: 0xf7fd00c0  →  0xf7fd00c0  →  [loop detected]
  117. 0xffffcf1c│+0x0c: 0x00000000
  118. 0xffffcf20│+0x10: 0xffffcf88  →  0xffffcf98  →  0x00000000
  119. 0xffffcf24│+0x14: 0xf7feae20  →  <_dl_runtime_resolve+16> pop edx
  120. 0xffffcf28│+0x18: 0xf7e33fbb  →  <fgets+11> add edi, 0x172045
  121. 0xffffcf2c│+0x1c: 0x00000001
  122. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ code:i386 ]────
  123.     0x8048985 <sys+13>         sub    esp, 0xc
  124.     0x8048988 <sys+16>         push   DWORD PTR [ebp+0x8]
  125.     0x804898b <sys+19>         call   0x8048530 <system@plt>
  126.  →  0x8048990 <sys+24>         add    esp, 0x10
  127.     0x8048993 <sys+27>         mov    eax, DWORD PTR [ebp-0xc]
  128.     0x8048996 <sys+30>         test   eax, eax
  129.     0x8048998 <sys+32>         jne    0x80489a5 <sys+45>
  130.     0x804899a <sys+34>         das    
  131.     0x804899b <sys+35>         bound  ebp, QWORD PTR [ecx+0x6e]
  132. ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ threads ]────
  133. [#0] Id 1, Name: "robot_city_iden", stopped, reason: SINGLE STEP
  134. ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────[ trace ]────
  135. [#0] 0x8048990 → Name: sys()
  136. [#1] 0x8048972 → Name: identify()
  137. [#2] 0x8048a04 → Name: main()
  138. ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  139. 0x08048990 in sys ()
  140. gef➤
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement