Comments (5)
Also, there is an occasional:
/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py:206: Warning: Out of range value for column 'last_update' at row 1
r = r + self.execute(query, a)
from snoopy-ng.
In addition, it may be worthwhile considering switching to the JSON-based API (the one introduced with the Wigle.net site refresh circa November 2014) as the now legacy one has a somewhat unobtrusive "NOTE: this version of the site is slated for deactivation!" warning at the very top of the page.
I have got a working prototype if you are interested.
from snoopy-ng.
Going back to my original comment, the issue is caused by the fact that the string "error" can actually be a valid portion of the returned HTML. For example, looking up SSID "infinity":
<tr class="search">
<td><a href="/gps/gps/Map/onlinemap2/?maplat=37.68862915&maplon=-97.32712555&mapzoom=17&ssid=infinity&netid=00:0a:95:f3:23:4f">Get Map</a></td>
<td>00:0a:95:f3:23:4f</td>
<td>infinity</td>
<td> </td>
<td>error</td>
<td>BSS</td>
<td>?</td>
<td>?</td>
<td>0000-00-00 00:00:00</td>
<td>2008-10-24 03:10:00</td>
<td>0011</td>
<td>Y</td>
<td>37.68862915</td>
<td>-97.32712555</td>
<td>20081024031000</td>
<td>0</td>
<td>0</td>
<td>7</td>
<td>N</td>
</tr>
Somewhat unexpected but still possible.
from snoopy-ng.
Well found on that bug, there are a few SSIDs that mess things up (e.g. an SSID with the word "error" in it), as well as account shun.
Yes it'd be great to have a look at your new API.
from snoopy-ng.
Below is my code, but luckily someone already implemented a Python-based API client and made it available via the cheese shop - https://github.com/viraptor/wigle/tree/master/wigle | https://pypi.python.org/pypi/wigle/0.0.4. I haven't played with it yet but it looks like it ticks all the boxes including the built-in pagination handling.
import datetime
import requests
import json
class InvalidCredentials(Exception):
pass
class InvalidQueryParams(Exception):
pass
class WigleApi():
api_root = 'https://wigle.net/api/v1/'
login_endpoint = 'jsonLogin'
user_endpoint = 'jsonUser'
query_endpoint = 'jsonSearch'
query_args = {'Query': 'Query'}
user_agent = 'Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)'
timeout = 5
def __init__(self, username, password):
self.username = username
self.password = password
self.user_info = None
self.last_params = None
self.last_result = None
self.session = requests.Session()
self.init_session()
def init_session(self):
r = self.session.post(self.api_root + self.login_endpoint, data={
'credential_0': self.username,
'credential_1': self.password},
headers=self.get_headers(), timeout=self.timeout)
data = json.loads(r.text)
if data['success']:
del data['success']
self.user_info = data
else:
raise InvalidCredentials
def get_headers(self):
return {'User-Agent': self.user_agent}
def get_user_info(self):
return self.user_info
def query(self, **kwargs):
self.last_result = None
params = {
'addresscode': '',
'statecode' : '',
'zipcode' : '',
'variance' : 0.01,
'latrange1' : '',
'latrange2' : '',
'longrange1' : '',
'longrange2' : '',
'lastupdt' : '',
'netid' : '',
'ssid' : '',
'freenet' : False,
'paynet' : False,
'onlymine' : False,
'Query' : 'Query'
}
if set(kwargs.keys()) - set(params.keys()):
raise InvalidQueryParams
params.update(kwargs)
for key in ['freenet', 'paynet', 'onlymine']:
if not params[key]:
del params[key]
if isinstance(params['lastupdt'], datetime.datetime):
params['lastupdt'] = params['lastupdt'].strftime('%Y%m%d%H%M%S')
self.last_params = params
r = self.session.post(url=self.api_root + self.query_endpoint,
data=params, headers=self.get_headers(),
timeout=self.timeout)
return self.process_query_response(r)
def has_next(self):
return self.last_result and self.last_result['count'] == 100
def get_next(self):
if not self.has_next() or not self.last_params:
return None
params = self.last_params
params['first'] = self.last_result['last'] + 1
params['last'] = self.last_result['last'] + self.last_result['count']
self.last_params = params
r = self.session.get(url=self.api_root + self.query_endpoint,
data=params, headers=self.get_headers(),
timeout=self.timeout)
return self.process_query_response(r)
def process_query_response(self, r):
data = json.loads(r.text)
if not ['success']:
print data['message']
return []
self.last_result = {
'count' : data['resultCount'],
'first' : data['first'],
'last' : data['last']
}
return data['results']
from snoopy-ng.
Related Issues (20)
- Snoopy-ng's Wifi module stops working after a period of time HOT 2
- Is this project still being developed? Are there any other projects doing similar things to Snoopy-ng? HOT 10
- snoopy_auth won't run HOT 3
- libpcap libary not included in Kali 2.0? HOT 1
- six.moves issue, ubuntu 16.04 HOT 4
- Issue authenticating to wiggle HOT 2
- openWRT
- snoopy-ng Kali 2.X - No module named libmproxy HOT 6
- program doesn't work after install HOT 1
- Change location of dpkt in install.sh
- [WARNING] Trouble parsing Bluetooth output: list index out of range HOT 1
- installation failure error command 'x86_64-linux-gnu-gcc' failed with exit status 1 HOT 1
- plz help i got snoopy to install but server wont start HOT 1
- unable to import range HOT 1
- No module named libmproxy HOT 6
- Please fix this so it installs properly HOT 2
- No module name libmproxy!! HOT 1
- issue with pylibcap on ubuntu pcap.c:853:5: error: format not a string literal and no format arguments HOT 4
- dpkt Package not working HOT 2
- Snoopy-ng Client software not working: [!!] Scapy exception whilst sniffing. Will back off for 5 seconds...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snoopy-ng.