DIY个人智能家庭网关—— python篇之获取手机WIFI连接(上线/下线)状态

本文介绍了如何通过Python脚本结合OpenWRT路由器的iw命令,实时监测手机连接路由器WIFI的状态。当手机连接或断开时,该方法能触发相应动作。通过定时查询并过滤设备列表来判断手机是否在线。
摘要由CSDN通过智能技术生成

如果需要根据自己的手机在连接或断开路由器WIFI时触发某个动作,可以通过iw命令定时查询手机的连接状态,执行如下命令可以列出所有连接到路由器WIFI的设备,


root@OpenWrt:~# iw dev wlan0 station dump
Station e0:ac:cb:b1:ca:ba (on wlan0)
        inactive time:  27010 ms
        rx bytes:       198087
        rx packets:     1417
        tx bytes:       843928
        tx packets:     969
        tx retries:     66
        tx failed:      4
        signal:         -70 dBm
        signal avg:     -70 dBm
        tx bitrate:     72.2 MBit/s MCS 7 short GI
        rx bitrate:     24.0 MBit/s
        expected throughput:    34.84Mbps
        authorized:     yes
        authenticated:  yes
        preamble:       short
        WMM/WME:        yes
        MFP:            no
        TDLS peer:      no
Station 04:52:f3:87:cf:77 (on wlan0)
        inactive time:  620 ms
        rx bytes:       316840
        rx packets:     3260
        tx bytes:       419569
        tx packets:     1
  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
About the e-Book https://u18113597.ctfile.com/fs/18113597-302542755 Kali Linux Wireless Penetration Testing Beginner's Guide 3rd Edition pdf Kali Linux Wireless Penetration Testing Beginner's Guide, Third Edition presents wireless pentesting from the ground up, and has been updated with the latest methodologies, including full coverage of the KRACK attack. Key Features Learn wireless penetration testing with Kali Linux Detect hidden wireless networks and discover their names Explore advanced Wi-Fi hacking techniques including rogue access point hosting and probe sniffing Develop your encryption cracking skills and gain an insight into the methods used by attackers and the underlying technologies that facilitate these attacks Book Description As wireless networks become ubiquitous in our lives, wireless penetration testing has become a key skill in the repertoire of the professional penetration tester. This has been highlighted again recently with the discovery of the KRACK attack which enables attackers to potentially break into Wi-Fi networks encrypted with WPA2. The Kali Linux security distribution comes with a myriad of tools used for networking attacks and detecting security loopholes. Kali Linux Wireless Penetration Testing Beginner's Guide, Third Edition has been updated to Kali Linux 2017.3 with the latest methodologies, including full coverage of the KRACK attack and how to defend against it. The book presents wireless pentesting from the ground up, introducing all elements of penetration testing with each new technology. You'll learn various wireless testing methodologies by example, from the basics of wireless routing and encryption through to detailed coverage of hacking methods and attacks such as the Hirte and Caffe Latte. What you will learn Understand the KRACK attack in full detail Create a wireless lab for your experiments Sniff out wireless packets, hidden networks, and SSIDs Capture and crack WPA-2 keys Sniff probe requests and track users through their SSID history Attack radius authentication systems Sniff wireless traffic and collect interesting data Decrypt encrypted traffic with stolen keys Who This Book Is For Kali Linux Wireless Penetration Testing Beginner's Guide, Third Edition is suitable for anyone who wants to learn more about pentesting and how to understand and defend against the latest wireless network attacks. Table of Contents Wireless Lab Setup WLAN and its Inherent Insecurities Bypassing WLAN Authentication WLAN Encryption Flaws Attacks on the WLAN Infrastructure Attacking the Client Advanced WLAN Attacks KRACK Attacks Attacking WPA-Enterprise and RADIUS WLAN Penetration Testing Methodology WPS and Probes
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值