Skip to content

Pipeline thinking

7 min readRecon Atlas

A pipeline you cannot safely rerun is a script you dread. A pipeline is a chain of small stages, each reading one text file and writing another. It is safe to rerun, it does nothing when its inputs are missing, and it stops at a human before anything is reported. Get those three properties right and a rerun costs you minutes instead of an evening.


The workflow script is already a pipeline in shape: subfinder writes a list, dnsx reads it and writes another, httpx reads that. What it lacks is memory and judgment. It does not know what it found yesterday, it does not rank what it found today, and it hands you everything at once.

A pipeline in this guide means staged transformations of text files. Each stage:

  1. reads one or more files with a known format,
  2. does one job,
  3. writes one file with a known format,
  4. and can be run on its own, by hand, with the same result.
# The shape of every stage
input file -> [ one job ] -> output file (+ a line in the run log)

Frameworks such as reconFTW or BBOT run everything in one command. They are covered on the automation page. They are good at breadth. A home-made pipeline of files wins when you need these:

Need Monolithic framework Staged files
See exactly why a host was flagged Hard. Logic is inside the tool Open the file the stage wrote
Rerun one step after a fix Usually reruns everything Rerun that stage on its input file
Change one decision, such as a score weight Fork or patch the tool Edit a config line
Add your own check Learn the plugin system Add a stage that reads a file
Run the same thing as everyone else Yes, by default Only if you copy someone
Low setup effort Yes No. You build and test it

The last two rows are the trade-off. A framework is faster to start. A pipeline you wrote is slower to build, but you understand every line, and its output is not identical to every other hunter on the program. Many hunters use both: a framework for broad collection, their own stages for dedup, scoring and delivery.

Same input, same output, safe to rerun. Idempotent is an engineering word for “doing it twice has the same effect as doing it once”. For a pipeline, that means:

  • Rerunning a stage on the same input produces the same output file, not a doubled one.
  • Rerunning the whole pipeline does not alert you again about findings you already saw.
  • A crash halfway through can be fixed by running again, without cleanup by hand.

The usual ways to break it are appending to a file instead of rewriting it, writing into a folder an earlier run already used, and recording “already seen” before the alert was sent. The worked pipeline shows a real bug of this kind that its own test caught.

Terminal window
# Not idempotent: every rerun appends the same hosts again
cat subs/passive.txt >> subs/all.txt
Terminal window
# Idempotent: anew appends only lines it has not seen, so a rerun adds nothing
anew subs/all.txt < subs/passive.txt > subs/new.txt

A missing config or scope file makes a stage do nothing, never everything. This is a hard design rule here, not a preference.

The danger is concrete. A script that builds its target list with grep -vFf scope/out-of-scope.txt can fail badly if that file is missing. Depending on how it is written, it either crashes or skips the filter and scans everything subfinder returned, vendor hosts included. A script that defaults to a high rate when policy.env is missing will hammer the target at 3 AM. In both cases the safe outcome is the same: stop, log why, exit non-zero.

Missing input Fail-open behaviour (wrong) Fail-closed behaviour (right)
scope/in-scope.txt Scan whatever enumeration returned Exit with code 3, send nothing
scope/out-of-scope.txt Skip the exclusion filter Exit with code 3. An empty file is a decision; a missing one is not
scope/policy.env Use the tool’s default rate, often 150 requests per second Exit with code 3
An empty list after filtering Run the next tool with no input, which some tools treat as “read stdin” or “use defaults” Skip the stage and log it

Part 4 turns this into code, and Part 11 proves it with a test.

The pipeline never reports. It finds, ranks, re-checks and packs evidence. A person confirms every finding by hand and writes every report. Scanners produce false positives, templates match error pages, and a model can describe a bug that does not exist. A report that turns out to be your tool’s mistake costs reputation that takes months to rebuild. Part 6 sets the minimum manual step for each severity.

Anti-pattern What it looks like Why it fails Fix
Everything to Nuclei nuclei -l all-hosts.txt with every template, every night Hundreds of thousands of Heavy active requests, a pile of info results, and the real hits were reported on launch day by the crowd Score first, scan the top of the queue with chosen tags (Part 5)
Output no one reads Twelve folders of results, a cron job, no summary Nothing changes your behaviour, so the pipeline is pure cost Every run ends in one short ranked file and one message (Part 7)
Alert fatigue Every new subdomain and every info hit pings your phone You mute the channel in a week, then miss the one critical Severity routing and a notification budget (Part 7)
No memory Each run reports everything it sees The same twenty findings every morning A ledger and fingerprints (Part 2)
Silent death A stage fails at 2 AM, nobody notices for a week You think the target is quiet; it is your pipeline that is quiet Heartbeats and health checks (Part 9)
Trusting the scanner A Nuclei hit becomes a report Duplicate or false positive, reputation damage Validation layer and a manual confirm (Part 6)

An early draft stamped run folders to the minute. The end-to-end test ran twice in one minute, reused the folder, and re-sent the first run’s alerts.

Stamps now include seconds, from date -u +%Y-%m-%dT%H%M%SZ. An existing folder is refused:

Terminal window
mkdir "$RUN" 2>/dev/null || die 6 "run folder $RUN already exists"

Exit 6 asserts the directory was already there. It does not assert the first run has finished. Two starts in the same second, or a clock step backward, hit the same refusal.

The whole pipeline architecture on one diagram. Every arrow is a file.

# Data flow of the worked pipeline, scope file to notification
scope/in-scope.txt ─┐
scope/out-of-scope ─┼─> [inscope filter] used by every stage that sends traffic
scope/policy.env ───┘
│
v
[1 enum: subfinder] Passive -> hosts.txt, new-hosts.txt (state/hosts.txt via anew)
v
[2 resolve: dnsx] Light active -> resolved.txt
v
[3 probe: httpx] Light active -> httpx.json, live.txt
v
[4 score: jq + awk] Passive -> queue.tsv <- etc/score.conf, state/cve-tech.txt
v
[5 scan: nuclei, top N] Heavy active -> nuclei.jsonl
v
[6 dedup: fingerprints] Passive -> new-findings.jsonl <- state/ledger.txt, state/suppress.txt
v
[7 verify + evidence] Light active -> evidence/<fp>/, triage.tsv
v
[8 deliver] Passive -> notify now (critical, high) | digest/queue.tsv (rest)
v
YOU -> manual confirm -> report (report writing)

A manual rerun of recon and triage on one program is an evening: start the tools, wait, diff by eye, re-check last week’s leads, decide what is new. So you do it once a week, if that, and the new staging host that appeared on Tuesday is found by someone else on Wednesday.

An automated rerun costs a few minutes of your attention: read a digest, open the one finding that matters. That changes three things.

Manual rerun Automated rerun
Cost to you per rerun An evening, roughly 2 to 4 hours (approximate) 5 to 15 minutes of reading (approximate)
How often you can afford it Weekly at best Daily or hourly per stage
Time from a new asset to your eyes Days Hours
What your hours go to Re-collecting Testing the top of the queue

The numbers are approximate. They depend on scope size, how many stages you automate, and how well tuned your scoring is. The direction is not in doubt: automation moves your hours from collection to testing, which is the only part that gets paid. It does not find bugs for you. It buys you time to find them, and gets you to new assets first, which is where the reconnaissance mindset guide says the bugs are.

Next, decide where the pipeline keeps its memory between runs in State, storage and deduplication.

Connections1 backlink · 10 outgoingFull graph →
Open local graph around this page
Open full graph →
Click a node to open · Drag to reposition · Scroll to zoom

Recon AtlasFor authorized testing only. Your scope is the map edge.