Skip to content

Instantly share code, notes, and snippets.

@sburke98
Created September 16, 2018 20:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sburke98/a0a655e64ec7b84914d9acfb3cb46179 to your computer and use it in GitHub Desktop.
Save sburke98/a0a655e64ec7b84914d9acfb3cb46179 to your computer and use it in GitHub Desktop.
from pwn import *
from sympy import *
context.log_level = 'debug'
r = remote("misc.chal.csaw.io", 9002)
print(r.recvline())
print(r.recvline())
print(r.recvline())
print(r.recvline())
print(r.recvline())
print(r.recvline())
print(r.recvline())
X = symbols("X")
for i in range(100):
equation = r.recvline()
print("Equation is " + equation)
stuff = equation.split("=")
lhs,rhs = stuff
lhs = sympify(lhs)
rhs = sympify(rhs)
sols = solve(lhs-rhs,X)
print("Solution is " + str(sols[0].evalf()))
r.sendline(str(sols[0].evalf()))
print(r.recvline())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment