#!/bin/python
import socket
HOST = "localhost"
PORT = 30002
list = []
passwd = "UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ"
for i in range(1000, 9999):
list.append(i)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
iter = 0
data = s.recv(1024)
# Brute forcing loop
while 1:
s.send(passwd + " " + list[iter]
data = s.recv(1024)
if "Fail!" not in data:
print s.recv(1024)
s.close()
else:
print "Not: " + list[iter]
iter += 1
s.close()
我在s.recv调用上得到了无效的语法,但我相信套接字没有启动有效的握手。我可以通过netcat连接到守护进程。
答案 0 :(得分:2)
你错过了s.send()函数之后的括号