cd ..back to case files

case 002 · active

Argus

A port scanner and network mapper built from scratch in Python. It finds open ports, works out what each device is, and ranks every host by risk.

Summary

Point Argus at a host or a whole subnet. It finds open ports, works out what each device is, matches the software against real vulnerability data, and gives every host a risk score so you know what to look at first. Everything runs locally; no scan data leaves the machine.

The problem

I didn’t want to run nmap and read the output without knowing how it got there. So I built each piece myself: port scanning, device fingerprinting, vulnerability matching. One rule for the whole project: nothing is faked. Every number on screen comes from a real measurement, and every guess says how confident it is.

Setup

                 core  (Python scanning engine,
                        returns data, never prints)
                  │                       │
                 CLI              FastAPI dashboard
                                          │ Server-Sent Events
                                          ▼
                                 browser: live results,
                                 React Flow network map

  storage: SQLite, encrypted at rest, per-user key from Argon2
  • One engine, two faces. The command-line tool and the web dashboard sit on the same core, so the scanning logic exists in exactly one place.
  • Live results. The dashboard streams each port to the browser as it’s found, so you watch results arrive instead of waiting.
  • Discovery in four layers, so it still works without admin rights: an ARP scan, the computer’s ARP cache, a ping and TCP sweep, and a passive listener that never sends anything and hears devices announce themselves over mDNS, SSDP, LLMNR and NetBIOS.
  • Fingerprinting: device type, vendor (from the MAC address), operating system (from service banners and TTL values) and name. Each guess carries a confidence level, so a guess never looks like a measured fact.
  • Vulnerabilities in two layers: rules for dangerous open ports (Telnet, SMB, RDP), then service versions matched against a locally synced CVE feed from NVD and OSV, flagged when CISA KEV lists the CVE as exploited in the wild.
  • Private by design: each user’s scans are encrypted with a key derived from their password, so one login can’t decrypt another’s. All libraries are hosted locally, so it works fully offline.
  • Tests: more than 1,300 automated tests, plus browser checks for the dashboard.

The demo: phones that won’t answer

I tested Argus on my own home network, a /24 behind a Tenda router.

Active probing failed on phones. Four phones answered none of my probes: 12 TCP ports, reverse DNS, NetBIOS, unicast mDNS, LLMNR and SSDP all came back empty. Modern phones are hardened against being asked who they are.

Listening found them anyway. A few minutes later the same phones announced themselves, unprompted, over multicast. So I added the listen-only sensor and a 75-second listening window to Quick Scan. In a live run all four listeners started, the sensor picked up a Windows PC’s name purely from its own announcement, and the router was identified by its MAC vendor with the address verified.

Modern devices are hardened against being asked, not against being overheard.

What broke and how I fixed it

Phantom hosts on the network map. One discovery run recorded 54 fake hosts in a single second, next to 15 real devices.

  • Cause: Windows ping.exe exits with code 0 even when the reply is “Destination host unreachable”, and Argus trusted the exit code. It only showed up under load (150 threads); pinging one host at a time never caught it.
  • Clue: every fake host had ttl=0. A real reply always carries a TTL, so zero meant there was no reply at all.
  • Fix: a host counts as alive only if a real TTL can be read from the reply. That check now lives in one small function, ping_reply_ttl, tested against real captured ping output. It also works on non-English Windows, where the error text is translated but TTL= is not.

A test that had been testing nothing. My test for sidebar flicker on page load kept passing. But the sidebar’s saved state had moved from browser storage to a cookie, and the test still set browser storage, so it was checking the wrong thing. I changed it to set the cookie and to check that the setting survives a reload. Then I put the original bug back on purpose and watched the test fail.

Lessons

  1. A command succeeding doesn’t mean it got the answer you wanted. Check the evidence (the TTL), not the exit code.
  2. A passing test proves nothing until you’ve seen it fail. Reintroduce the bug and make sure the test catches it.
  3. Some bugs only appear under real load. Test at the scale the tool actually runs at.
  4. Don’t fake features. An early version had an “SDN controller” panel showing numbers derived from ordinary port scans, with no controller behind it. I deleted it. An honest tool is worth more than one that only looks impressive.