forked from GONZOsint/geowifi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFruitifinder.py
28 lines (25 loc) · 1.01 KB
/
Fruitifinder.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
import requests
import blackboxprotobuf
import sys
def apple_bssid(bssid):
x = {}
x['bssid'] = bssid
data_bssid = f'\x12\x13\n\x11{bssid}\x18\x00\x20\01'
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
data = '\x00\x01\x00\x05en_US\x00\x13com.apple.locationd\x00\x0a8.1.12B411\x00\x00\x00\x01\x00\x00\x00' + chr(len(data_bssid)) + data_bssid
response = requests.post('https://gs-loc.apple.com/clls/wloc', headers=headers, data=data)
try:
x['lat'] = '{:.8f}'.format(blackboxprotobuf.decode_message(response.content)[0]['2'][0]['2']['1']/10**8)
x['lon'] = '{:.8f}'.format(blackboxprotobuf.decode_message(response.content)[0]['2'][0]['2']['2']/10**8)
except:
x['error'] = "Not Found"
return x
def main():
found = apple_bssid(sys.argv[1])
try:
if found:
print("found " + found['bssid'] + " at https://google.com/maps/dir/" + str(found['lat']) + ',' + str(found['lon']))
except:
pass
if __name__=="__main__":
main()