-
Notifications
You must be signed in to change notification settings - Fork 1
/
third-eye.py
executable file
·73 lines (46 loc) · 1.77 KB
/
third-eye.py
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
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/python
import argparse
import os
from kismetclient import Client as KismetClient
from kismetclient import handlers
##### ARGPARSE AREA BEGIN #####
parser = argparse.ArgumentParser(
description='''Third-Eye is people finder.
If target people ( actually target device ) is your nearest Third-Eye will alert you.'''
)
#parser.add_argument('-t', help='Target MAC address', required=True)
parser.add_argument('-i', help='Interface for use', required=True)
args = parser.parse_args()
INTERFACE = args.i
#TARGET = args.t.upper()
##### ARGPARSE AREA END #####
##### COLOR AREA BEGIN #####
RED = "\033[31m"
BLUE = "\033[34m"
GREEN = "\033[32m"
WHITE = "\033[0m"
##### COLOR AREA END #####
address = ('127.0.0.1', 2501)
k = KismetClient(address)
k.register_handler('TRACKINFO', handlers.print_fields)
import time
log_file = open('logs','a+')
TARGETS = open("address").readlines()
target_list = {}
for i in TARGETS:
if not i.startwith("#"):
target_list[i.strip("\n").split(' ')[0]] = " ".join(i.strip().split()[1:])
def handle_ssid(client, bssid, channel, signal_dbm):
signal = str(signal_dbm.strip('-')[0])
for target_mac, target_name in target_list.iteritems():
target_mac = target_mac.upper()
if target_mac == bssid:
today_time = '( ' + time.strftime("%d/%m/%Y - %H:%M:%S") + ' )'
os.popen("espeak '" + target_name + " " + signal + "' -p 12 -s 160 ")
print BLUE + target_mac, target_name, '[ Signal lv:',signal, '] ' + today_time + WHITE
log_file.write(target_mac + ' ' + target_name + ' [ Signal lv: ' + signal + ' ] Time: '+ today_time + "\n")
log_file.flush()
break
k.register_handler('CLIENT', handle_ssid)
while True:
k.listen()