Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Wigle API and simplifying GNU/Linux install process #75

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ data/probes.csv
data/maps/tiles/*
data/ChmodBPF/*
build/
package-lock.json
node_modules
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "node/src/wigle-api"]
path = node/src/wigle-api
url = https://github.com/brannondorsey/wigle-api.git
url = https://github.com/ibirisol/wigle-api.git
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,30 @@ sudo ./install.sh
open "Probe Kit.app" # OS X only
```

### Source Code Install with Virtualenv

That is for you minimalist guy...

```bash
sudo apt-get install libpcap-dev virtualenv mongodb tshark
sudo -E useradd -G wireshark $USER
git clone https://github.com/brannondorsey/ProbeKit.git
cd ProbeKit/
virtualenv -p python3 ._env
source ._env/bin/activate
pip install nodeenv
nodeenv --python-virtualenv
npm install node/
./shell/generate_settings.sh
```
To run web server and upload server.

```bash
node node/server.js -i <wireless interface> &
node node/upload_server.js &

```

## Getting Started

## License and Attribution
Expand All @@ -85,4 +109,4 @@ Probe Kit is built using the following libraries and projects:
- [Node.js](https://nodejs.org/)
- [NW.js](http://nwjs.io)
- [WiGLE.net](https://wigle.net)
- [MapBox](https://www.mapbox.com/)
- [MapBox](https://www.mapbox.com/)
23 changes: 23 additions & 0 deletions node/blue_server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
noble = require('noble')

noble.on('stateChange', function(state) {
console.log("Status: " + state);
if (state === 'poweredOn') {
console.log("Scanning...");
noble.startScanning();
} else {
console.log("Stoping...");
noble.stopScanning();
}
});

noble.on('discover', function(peripheral) {
console.log('Found device with local name: ' + peripheral.advertisement.localName,' and id: ' + peripheral._noble.address);
console.log('Advertising the following service uuid\'s: ' + peripheral.advertisement.serviceUuids);
Object.keys(peripheral.advertisement).forEach(function (key) {
var val = peripheral.advertisement[key];
console.log(key, ': ' + val);
});
console.dir(peripheral, {depth: null, colors: true});
console.log();
});
3 changes: 2 additions & 1 deletion node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"node": ">=0.12.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"preinstall": "npm install --global nw node-webkit-builder"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions node/src/WigleBatchDownloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ var util = require('util');
var wigle = require('./wigle-api');
var _ = require('underscore');

function WigleBatchDownloader(username, password, callback) {
function WigleBatchDownloader(api_token, callback) {

var self = this;
self.requestTimeout = 1000 * 60; // default
// self.maxConcurrentRequests = 1;
self.downloading = false;

if (username && password && callback) {
self.wigleClient = wigle.createClient(username, password, callback);
if (api_token && callback) {
self.wigleClient = wigle.createClient(api_token, callback);
}
}

Expand Down
10 changes: 4 additions & 6 deletions node/wigle_dump.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ var argv = require('minimist')(process.argv.slice(2));
var _ = require('underscore');
var WigleBatchDownloader = require('./src/WigleBatchDownloader');

var username = argv.username || argv.u || '46ea0d5b2';
var password = argv.password || argv.p || '46ea0d5b2';
var api_token = argv.token || argv.t || '46ea0d5b2';
var lastupdt = argv.lastupdt || argv.l;
var latrange1 = argv.north || argv.latrange1;
var latrange2 = argv.south || argv.latrange2;
Expand All @@ -24,8 +23,7 @@ if (!(latrange1 && latrange2 && longrange1 && longrange2)) {
console.log(' --east=<max_long>, longrange2=<max_long>');
console.log();
console.log('Options:');
console.log(' --username=[username], -u [username] Wigle.net username.');
console.log(' --password=[password], -c [password] Wigle.net password.');
console.log(' --token=[api_token], -t [api_token] Wigle.net API token.');
console.log(' --chunkSize=[chunkSize], -c [chunkSize] Set the chunkSize. i.e. 0.005');
console.log(' --lastupdt=[lastupdt], -l [lastupdt] Search only networks found since YYYYMMDDHHMMSS. i.e. 20100101000000');
console.log(' --dryRun, -d Calculate number of prepaired requests only. Does not actually execute reqests.');
Expand Down Expand Up @@ -72,11 +70,11 @@ if (dryRun) {
process.exit(0);
}

var batchDownloader = new WigleBatchDownloader(username, password, function(err){
var batchDownloader = new WigleBatchDownloader(api_token, function(err){

// fires on wigle.net login or (err on login failed
if (err) {
console.log('Login failed using username: ' + username + ' password: ' + password);
console.log('Login failed using this API token: ' + api_token);
process.exit(1);
}

Expand Down
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
"node-main": "node/nw_start.js",
"main": "public/loading.html",
"window": {
"title": "Probe Kit",
"icon": "media/icon_butterfly.png",
"toolbar": false,
"position": "center",
"resizable": true,
"title": "Probe Kit",
"icon": "media/icon_butterfly.png",
"toolbar": false,
"position": "center",
"resizable": true,
"width": 1024,
"height": 768,
"min_width": 1024,
"min_height": 600
"min_width": 1024,
"min_height": 600
},
"dependencies": {
"ProbeKit": "file:node",
"noble": "^1.8.1"
}
}