Skip to content

Commit

Permalink
Updated Wigle live lookup transform. Couple of other small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glenn Wilkinson committed Jun 13, 2014
1 parent b37a0c4 commit 9ef7871
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ _Client:_

1. INTRODUCTION AND OVERVIEW
=============================
Snoopy is a distributed, sensor, data collection, interception, analysis, and visualization framework. It is written in a modular format, allowing for the collection of arbitary data from various sources via Python plugins.
Snoopy is a distributed, sensor, data collection, interception, analysis, and visualization framework. It is written in a modular format, allowing for the collection of arbitrary data from various sources via Python plugins.

1. Architecture

Expand Down
2 changes: 1 addition & 1 deletion includes/wigle_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def lookupSSID(self,ssid):
payload={'longrange1': '', 'longrange2': '', 'latrange1': '', 'latrange2':'', 'statecode': '', 'Query': '', 'addresscode': '', 'ssid': ssid.replace("_","\_"), 'lastupdt': '', 'netid': '', 'zipcode':'','variance': ''}

results =self.__queryWigle(payload)
if results: #and 'error' not in results:
if results and 'error' not in results:
locations=self.__fetch_locations(results,ssid)
if (locations != None and locations[0]['overflow'] == 0):
for l in locations:
Expand Down
2 changes: 1 addition & 1 deletion plugins/rogueAP.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def stop(self):

@staticmethod
def get_parameter_list():
info = {"info" : "Create a rogue access point. - UNDER CONSTRUCTION",
info = {"info" : "Create a rogue access point.",
"parameter_list" : [ ("ssid=<name>","The SSID of the acces point."),
("promis=[True|False]","Set promiscuous mode (respond to all probe requests)."),
("run_dhcp=[True|False]","Run a DHCP server."),
Expand Down
10 changes: 6 additions & 4 deletions plugins/wigle.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ def __init__(self, **kwargs):
self.username = kwargs.get('username')
self.password = kwargs.get('password')
self.email = kwargs.get('email')
self.proxy = kwargs.get('proxy')

self.db = kwargs.get('dbms',None)
self.wig = Wigle(self.username,self.password, self.email)
self.wig = Wigle(self.username,self.password, self.email,self.proxy)

self.last_checked = 0
self.metadata = MetaData(self.db)
Expand Down Expand Up @@ -89,8 +90,9 @@ def run(self):
while self.RUN:
if not self.wig.cookies:
if not self.wig.login():
logging.error("Login to Wigle failed!")

logging.error("Login to Wigle failed! Aborting wigle plugin.")
self.stop()
break
try:
self.current_lookup = self.ssids_to_lookup.popleft()
#self.current_lookup = self.current_lookup.decode('utf-8', 'ignore')
Expand All @@ -108,7 +110,7 @@ def run(self):
if locations:
if 'error' in locations:
if 'shun' in locations['error']:
logging.info("Wigle account has been shunned, backing off for 20 minutes")
logging.info("Wigle account and/or IP has been shunned, backing off for 20 minutes")
self.ssids_to_lookup.append(self.current_lookup)
for i in range(60*20):
if not self.RUN:
Expand Down
16 changes: 9 additions & 7 deletions transforms/fetchSSIDLocations_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@ def main():
logging.debug(ssid)
logging.debug(type(ssid))

try:
f = open("wigle_creds.txt", "r")
user, passw, email,proxy = f.readline().strip().split(":")
except Exception, e:
print "ERROR: Unable to read Wigle user & pass, email (and optional proxy) from wigle_creds.txt"
print e
user = TRX.getVar("wigleUser")
passw = TRX.getVar("wiglePass")
email = TRX.getVar("wigleEmail")
proxy = TRX.getVar("wigleProxy")

if not user or not passw or not email:
print "ERROR: Please supply Wigle credentials in the 'Property View' on the right --->"
exit(-1)

wig=Wigle(user, passw, email, proxy)
if not wig.login():
print "ERROR: Unable to login to Wigle with creds from wigle_creds.txt. Please check them."
print "ERROR: Unable to login to Wigle with supplied wigle creds. Please check them."
exit(-1)
locations = wig.lookupSSID(ssid)
if 'error' in locations:
Expand Down

0 comments on commit 9ef7871

Please sign in to comment.