Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/hubert3/iSniff-GPS
Browse files Browse the repository at this point in the history
  • Loading branch information
hubert3 committed Dec 29, 2012
2 parents 147c50c + c34b66e commit 6290f5b
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 10 deletions.
Binary file added iSniff_GPS/static/flag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions iSniff_GPS/static/jquery-latest.js

Large diffs are not rendered by default.

Binary file added iSniff_GPS/static/wifi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions iSniff_GPS/templates/apple-wloc.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
var image = 'http://png-4.findicons.com/files//icons/2482/icons8_ever_growing_set_of_windows_8_metro_style_icons/26/wifi.png'
var flag = 'https://developers.google.com/maps/documentation/javascript/examples/images/beachflag.png';
var flag = '/static/flag.png';
var image = '/static/wifi.png';

{% for b in bssids %}
var myLatLng = new google.maps.LatLng{{ apdict|key:b }};
var marker = new google.maps.Marker({position: myLatLng, map: map, icon: {% if b == bssid %}flag{%else%}image{%endif%}});
var marker = new google.maps.Marker({position: myLatLng, map: map, title: '{{b}} - {{manufdict|key:b}}', icon: {% if b == bssid %}flag{%else%}image{%endif%}});
google.maps.event.addListener(marker, "click", function() { window.location = '/apple-wloc/{{b}}'; });
google.maps.event.addListener(marker, "dblclick", function() { alert(0); });
{% endfor %}
}
</script>
Expand Down
6 changes: 3 additions & 3 deletions iSniff_GPS/templates/wigle-wloc.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta charset="utf-8">
<link href="https://google-developers.appspot.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="/static/jquery-latest.js"></script>
<script>
function initialize() {
var mapOptions = {
Expand All @@ -15,8 +15,8 @@
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
var image = 'http://png-4.findicons.com/files//icons/2482/icons8_ever_growing_set_of_windows_8_metro_style_icons/26/wifi.png'
var flag = 'https://developers.google.com/maps/documentation/javascript/examples/images/beachflag.png';
var image = '/static/wifi.png';
var flag = '/static/flag.png';

{% for b in bssids %}
var myLatLng = new google.maps.LatLng{{ apdict|key:b }};
Expand Down
15 changes: 14 additions & 1 deletion iSniff_GPS/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
import wigle
import wloc
import re
from netaddr import EUI

def get_manuf(apdict):
manufdict = {}
for m in apdict.keys():
try:
mac = EUI(m)
manufdict[m] = mac.oui.records[0]['org']
#.split(' ')[0].replace(',','')
#.replace(', Inc','').replace(' Inc.','')
except:
manufdict[m] = 'unknown'
return manufdict

class ClientList(ListView):
model = Client
Expand Down Expand Up @@ -104,7 +117,7 @@ def AppleWloc(request,bssid=None):
print 'Updated %s location to %s' % (a,(a.lat,a.lon))
except ObjectDoesNotExist:
pass
return render(request,'apple-wloc.html',{'bssid':bssid,'hits':len(apdict),'center':getCenter(apdict),'bssids':apdict.keys(),'apdict':apdict})
return render(request,'apple-wloc.html',{'bssid':bssid,'hits':len(apdict),'center':getCenter(apdict),'bssids':apdict.keys(),'apdict':apdict,'manufdict':get_manuf(apdict)})
else:
return render(request,'apple-wloc.html',{'bssid':'00:1b:2f:3d:a9:32'})

Expand Down
7 changes: 6 additions & 1 deletion iSniff_GPS/wloc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# -*- coding: utf-8 -*-
#!/usr/bin/python

# Mostly taken from paper by François-Xavier Aguessy and Côme Demoustier
# http://fxaguessy.fr/rapport-pfe-interception-ssl-analyse-donnees-localisation-smartphones/

import sys
import code
import requests
Expand All @@ -23,7 +27,8 @@ def ListWifiDepuisApple(wifi_list):
lat=wifi.location.latitude*pow(10,-8)
lon=wifi.location.longitude*pow(10,-8)
#kml.newpoint(name=wifi.bssid, coords=[(lon,lat)])
apdict[padBSSID(wifi.bssid)] = (lat,lon)
mac=padBSSID(wifi.bssid)
apdict[mac] = (lat,lon)
if wifi_list.HasField('valeur_inconnue1'):
print 'Inconnu1 : ', '%X' % wifi_list.valeur_inconnue1
if wifi_list.HasField('valeur_inconnue2'):
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export tzinfo=utc
export DJANGO_SETTINGS_MODULE=iSniff_GPS.settings
python ./isniff_import.py $*
python ./iSniff_import.py $*

0 comments on commit 6290f5b

Please sign in to comment.