This repository was archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathpaw-gps.py
More file actions
35 lines (28 loc) · 1.31 KB
/
paw-gps.py
File metadata and controls
35 lines (28 loc) · 1.31 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
import logging
import requests
import pwnagotchi.plugins as plugins
'''
You need an bluetooth connection to your android phone which is running PAW server with the GPS "hack" from Systemik and edited by shaynemk
GUIDE HERE: https://community.pwnagotchi.ai/t/setting-up-paw-gps-on-android
'''
class PawGPS(plugins.Plugin):
__author__ = 'leont'
__version__ = '2.0.0'
__name__ = 'pawgps'
__license__ = 'GPL3'
__description__ = 'Saves GPS coordinates whenever an handshake is captured. The GPS data is get from PAW on android '
__defaults__ = {
'enabled': False,
'ip': '',
}
def on_loaded(self):
logging.info('[paw-gps] plugin loaded')
if 'ip' not in self.options or ('ip' in self.options and self.options['ip'] is None):
logging.info('[paw-gps] No IP Address in the config file is defined, it uses the default (192.168.44.1:8080)')
def on_handshake(self, agent, filename, access_point, client_station):
ip = self.options['ip'] if self.options['ip'] else '192.168.44.1:8080'
gps = requests.get('http://' + ip + '/gps.xhtml')
gps_filename = filename.replace('.pcap', '.paw-gps.json')
logging.info('[paw-gps] saving GPS to %s (%s)', gps_filename, gps)
with open(gps_filename, 'w+t') as f:
f.write(gps.text)