复现了获取SSID,但手机连不上来获取主机名,可能是因为手机保存的热点是有密码的。
设置网卡
网卡支持的情况下,kali下直接运行
ifconfig wlan0 up
airmon-ng check kill
airmon-ng start wlan0
airbase-ng -P -C 30 -v wlan0mon | tee nohup.out
网页显示,python2
show.py,注意修改nohup.out的路径
import SimpleHTTPServer
import SocketServer
import threading
import os
import json
from time import sleep
class back(threading.Thread):def __init__(self):threading.Thread.__init__(self)def cmd(self,c):c=os.popen(c).read()return cdef run(self):while True:cmd_=self.cmd("cat ./nohup.out |grep -|awk -F 'from ' '{print$2}'|sort |uniq ").replace('"','').split('\n')nohup=''x=0for i in cmd_:j=' "%d":"%s",' %(x,i) nohup+= jx+=1nohup='{%s}'%nohup[:len(nohup)-1]cmd_h=self.cmd("cat /var/lib/dhcp/dhcpd.leases|grep host|awk '{print$2}' ").replace('"','').split('\n')x=0dhcp=''for i in cmd_h:j=' "%d":"%s",' %(x,i) dhcp+= jx+=1dhcp='{%s}'%dhcp[:len(dhcp)-1]open('Host.json','w').write(dhcp)open('Mac.json','w').write(nohup)print dhcp,nohupprint "reading .."sleep(30)
back().start()PORT = 8009
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)print "serving at port", PORT
httpd.serve_forever()
最终效果
类似于:
参考:
https://www.freesion.com/article/68271084308/