Giter VIP home page Giter VIP logo

airport-scan's Introduction

airport-scan

Perform WiFi network scanning from node on a Mac using airport.

Installation

$ npm install airport-scan

Usage

Vanilla JS

var scan = require('airport-scan');

scan.performScan()
.then(function (info) {})
.catch(function (err) {});

ES6

import * as scan from 'airport-scan';

// ...

Notes

This tool will only work on Mac, because it uses the airport -s command to retrieve raw information.

The scan will first try airport, followed by the expected absolute location /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport. If neither of these exists, it will fail.

API reference

performScan() -> Promise(information)

Promise to return an object containing information on found access points.

Return object is of the form:

{
  "accessPoints": [                   // List of access points found by the scan
    {
      "id": 0,                        // Incremental numerical ID for the AP
      "security": {                   // Description of the securit in use by AP - can be null
        "protocol": "WPA2",           // Protocol
        "auth": "PSK",                // Auth encryption scheme
        "unicast": "AES",             // Unicast encryption scheme
        "group": "AES",               // Group (multicast) encryption scheme
        "raw": "WPA2(PSK/AES/AES)"    // Raw output formatted as by airport -s
      },
      "cc": "GB",                     // Country code reported - can be null
      "ht": true,                     // Is high-throughput mode enabled?
      "channel": "2",                 // Channel (as string because sometimes '+1' etc)
      "rssi": -82,                    // RSSI (https://wikipedia.org/wiki/Received_signal_strength_indication)
      "bssid": "12:34:56:78:90:ab",   // BSSID (MAC address) for the AP
      "ssid": "Jack's Wifi"           // SSID reported
    },
    {
      "id": 1,
      "security": null,
      "cc": null,
      "ht": false,
      "channel": "60,+1",
      "rssi": -83,
      "bssid": "12:34:56:78:90:ab",
      "ssid": "Jack's Open Wifi"
    },
    // ...
  ],
  "commands": [                       // Reports the commands run to retrieve the raw data
    "airport -s"
  ]
}

airport-scan's People

Contributors

unwitting avatar

Watchers

James Cloos avatar Joe Richards avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.