I'm having an invalid syntax error with the socket module
Question: 
    #!/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()
    

I get an invalid syntax on the s.recv call, but I believe that the socket
isn't initiating a valid handshake. I can connect to the daemon through
netcat.


Answer: You miss the parenthesis after the s.send() function

