# Pulse: a pattern-of-life sensor for the WiFi Pineapple Pager

*How I turned the Wi-Fi chatter around a building into a live picture of when it fills up, when it empties, and what never sleeps.*

## When does the building empty?

Picture a physical penetration test with one deceptively simple question in the scope: *when is this office empty enough to walk in?*

The client wants to know whether someone can tailgate in after hours, plant a device and leave unnoticed. The rules of engagement allow one entry attempt. Get the timing wrong and you either walk into a full office or into the cleaning crew at 21:00 that nobody mentioned.

The usual answer is to sit in a car across the street with a notebook for two days. That works, but it is slow, it is conspicuous, and it only tells you about the hours you watched. What I wanted was a sensor I could leave nearby for a few days that answers the question with data: when people arrive, when they leave, which hours are reliably quiet, and what never sleeps.

Nearly everyone carries a phone, and phones talk to Wi-Fi constantly. So I built **Pulse**: a payload for the Hak5 WiFi Pineapple Pager that turns that background chatter into a pattern of life for a site.

*The scenario above is illustrative: it describes the kind of problem Pulse is built for, not a specific client.*

## What Pulse does

Pulse listens passively and answers one question per 15 minutes: how many devices are around right now? Run it for hours or days and those counts become a picture of the site's daily rhythm.

It never connects to a network or sends a frame. It reads two kinds of traffic that devices broadcast anyway:

- **Probe requests**: phones and laptops asking "is my network here?", even when they are not connected to anything.
- **Data frames to an access point**: devices that are already connected, sending traffic.

At the end of a run, Pulse reports:

- the busiest moment, with a device count
- when people arrive and when they leave
- the quietest window of the day
- how many devices never leave (printers, cameras, smart TVs)
- a day × hour heatmap of the whole run

While it runs, the Pager serves a live dashboard to your phone or laptop over its own network. You see every device as it transmits, with its signal strength, and you can scrub back through the whole run.

Before writing any code, I went through all 201 payloads in Hak5's public repository and the open pull requests. There are excellent recon payloads for listing networks, tracking a single device or spotting surveillance hardware. None of them measures a *place* over time, so that is the gap Pulse fills.

## The hard part: counting phones that keep changing their name

Counting devices sounds like counting MAC addresses. It isn't, because modern phones randomize the MAC they use in probe requests and rotate it often, sometimes several times in a few minutes. Count MACs and one iPhone becomes five people.

The opposite trick doesn't fully work either. A device's radio advertises its capabilities in every probe request: supported rates, 802.11n/ac/ax capabilities, extended capabilities, vendor-specific elements, and the order in which it lists them. Those don't change when the MAC does, so together they make a fingerprint. But two identical phones on the same OS version share that fingerprint, so counting fingerprints turns an office full of iPhones into a handful of devices.

Pulse doesn't pretend to know the exact answer. It reports two bounds for every 15-minute slot:

- **Low** = devices with a fixed MAC + distinct fingerprints of randomized-MAC probes. Identical phones collapse into one, so this undercounts.
- **High** = every distinct MAC. A rotating phone counts more than once, so this overcounts.

The truth sits between them. For pattern-of-life work the exact number matters less than the shape: when the curve rises, when it falls, and where it bottoms out.

Two details made the counts trustworthy:

- **Gaps are not zeros.** The capture writes a heartbeat every minute it is alive. A slot only counts if two thirds of it was covered, so a crash or a reboot shows as a gap instead of a misleadingly empty office.
- **"Quiet" is relative to the baseline.** My first version called an hour quiet if it had under 20% of the peak. Real sites never got there, because printers and cameras never leave. Quiet now means within 20% of the range above that always-on baseline.

## How it's built

The Pager is a small device: a single-core 580 MHz MIPS chip running OpenWrt, with busybox, `tcpdump`, and no Python. That constraint shaped everything. Pulse is Bash and awk, nothing else on the capture path.

```plaintext
 tcpdump (probe requests, full hex) ─► joiner ─┐
                                               ├─► FIFO ─► parser (awk) ─► counts, devices, history  (flash)
 tcpdump (data frames to an AP)     ─► joiner ─┘                     └──► live.json, status.json     (RAM)
                                                                                   │
                                                          uhttpd on 172.16.52.1 ◄──┘──► dashboard in your browser
```

