Lion Cipher Lab

Turn Nmap XML into an asset inventory with a short Python script

Why it matters

A scan result you cannot sort, count or compare is a wall of text. Every real assessment turns raw scanner output into an inventory first: what exists, what it exposes, what version. It is also the base for everything else in this series: diffing before and after a fix, finding the odd one out, deciding what to test first. Writing the small tool yourself means you understand each column and can trust it.

What you'll learn

Steps in this lab

  1. The rule, and the scan you start from
  2. Read the XML before you parse it
  3. Write the script
  4. Check your tool against the scanner
  5. Merge more than one scan and sort
  6. Turn the inventory into a short list to look at next
  7. The defender's view, and the fix

Open the full interactive lab →

Keep learning