Solution:I'm thinking of an integer between 1 and 10.python.sctf.io:11234My number is randomly generated each time you guess.
root@ubuntu:~# nc python.sctf.io 11234 What is your guess?10 Nope! root@ubuntu:~#I write a simple python script to solved 3 problem (1 .. 10, 1 .. 100, 1 .. 1000)
#!/usr/bin/python import socket, sys while True: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('python.sctf.io', 11234)) #just change port recv = s.recv(8192) if "guess" in recv: print recv data = 10 #specific number and wait... print data s.send(bytes(data)) recv = s.recv(8192) print recv if not "Nope" in recv: print recv sys.exit() s.closeFlag:
Simple Guessing Game : qqq12345
Not-So-Simple Guessing Game : nopeisacoolword
Cruel Guessing Game : thatwascruel
ไม่มีความคิดเห็น:
แสดงความคิดเห็น