Skip to content
The record
Finding2 September 20265 min read

Device locks, and the port to an Ubuntu Secure Boot base

Detectors for the ways a second-hand business PC stays locked to its previous owner, the move to an Ubuntu Secure Boot base that detecting a BIOS administrator password forced, and four detectors found to be wrong by attacking them.

hardware-testingitad-lifecyclesecuritymethod

What was done

Built a set of detectors for the ways a second-hand business PC stays locked to its previous owner — BIOS administrator password, domain join, MDM enrolment, Autopilot registration, an Absolute/Computrace agent in firmware, BitLocker — in tools/lock-checks.sh, surfaced on the asset page and synced to the sticks. The vocabulary is the design: each check reports PASS, DETECTED, LOCKED, WARNING or UNKNOWN, and any single UNKNOWN makes the whole device UNVERIFIED, so CLEAR is only ever reached when every check ran and every one came back negative. Detecting a BIOS administrator password forced the live base off SystemRescue (no Microsoft-signed shim, will not boot with Secure Boot on) onto Ubuntu. Four detectors were then found wrong by attacking them, and six more were returning the empty string on a failed hive read — a failure the verdict logic read as "nothing found".

 each check reports one of:
   PASS   DETECTED   LOCKED   WARNING   UNKNOWN
                  |
                  v   device roll-up, in this order
   any LOCKED ............... LOCKED
   any DETECTED / WARNING ... WARNING
   any UNKNOWN .............. UNVERIFIED
   no rows filed at all ..... UNVERIFIED
   otherwise ................ CLEAR   (earned)
 
 CLEAR is the only word here that claims something
 about the machine, so it is the only one that has
 to be earned.

How thirteen per-check answers collapse into the one word a buyer acts on.


Status

Shipped, 2 September 2026.

The problem

A second-hand business PC can be locked to its previous owner in ways no amount of wiping removes: a BIOS administrator password, a domain join, an MDM enrolment, an Autopilot registration, an Absolute/Computrace agent baked into firmware, or BitLocker.

Buying such a machine is buying something you cannot resell. Before this, the audit said nothing about any of it.

What was built

Device Locks & Management Status, a set of detectors in lock-checks.sh, surfaced on the asset page and shipped to the sticks.

The vocabulary is the design. Each check reports PASS, DETECTED, LOCKED, WARNING or UNKNOWN, and the device roll-up is CLEAR, LOCKED, WARNING or UNVERIFIED — where any single UNKNOWN makes the whole device UNVERIFIED. A device is only ever CLEAR when every check ran and every one came back negative.

The base changed: SystemRescue to Ubuntu

port the audit tooling to an Ubuntu (Secure Boot) live base.

SystemRescue ships no Microsoft-signed shim and will not boot with Secure Boot enabled. That was tolerable while the station only read hardware. It stopped being tolerable the moment a BIOS administrator password became something being detected: you cannot ask an operator to disable Secure Boot in firmware to run a tool whose job is to report on firmware settings.

Ubuntu's signed shim boots unmodified. This decision is not to be revisited. corrected the stick build itself — Rufus ISO mode, one partition — after builds that produced a stick that would not boot.

Four detectors that were wrong, found by attacking them

the MDM check passed every machine it ever saw. It tested for the presence of an enrolment key that every Windows install carries. It had never once reported an enrolled machine.

Absolute: "Enabled" is the factory default, not a lock. The check read a firmware attribute and reported any value other than absent as a lock. Most machines ship with the module available but not activated, so the check flagged ordinary stock as carrying anti-theft software.

rewrite the Absolute check: parse WPBT instead of grepping it. Grepping a binary ACPI table for a string matches on coincidence. Parsing the table structure is the only way to say what it actually contains.

stop reporting every machine as WARNING. The roll-up was producing a warning on clean hardware, which trains an operator to ignore it.

The commit that named the class

Never let a failed probe read as a negative.

Six detectors whose hive reads could fail were returning the empty string, which the verdict logic read as "nothing found" — reporting not enrolled, not joined, no traces about machines nobody had successfully looked at.

This is the origin of the false-absence work. It was named here, fixed six times, and recurred anyway nineteen days later — which is the finding the September sweep documents.

Also here

elevate the audit, not the whole interface. The GUI runs unprivileged and elevates only the engine. the Secure Boot finding recorded from real hardware rather than reasoned about. four ways the audit could mislead or look hung.

What was deliberately not built

Nothing is ever removed. The station detects and reports locks; clearing an Autopilot or MDM registration is the registering organisation's job through Microsoft's own process. Detect → Verify → Report.

Open questions

No LOCKED path had fired on real hardware at this point — every detection was reasoning plus fixtures. That remained true for weeks, and is why the operator testing an Autopilot-locked ThinkPad in late September was so valuable.


The code

The device roll-up: precedence ordered so CLEAR has to be earned, and the status field parsed as a field rather than grepped out of the row.

# Precedence is deliberate. UNVERIFIED outranks CLEAR, so a device is only
# ever CLEAR when every check ran and every one came back negative.
lock_status() {
  # Parse the STATUS FIELD, never the raw row text. Grepping the whole record
  # for "|LOCKED|" meant a PASS row whose detail merely mentioned those
  # letters flipped the entire device verdict - reproduced with a BIOS value
  # of "Deactivate|LOCKED|yes". Field 3 is the status and nothing else is.
  local sts
  sts=$(printf '%s' "$LOCK_ROWS" | cut -d'|' -f3)
  printf '%s\n' "$sts" | grep -qx 'LOCKED'            && { echo LOCKED; return; }
  printf '%s\n' "$sts" | grep -qxE 'DETECTED|WARNING' && { echo WARNING; return; }
  printf '%s\n' "$sts" | grep -qx 'UNKNOWN'           && { echo UNVERIFIED; return; }
  # A record with no rows is not a machine that passed thirteen checks.
  [ -n "$LOCK_ROWS" ] || { echo UNVERIFIED; return; }
  echo CLEAR
}
From tools/lock-checks.sh — an excerpt, trimmed to the technique it illustrates.

Not shown. The detectors themselves: what registry keys, UEFI variables and ACPI table structures each check reads, and the WPBT parser. Published together they are a map of how to look for — and therefore how to hide — an ownership lock on a machine being resold, and they are a control still in use. The roll-up shown is the verdict layer, not a probe. Also withheld: the hive-mount paths and the stick's build and sync scripts.

A published copy. Commit references and internal identifiers have been removed and the operator is not named; the engineering, the counts and the stated limits are unchanged.