Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #by K-Metal
- # a small change from my ssdp filter
- import socket, sys, os, random
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- alp = ["a","b","c","d","e","f"]
- if len(sys.argv) < 2:
- print "Usage: <input> <output> <size>"
- sys.exit()
- file1 = sys.argv[1]
- file2 = sys.argv[2]
- size = int(sys.argv[3])
- with open(file1) as f:
- list = f.read().splitlines()
- s.settimeout(0.05)
- newfile = open(file2, "w")
- c = 0
- while c < len(list):
- choice = random.randint(0,5)
- a = str(list[c])
- s.sendto(alp[choice], (a.split(' ', 1)[0], 19))
- try:
- conn, addr = s.recvfrom(65535)
- amp = int(len(conn)) / 43
- if int(len(conn)) >= size:
- print str(addr[0])+" "+str(len(conn))+" [x"+str(amp)+"]"
- newfile.write(str(addr[0])+" "+str(len(conn))+"\n")
- except socket.timeout and socket.error:
- i = 0
- c = c + 1
- newfile.close()
- os.system("chmod 0777 %s" % file2)
- print "Finished"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement