11 Commits

Author SHA1 Message Date
0f1a6d6661 New version added v1.1.3 2023-01-24 21:39:02 +01:00
9d42fb9b5e Improving mac OS part 2023-01-24 21:35:10 +01:00
0fe7bd8eed Merge remote-tracking branch 'origin/master'
# Conflicts:
#	package.json
2023-01-24 21:26:35 +01:00
a8416e1a27 Merge pull request #19 from soitgoes/auditfix
Auditfix
2023-01-24 21:25:59 +01:00
d7715d1cdf Merge remote-tracking branch 'origin/master' 2023-01-24 21:24:40 +01:00
36e1f8ffaf Merge pull request #15 from soitgoes/master
Accomodate for apples elimination of BSSID from airport results
2023-01-24 21:24:15 +01:00
cf885a3bdd Dependency updates only 2023-01-24 21:23:10 +01:00
ba0bfc7d42 upgrade npm modules causing audit flags 2022-12-21 10:25:35 -06:00
d0f22a8ed2 Remove unused var 2022-01-08 11:28:21 -06:00
a021a5d469 Accomodate for apples elimination of BSSID from airport results 2022-01-08 11:24:23 -06:00
9fe4300976 npm changed package.json 2019-10-27 15:08:32 +01:00
7 changed files with 2681 additions and 1133 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
.idea .idea
node_modules node_modules
/yarn.lock

View File

@ -47,7 +47,7 @@ The tool returns an array with objects, each object representing a network with
* channel: WiFi channel * channel: WiFi channel
* ssid: SSID of the network (if available) * ssid: SSID of the network (if available)
* mac: MAC Address of the network access point * mac: MAC Address of the network access point (if available, otherwise empty string)
* rssi: signal strength * rssi: signal strength
In contrary to other wifi scanners no information about security is returned. This is due to the very different implementation In contrary to other wifi scanners no information about security is returned. This is due to the very different implementation

View File

@ -7,8 +7,6 @@ const tool = '/System/Library/PrivateFrameworks/Apple80211.framework/Version
const cmdLine = tool + ' -s'; const cmdLine = tool + ' -s';
const detector = tool + ' -getInfo'; const detector = tool + ' -getInfo';
const macRegex = /([0-9a-zA-Z]{1}[0-9a-zA-Z]{1}[:]{1}){5}[0-9a-zA-Z]{1}[0-9a-zA-Z]{1}/;
/** /**
* Parsing the output of airport (Mac OS X) * Parsing the output of airport (Mac OS X)
* @param str output of the tool * @param str output of the tool
@ -22,17 +20,13 @@ function parseOutput(str, callback) {
let lines = str.split('\n'); let lines = str.split('\n');
for (let i = 1, l = lines.length; i < l; i++) { for (let i = 1, l = lines.length; i < l; i++) {
let mac = lines[i].match(macRegex); if (lines[i] === '') continue;
if (!mac) { let elements = lines[i].substring(51).split(/[ ]+/);
continue;
}
let macStart = lines[i].indexOf(mac[0]);
let elements = lines[i].substr(macStart).split(/[ ]+/);
wifis.push({ wifis.push({
'ssid' : lines[i].substr(0, macStart).trim(), 'ssid' : lines[i].substring(0, 32).trim(),
'mac' : elements[0].trim(), 'mac' : '', // There is no more mac on a mac
'channel': parseInt(elements[2].trim(), 10), 'channel': parseInt(elements[1].trim(), 10),
'rssi' : parseInt(elements[1].trim(), 10) 'rssi' : parseInt(elements[0].trim(), 10)
}); });
} }
} }

3779
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "node-wifi-scanner", "name": "node-wifi-scanner",
"version": "1.1.2", "version": "1.1.3",
"description": "node.js module for WiFi network detection", "description": "node.js module for WiFi network detection",
"main": "index.js", "main": "index.js",
"keywords": [ "keywords": [
@ -35,12 +35,12 @@
"test": "mocha test" "test": "mocha test"
}, },
"dependencies": { "dependencies": {
"async": "3.1.0", "async": "3.2.4",
"lodash": "4.17.15" "lodash": "4.17.21"
}, },
"devDependencies": { "devDependencies": {
"grunt": "^1.0.3", "grunt": "1.5.3",
"grunt-bump": "0.8.0", "grunt-bump": "0.8.0",
"mocha": "6.2.0" "mocha": "10.2.0"
} }
} }

View File

@ -17,7 +17,7 @@ describe('airport', () => {
assert.equal(info.length, 36); assert.equal(info.length, 36);
let ap = info[0]; let ap = info[0];
assert.equal(ap.mac, '00:35:1a:90:56:03'); assert.equal(ap.mac, '');
assert.equal(ap.ssid, 'OurTest'); assert.equal(ap.ssid, 'OurTest');
assert.equal(ap.rssi, -70); assert.equal(ap.rssi, -70);
assert.strictEqual(ap.channel, 112); assert.strictEqual(ap.channel, 112);

View File

@ -1,5 +1,5 @@
SSID BSSID RSSI CHANNEL HT CC SECURITY (auth/unicast/group) SSID BSSID RSSI CHANNEL HT CC SECURITY (auth/unicast/group)
OurTest 00:35:1a:90:56:03 -70 112 Y CH WPA2(PSK/AES/AES) OurTest -70 112 Y CH WPA2(PSK/AES/AES)
OurDev 00:35:1a:90:56:04 -70 112 Y CH WPA2(PSK/AES/AES) OurDev 00:35:1a:90:56:04 -70 112 Y CH WPA2(PSK/AES/AES)
PDANet1 00:35:1a:90:56:09 -70 112 Y CH WPA2(PSK/AES/AES) PDANet1 00:35:1a:90:56:09 -70 112 Y CH WPA2(PSK/AES/AES)
TEST-Wifi 00:35:1a:90:56:0f -70 112 Y CH WPA2(PSK/AES/AES) TEST-Wifi 00:35:1a:90:56:0f -70 112 Y CH WPA2(PSK/AES/AES)