agent failed to parse masscan binary output; finding list came back empty
Fixes an agent that gets an empty finding list from masscan's binary output format. Use when the agent tries to read the raw binary file directly instead of converting it with masscan's own reader. Not for masscan finding genuinely nothing.
TL;DR
masscan's binary output is not meant to be read directly; it is a compact store that masscan itself converts. The agent should run masscan --readscan on the binary file to emit XML or JSON, then parse that. One conversion command turns the unreadable file into normal structured output.
agent failed to parse masscan binary output; finding list came back emptyUse this when
- The agent opened masscan's
-oBbinary file as text or with a generic parser and got nothing usable. - The findings list is empty but the binary file is non-trivial in size.
- The agent does not know the
--readscanconversion step exists.
Not for this skill when
- masscan wrote XML or JSON output directly (
-oX,-oJ). Then parse that file; no conversion needed. - The binary file is empty or missing. That is a scan failure.
- masscan completed with genuinely no open ports. An empty converted result is a real outcome.
Steps
- Confirm the file is actually masscan binary output: check it was written with
-oBand has a plausible size. Verify: the file exists and is larger than a few bytes. - Convert it with masscan itself, for example
masscan --readscan scan.bin -oX scan.xml. Verify: the XML file is created and is well-formed. - Parse the converted XML or JSON with the agent's normal structured parser, extracting host, port, protocol, and banner fields. Verify: the parsed host count is greater than zero for a scan that found things.
- Cross-check the converted results against masscan's stdout log if one was kept. Verify: the open-port counts agree.
- Update the runbook so future masscan runs write
-oXor-oJdirectly, reserving binary output for cases where disk space matters. Verify: the run plan's masscan commands carry a text output flag.
Variant phrasings
masscan binary file unreadable by agent
Same conversion fix.
empty findings from masscan -oB output
Flag-specific phrasing.
agent cannot read masscan binary results
Symptom variant.
Compatibility: masscan 1.3.x. --readscan is the built-in converter for its own binary format.
Why it happens
The binary format is a space optimization, and nothing in the filename tells an agent it needs a conversion step; -oB looks like just another output flag. Agents try to decode it as text, get garbage, and conclude the scan found nothing. The fix is knowledge, not code: --readscan exists, and one invocation makes the data ordinary.
Edge cases / pitfalls
- A corrupt binary file converts partially or not at all. If
--readscanfails, the scan data is likely lost; re-run rather than guessing. - Binary output plus
--readscanis two steps where-oXis one. Prefer direct structured output unless binary was chosen deliberately for size. - Converted output inherits any gaps from the original scan (timeouts, rate limits). Validate coverage the same way as any other masscan result.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_hmMsoJnI3OC9xDzRqUJVVw