Monitoring WiFi devices from the command line

Programming Snapshot – Go WiFi Monitor

© Lead Image © Sergey Nivens, 123RF.com

© Lead Image © Sergey Nivens, 123RF.com

Article from Issue 287/2024
Author(s):

To see when clients are joining and leaving the wireless network, Mike Schilli writes a command-line utility that uses an object-relational mapping interface to store metrics in SQLite to later display historical data.

"What I don't know won't hurt me," as the saying goes, but the reverse is true for my wireless network. What are all my household gadgets doing? After all, no newly released device seems to be able to manage without a wireless network connection nowadays. Or are there actually some devices that I don't even know about? This definitely worries me and keeps me tossing and turning in my sleep.

On top of that, I am interested in more than the current situation. Curious by nature, I would like to know how long a device, once discovered, has been operating on the network, when it joined the network, and whether it is permanently active or occasionally lets its assigned IP address lease expire and then picks up a new one later. Let's build a data logger in Go to find out.

To detect active devices on the wireless network, it makes sense to call up the nmap scanner. This hacking tool is included with every good Linux distribution and knocks on the door of all potentially usable IP addresses in a subnet to see if a host responds. On a typical 192.168.0.0/24 subnet of a router for home network use, you can use 255 IP addresses, and nmap scans them with a barrage of probes at lightning speed (Figure 1).

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Scanning with Zenmap

    Discover your network with the user-friendly Zenmap network scanner.

  • Nmap Methods

    How does the popular Nmap scanner identify holes in network security? In this article, we examine some Nmap analysis techniques.

  • Nmap Workshop

    In "The Matrix Reloaded," Trinity uses Nmap to hack into the power grid to pave Neo's way to the architect of the virtual world. However, the port scanner is also ideal for more mundane purposes – such as discovering vulnerabilities in your domestic network.

  • Nmap Scripting

    Nmap is rolling out a new scripting engine to automatically investigate vulnerabilities that turn up in a security scan. We’ll show you how to protect your network with Nmap and NSE.

  • Information Commands

    A quick guide to 10 command-line tools to help you find hardware information.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News