fFoska Posted October 18, 2016 Share Posted October 18, 2016 I'm writing a deauth attacker python script to kick everyone from an AP but my own devices (pretty much reverse engineered DanMcInerney's wifi jammer). It works fine so far, but every time scapy captures client macs it also captures devices that are connected to another AP or not connected at all. I tried fixing the mon0 channel with sudo airmon-ng start mon0 11 but it's not working... here's the code that gets the mac addresses: def sniffmgmt(p): stamgmtstypes = (0, 2, 4) if p.haslayer(Dot11): if p.type == 0 and p.subtype in stamgmtstypes: if p.addr2 not in CliList: print p.addr2 CliList.append(p.addr2) sniff(iface=moniface, prn=sniffmgmt, timeout = scantime) I could't find a proper documentation for scapy and I'm new to networking... so any help is apreciated. Thanks in advance ! Quote Link to comment Share on other sites More sharing options...
fFoska Posted October 19, 2016 Author Share Posted October 19, 2016 Update: So I found out that could get the captured packet's channel by reading the Radio Tap header, however I can't find the information in the header about channel, signal strenght etc. Is that because I messed up something setting up the monitor iface or is it hidden in some other way? Quote Link to comment Share on other sites More sharing options...
fFoska Posted October 21, 2016 Author Share Posted October 21, 2016 Never mind, I think I figured it out... I was capturing the wrong type of packets. I'm not sure what kind of packets are these but they are sent to the AP from the connected devices so they contain the AP's mac as a destination. here's the code: def cb(p): if p.haslayer(Dot11): if p.addr1 and p.addr2: # if "from" and "to" mac addr. exists p.addr1 = p.addr1.lower() # convert both macs to all lower case p.addr2 = p.addr2.lower() if APmac.lower() == p.addr1.lower(): # AP's mac address = packt destination mac ! if p.type in [1, 2]: # the type I'm looking for if p.addr2 not in CliList and p.addr2 != '': Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.