Hi I have been programing a little while with python and set up a small server program that waits for name and password to be entered. If the user name or the pass would is wrong, you have to restart. Is there any way to hack the server besides just brute forcing names and passwords? If there is, mind sharing some ideas so I can stop this from happening? Also its a UDP connection.
Here some of my code:
Code:data2 = data + ".txt"
f = open(data2,"r")
lineList = f.readlines()
f.close()
name = data
name2 = "Name: " + data + "\n"
if name2 == lineList[0]:
data,addr = UDPSock.recvfrom(buf)
password = "Password: " + data + "\n"
if password == lineList[1]:
print name,"log on."
data = name
(UDPSock.sendto(data,addr2))
data = "===Welcome==="
(UDPSock.sendto(data,addr2))
while 1:
class receiver(threading.Thread) : # Receiver thread
def __init__(self, socket ):
threading.Thread.__init__(self)
self.setDaemon(True)
def run(self) :
while True : # Receive thread
data,addr = UDPSock.recvfrom(buf)
if not data : break
print data
UDPSock.close()
receiver(UDPSock).start()
while True : # Send in main thread
data = time.ctime() + " Mradr: " + raw_input()
(UDPSock.sendto(data,addr2))
UDPSock.close()