- **Two captures, one parser.** One `tcpdump` grabs probe requests with a full hex dump; the other only reads the headers of data frames sent to an access point. A tiny awk "joiner" turns each frame into a single line, so both streams can share one FIFO without interleaving halfway through a packet.
- **A real parser in awk.** The parser walks the radiotap header to find the 802.11 frame. It honours the radiotap flags, because a trailing checksum would otherwise be read as an extra information element and split one phone into two fingerprints. Then it walks the tagged elements to build the fingerprint, and pulls device names out of WPS elements. That's how a printer introduces itself as `HP-LaserJet-M404` or a PC as `DESKTOP-7Q2LK`.
- **A detached daemon.** The capture runs in its own session, so the Pager UI is free and a run can last days. It restarts a capture that dies, writes a heartbeat every minute, and stops itself at a set end time or at 10% battery.
- **Flash for history, RAM for live.** History is written to flash every 5 minutes. The live view is rewritten every 3 seconds, but in RAM, so the flash isn't worn down.

I tested everything off-device before it touched the Pager. A small test suite generates synthetic 802.11 frames with known answers, with Scapy, and runs the parser through busybox awk exactly like the device. It checks the counts, the checksum handling, device names, and that the privacy mode writes no MAC or name anywhere. A simulated three-day office checks the report: arrivals at 08:00, departures at 16:00, a flat weekend.

I built Pulse with Claude Code as a pair programmer: it wrote much of the code with me, and every design decision, test and hardware run went through me.

## The dashboard

The dashboard is a single HTML file that works offline. The Pager has no internet in the field, and neither may your phone when it's connected to the Pager. It is drawn to look like a field instrument, in the amber of the CRT-style theme I made for the Pager, with the IBM VGA pixel font for the wordmark.

It has three parts:

- **Live waterfall.** One row per device, one column per 10 seconds over the last 10 minutes, each cell coloured by signal strength from deep indigo at −95 dBm to white-hot at −30 dBm, with the dBm value printed in the cell where it fits. Rows carry the device's name, its maker from the MAC prefix, and its MAC.
- **Time machine.** The whole run as a strip of device counts. Drag across it to see the waterfall at any point in a 3, 12 or 24-hour window, or press Play and watch the site fill up and empty out.
- **Pattern of life.** The day × hour grid and the headline facts: busiest moment, arrivals, departures, quietest window, always-on devices.

When a run starts, the Pager shows a QR code. Scan it from a phone on the Pager's network and you're looking at the site's pulse.

## What the hardware taught me

The tests passed on my laptop. The Pager still had four lessons waiting:

1. **Your script isn't where you think it is.** The Pager runs a *copy* of each payload from `/tmp` and passes the real folder in an environment variable. Pulse located its helper files from the script's own path, found nothing, and failed. It now tries several locations and stops with a clear message if none works.
2. **"UTC" isn't always UTC.** The Pager's clock was correct, but its time zone was set to UTC+2 while `date` still labelled it "UTC". Pulse now defaults to the offset the Pager reports, because for pattern-of-life work a two-hour error ruins everything.
3. **There was no web server.** I assumed a device that runs evil portals must have one built in. It doesn't: Hak5's evil portal payload installs nginx and PHP itself. Pulse uses uhttpd, a 29 KB package. I installed it offline by streaming it from OpenWrt's official feed through my laptop and checking its SHA256 against the feed index. Afterwards I disabled its default service, so it only ever listens where Pulse tells it to.
4. **Check the port, not the process ID.** The dashboard reported "web server failed to start" even though uhttpd ran fine by hand. Pulse now checks whether the port is actually listening and keeps the server's error output in a log.

None of these showed up in a single off-device test. Every one of them would have bitten anyone else who installed the payload.

## Privacy and authorization

A tool that names devices and records when they were nearby is a tracking tool, not just a counter, and I'd rather say that plainly than bury it.

- Use Pulse only where you're authorized to: your own premises, or inside the scope and rules of engagement of a contracted test.
- Setting `IDENT=0` keeps the counts, the report and the dashboard, but writes no MAC addresses or device names anywhere. Devices become salted hashes, and the salt exists only in the capture process's memory, so they can't be traced back to a MAC or linked across runs.
- Radio fingerprints never touch disk in either mode.
- The dashboard has no login, so it binds only to the Pager's own management address. It's reachable from the Pager's network, not from a network the Pager happens to be connected to.

## What's next

Pulse works on hardware: the capture runs in the background and the dashboard shows live data. Next comes a multi-day run to prove the long-term pieces: CPU load in a busy place on a 580 MHz chip, storage growth, and the time machine with real history.

After that comes its companion, **Sealed Loot**. A sensor you leave behind for days has two problems: getting the data back without returning for the device, and protecting that data if the device is found. Sealed Loot encrypts loot on the Pager to the operator's public key, so the Pager itself can't decrypt it, and uploads it whenever a trusted network comes into range.

The building's question was simple: *when is nobody here?* It took two captures, an awk parser, four hardware surprises and a stubborn amount of testing to answer it honestly.
