Cybersecurity Technology

Conduct Wireless Recon on Bluetooth, Wi-Fi & GPS with Sparrow-wifi

Conduct Wireless Recon on Bluetooth, Wi-Fi & GPS with Sparrow-wifi

If you’re ever in a situation where you need to take a peek at the wireless spectrum, whether it’s for Bluetooth or Wi-Fi devices, there’s a fascinating Python 3-based tool called Sparrow-wifi you should check out. It’s cross-platform, easy to use, and has an impressive GUI that shows you the signal strength of nearby devices.

Sparrow-wifi, branded as a “next-generation” analysis tool for wireless reconnaissance and surveillance, is simple to install. There’s just a bunch of Python libraries you need, and then no matter what system you’re on, it should be pretty easy to use. It works great on a Raspberry Pi, and just as good on Kali Linux.

What You Could Do with Sparrow-Wifi

Ghostop14 created Sparrow-wifi to be installed on a Raspberry Pi attached to a drone or rover for war-flying or wardriving use cases. It was even tested out on a 3DR Solo aerial drone, and you can read more about their experience using Sparrow-wifi on Raspberry Pi and drone on the GitHub page. We’ll just be using it on a Kali Linux system running on a laptop, but it’ll be similar for a Pi-based project.

Before getting into using Sparrow-wifi, it’s good to show what all it can do. Being a “next-generation 2.4 GHz and 5 GHz Wifi spectral awareness tool,” it has Wi-Fi capabilities, a software-defined radio, advanced Bluetooth options, and GPS capabilities (which can also be connected to the GPS on drones and rovers). The most prominent features worth pointing out today include but aren’t limited to:

  • Overlay 2.4 GHz and 5 GHz spectrums in real-time on top of the Wi-Fi spectrum.
  • Identify SSID information for nearby devices over Wi-Fi.
  • Identify nearby Bluetooth and Bluetooth LE devices.
  • Track Bluetooth LE advertisement sources (iBeacons) with a telemetry window.
  • Send out your own iBeacon advertisements.
  • War-fly or wardrive using a Raspberry Pi on a drone or rover using GUI-controlled or autonomous scan and record modes.
  • Import or export from or to a CSV file or JSON file.
  • See Google Maps locations from GPS coordinates provided by discovered SSID or Bluetooth devices, which can be helpful to plot the Wi-Fi telemetry over time.
  • Step 1
    Update & Upgrade Kali

    Before installing anything, it’s good to use update to resync and update package index files on the system from their sources, as well as upgrade to update all of the tools that have newer versions found in the update. The upgrade might take a while, depending on how many packages are out of date.

    ~$ sudo apt update && sudo apt upgrade

    Hit:1 kali-rolling InRelease
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    17 packages can be upgraded. Run 'apt list --upgradable' to see them.
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    The following packages were automatically installed and are no longer required:
    fonts-glyphicons-halflings gir1.2-appindicator3-0.1 libappindicator3-1
    libboost-iostreams1.67.0 libboost-system1.67.0 libboost-thread1.67.0
    libgdal26 libicu63 libmpdec2 libprotobuf22 libpython3.7-minimal
    libpython3.7-stdlib libqhull7 libre2-6 libx264-155 libx265-179
    php7.3-mysql python3-flask-session python3-pcapfile python3.7
    python3.7-minimal ruby-did-you-mean
    Use 'sudo apt autoremove' to remove them.
    The following packages have been kept back:
    crackmapexec gcc-10-base lib32gcc-s1 lib32stdc++6 libatomic1 libcc1-0
    libgcc-s1 libgfortran5 libgomp1 libitm1 liblsan0 libobjc4 libquadmath0
    libstdc++6 libtsan0 libubsan1 php-common
    0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.

    Step 2
    Install the Needed Dependencies

    Now, we need to install some of the Python 3 and GPS tools needed, including python3-pip, gpsd, gpsd-clients, python3-tk, and python3-setuptools. Use the following command to do so.

    ~$ sudo apt install python3-pip gpsd gpsd-clients python3-tk python3-setuptools

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    python3-setuptools is already the newest version (46.1.3-1).
    python3-setuptools set to manually installed.
    The following additional packages will be installed:
    gpsd-tools libgps26 python-pip-whl python3-gps python3-wheel
    Suggested packages:
    tix python3-tk-dbg
    The following NEW packages will be installed:
    gpsd gpsd-clients gpsd-tools libgps26 python-pip-whl python3-gps
    python3-pip python3-wheel
    The following packages will be upgraded:
    1 upgraded, 8 newly installed, 0 to remove and 824 not upgraded.
    Need to get 3,533 kB of archives.
    After this operation, 7,755 kB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 kali-rolling/main amd64 libgps26 amd64 3.20-12 [98.6 kB]
    Get:2 kali-rolling/main amd64 gpsd amd64 3.20-12 [413 kB]
    Get:3 kali-rolling/main amd64 gpsd-tools amd64 3.20-12 [299 kB]
    Get:4 kali-rolling/main amd64 python3-gps amd64 3.20-12 [105 kB]
    Get:5 kali-rolling/main amd64 gpsd-clients amd64 3.20-12 [432 kB]
    Get:6 kali-rolling/main amd64 python-pip-whl all 20.0.2-5kali1 [1,842 kB]
    Get:7 kali-rolling/main amd64 python3-wheel all 0.34.2-1 [24.0 kB]
    Get:8 kali-rolling/main amd64 python3-pip all 20.0.2-5kali1 [211 kB]
    Get:9 kali-rolling/main amd64 python3-tk amd64 3.8.5-1 [109 kB]
    Fetched 3,533 kB in 1s (2,563 kB/s)
    Reading changelogs... Done
    Selecting previously unselected package libgps26:amd64.
    (Reading database ... 287092 files and directories currently installed.)
    Preparing to unpack .../0-libgps26_3.20-12_amd64.deb ...
    Unpacking libgps26:amd64 (3.20-12) ...
    Selecting previously unselected package gpsd.
    Preparing to unpack .../1-gpsd_3.20-12_amd64.deb ...
    Unpacking gpsd (3.20-12) ...
    Selecting previously unselected package gpsd-tools.
    Preparing to unpack .../2-gpsd-tools_3.20-12_amd64.deb ...
    Unpacking gpsd-tools (3.20-12) ...
    Selecting previously unselected package python3-gps.
    Preparing to unpack .../3-python3-gps_3.20-12_amd64.deb ...
    Unpacking python3-gps (3.20-12) ...
    Selecting previously unselected package gpsd-clients.
    Preparing to unpack .../4-gpsd-clients_3.20-12_amd64.deb ...
    Unpacking gpsd-clients (3.20-12) ...
    Selecting previously unselected package python-pip-whl.
    Preparing to unpack .../5-python-pip-whl_20.0.2-5kali1_all.deb ...
    Unpacking python-pip-whl (20.0.2-5kali1) ...
    Selecting previously unselected package python3-wheel.
    Preparing to unpack .../6-python3-wheel_0.34.2-1_all.deb ...
    Unpacking python3-wheel (0.34.2-1) ...
    Selecting previously unselected package python3-pip.
    Preparing to unpack .../7-python3-pip_20.0.2-5kali1_all.deb ...
    Unpacking python3-pip (20.0.2-5kali1) ...
    Preparing to unpack .../8-python3-tk_3.8.5-1_amd64.deb ...
    Unpacking python3-tk:amd64 (3.8.5-1) over (3.8.2-2) ...
    dpkg: warning: unable to delete old directory '/usr/lib/python3.7/tkinter': Directory not empty
    Setting up libgps26:amd64 (3.20-12) ...
    Setting up gpsd-tools (3.20-12) ...
    Setting up python3-tk:amd64 (3.8.5-1) ...
    Setting up python3-wheel (0.34.2-1) ...
    Setting up python-pip-whl (20.0.2-5kali1) ...
    Setting up python3-gps (3.20-12) ...
    Setting up gpsd (3.20-12) ...
    Creating/updating gpsd user account...
    gpsd.socket is a disabled or a static unit, not starting it.
    gpsd.service is a disabled or a static unit, not starting it.
    gpsd.socket is a disabled or a static unit, not starting it.
    Setting up gpsd-clients (3.20-12) ...
    Setting up python3-pip (20.0.2-5kali1) ...
    Processing triggers for desktop-file-utils (0.24-1) ...
    Processing triggers for mime-support (3.64) ...
    Processing triggers for libc-bin (2.30-4) ...
    Processing triggers for man-db (2.9.1-1) ...
    Processing triggers for kali-menu (2020.2.2) ...

    Before installing the next batch of tools that are needed, you should upgrade pip3 first to prevent errors that others have experienced when installing the other dependencies. Use the following command to do it.

    ~$ sudo pip3 install --upgrade pip

    Collecting pip
    Downloading pip-20.2.2-py2.py3-none-any.whl (1.5 MB)
    |████████████████████████████████| 1.5 MB 1.0 MB/s
    Installing collected packages: pip
    Attempting uninstall: pip
    Found existing installation: pip 20.0.2
    Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'pip'. No files were found to uninstall.
    Successfully installed pip-20.2.2

    Finally, install the last batch of dependencies needed for Sparrow-wifi, which include QScintilla, PyQtChart, gps3, dronekit, manuf, python-dateutil, numpy, and matplotlib.

    ~$ sudo pip3 install QScintilla PyQtChart gps3 dronekit manuf python-dateutil numpy matplotlib

    Collecting QScintilla
    Downloading QScintilla-2.11.5-cp35.cp36.cp37.cp38-abi3-manylinux2014_x86_64.whl (2.6 MB)
    |████████████████████████████████| 2.6 MB 1.0 MB/s
    Collecting PyQtChart
    Downloading PyQtChart-5.15.0-5.15.0-cp35.cp36.cp37.cp38-abi3-manylinux2014_x86_64.whl (1.2 MB)
    |████████████████████████████████| 1.2 MB 7.2 MB/s
    Collecting gps3
    Downloading gps3-0.33.3-py2.py3-none-any.whl (29 kB)
    Collecting dronekit
    Downloading dronekit-2.9.2-py3-none-any.whl (56 kB)
    |████████████████████████████████| 56 kB 5.9 MB/s
    Collecting manuf
    Downloading manuf-1.1.1-py3-none-any.whl (539 kB)
    |████████████████████████████████| 539 kB 10.4 MB/s
    Requirement already satisfied: python-dateutil in /usr/lib/python3/dist-packages (2.8.1)
    Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (1.17.4)
    Requirement already satisfied: matplotlib in /usr/lib/python3/dist-packages (3.2.1)
    Requirement already satisfied: PyQt5>=5.10.1 in /usr/lib/python3/dist-packages (from QScintilla) (5.14.2)
    Collecting PyQt5-sip<13,>=12.8
    Downloading PyQt5_sip-12.8.0-cp38-cp38-manylinux1_x86_64.whl (293 kB)
    |████████████████████████████████| 293 kB 11.2 MB/s
    Collecting pymavlink>=2.2.20
    Downloading pymavlink-2.4.9.tar.gz (3.6 MB)
    |████████████████████████████████| 3.6 MB 8.2 MB/s
    Collecting monotonic>=1.3
    Downloading monotonic-1.5-py2.py3-none-any.whl (5.3 kB)
    Requirement already satisfied: future in /usr/lib/python3/dist-packages (from pymavlink>=2.2.20->dronekit) (0.18.2)
    Requirement already satisfied: lxml in /usr/lib/python3/dist-packages (from pymavlink>=2.2.20->dronekit) (4.5.0)
    Building wheels for collected packages: pymavlink
    Building wheel for pymavlink ( ... done
    Created wheel for pymavlink: filename=pymavlink-2.4.9-cp38-cp38-linux_x86_64.whl size=3695087 sha256=91c89fc1e95245a57d461a2cb23fcbd10c7319249cf782eb575c17fbe1e3ffa0
    Stored in directory: /root/.cache/pip/wheels/3b/26/1c/5500a65a7d7ac54cade1db721eefce7b5c6e451862a21423bb
    Successfully built pymavlink
    Installing collected packages: PyQt5-sip, QScintilla, PyQtChart, gps3, pymavlink, monotonic, dronekit, manuf
    Successfully installed PyQt5-sip-12.8.0 PyQtChart-5.15.0 QScintilla-2.11.5 dronekit-2.9.2 gps3-0.33.3 manuf-1.1.1 monotonic-1.5 pymavlink-2.4.9
    PyQtChart gps3 dronekit manuf python-dateutil numpy matplotlib

About the author


Add Comment

Click here to post a comment

Sponsored Hosting