Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Simple/Not-so-simple/Cruel Guessing Game writeup:
- Solved by AuPhish member cookthebook for sCTF 2015
- These challenges can all be solved with the same script. The server you are prompted to connect to takes the value you send it and compares it to a random value it chooses (which changes every time you connect). So, to solve each of these challenges I wrote one single script that simply connects and reconnects constantly, sending the value 1 until it returns a match. The running time is fairly quick for each challenge, each one taking slightly longer than the other. Here is the python script:
- -------------------------------------------------------------
- import socket, time
- while True:
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.connect(("python.sctf.io", 11234))
- s.recv(1024)
- s.send('1')
- data = s.recv(1024)
- s.close()
- print 'Received', repr(data)
- time.sleep(1)
- -------------------------------------------------------------
- Simply change the port to the appropriate challenge and it will run.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement