4個Fuzz Testing Python範例程式

4個Fuzz Testing Python範例程式

Image result for fuzz testing

from scapy.all import *
IP_ADDRESS="127.0.0.1"
PORT=6653

def sendPacket():
	sock=socket.socket()
	sock.connect((IP_ADDRESS,PORT))
	stream=StreamSocket(sock)
	stream.send("\x04\x00\x00\x08\x00\x00\x00\x01")
	stream.close()

if __name__==’__main__’:
	for i in range(0,100000):
		sendPacket()

 


from scapy.all import *
IP_ADDRESS="127.0.0.1"
PORT=40004

if __name__==’__main__’:

	for i in range(0,1000):
		sock=socket.socket()
		sock.connect((IP_ADDRESS,PORT))
		stream=StreamSocket(sock)
		payload="!#%&"
		stream.send(payload)
		stream.close()

 

from scapy.all import *

IP_ADDRESS="127.0.0.1"
PORT=34343

if __name__==’__main__’:

for i in range(0,1000):
	sock=socket.socket()
	sock.connect((IP_ADDRESS,PORT))
	stream=StreamSocket(sock)
	payload="\x30\x0a\x33\x32\x37\x36\x39\x0a"
	stream.send(payload)
	stream.close()

 

 

from scapy.all import *
IP_ADDRESS="127.0.0.1"
PORT=40004
if __name__ == ’__main__’:
	sock=socket.socket()
	sock.connect((IP_ADDRESS,PORT))
	stream=StreamSocket(sock)
	payload="\x00\x00\x00\x71\x6a\x81\x6e\x30\x81\x6b\xa1"\
			"\x03\x02\x01\x05\xa2\x03\x02\x01\x0a\xa4\x81"\
			"\x5e\x30\x5c\xa0\x07\x03\x05\x00\x50\x80\x00"\
			"\x10\xa2\x04\x1b\x02\x4e\x4d\xa3\x17\x30\x15"\
			"\xa0\x03\x02\x01\x00\xa1\x0e\x30\x0c\x1b\x06"\
			"\x6b\x72\x62\x74\x67\x74\x1b\x02\x4e\x4d\xa5"\
			"\x11\x18\x0f\x31\x39\x37\x30\x30\x31\x30\x31"\
			"\x30\x30\x30\x30\x30\x30\x5a\xa7\x06\x02\x04"\
			"\x1f\x1e\xb9\xd9\xa8\x17\x30\x15\x02\x01\x12"\
			"\x02\x01\x11\x02\x01\x10\x02\x01\x17\x02\x01"\
			"\x01\x02\x01\x03\x02\x01\x02"
	stream.send(payload)
	stream.close()

Leave a Reply

Your email address will not be published.