Created
September 16, 2018 20:26
-
-
Save sburke98/a0a655e64ec7b84914d9acfb3cb46179 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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