write-ups-challenges-2020-2021/scheming-schemer/test_script/test-first.py

25 lines
422 B
Python
Raw Permalink Normal View History

2022-11-24 17:03:20 +00:00
from pwn import *
import sys
import re
# Arg1: IP, Arg2: Port
#io = process(['racket ../calculator-app.rkt'])
try:
io = remote(sys.argv[1], sys.argv[2])
except:
print("Challenge not available")
exit(1)
print(io.recv(3))
io.sendline("flag")
print(io.recvline())
res = io.recvline()
print(res)
if re.findall('FTCGI', str(res)):
print("Found flag")
exit(0)
else:
print("No flag found")
exit(1)