Skip to content

Commit

Permalink
wifi sniffing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kkevsterrr committed Nov 6, 2016
1 parent 3b97423 commit bf1d1b9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def do_use(self, args):
return
cli = CapabilityInterface(self, cap).cmdloop()

def do_wifi(self, args):
self.core.get_wifis()

def do_network(self, args):
self.core.network.cur.execute("Select * from computers ORDER BY ip ASC")
print "ID\tIP\t\tMAC\t\t\tPorts\tLast Date"
Expand Down
15 changes: 14 additions & 1 deletion core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
import network
import traceback

from pythonwifi.iwlibs import Wireless
from capabilities import *
from scapy import *
from scapy.all import *
import network
sys.path.append("capabilities")

Expand Down Expand Up @@ -52,6 +53,7 @@ def get_local_ip(self, iface):
ipinfo = addrs[socket.AF_INET][0]
return ipinfo['addr']


def get_local_mac(self, iface):
return ni.ifaddresses(iface)[ni.AF_LINK][0]['addr']

Expand Down Expand Up @@ -88,6 +90,17 @@ def promisc(self, enable=True):
def get_categories(self):
return ["auxiliary", "dos", "arp", "enumeration", "sniff", "exploitation", "scan"]

def beacon(pkt):
if pkt.haslayer(Dot11):
if pkt.type == 0 and pkt.subtype == 8:
if pkt.addr2 not in ap_list:
ap_list.append(pkt.addr2)
print "AP MAC: %s with SSID: %s " % (pkt.addr2, pkt.info)

def get_wifis(self):
ap_list = []
sniff(iface="mon0", prn=self.beacon)

def get_capabilities(self, category=None):
caps = []
if category is None:
Expand Down

0 comments on commit bf1d1b9

Please sign in to comment.