loading
loading
Utilities
Check a file's values against conditions and exit with a matching code.
overview
assert-tool treats a file as a list of values and checks whether required conditions hold, exiting with a failure status when they do not so a workflow can stop early.
Match and regex modes cover exact and pattern checks; inputs can come from strings or files, which fits asserting that a recon step produced at least one live host.
Drop it between discovery and expensive scanning when empty or unexpected output should abort the run instead of wasting compute.
use cases
Assert that a discovery node's output file contains at least the values you expect, and exit non-zero so the pipeline halts instead of feeding nothing forward.
Match the output of an earlier stage against a known string or pattern to verify the right host, finding, or marker showed up before continuing.
Set match mode to all to require every condition, or any to pass on a single hit, so one node expresses either strict or loose gates.
Use regex matching to assert that values fit a shape, such as a status code range or a URL pattern, rather than a fixed string.
reference
| Name | Type | Flag | Description |
|---|---|---|---|
| match | STRING | --match | match mode [all/any] (default: `all`) |
| regex | STRING | --regex | use regex to match values |
| in-file | FILE | --in-file | file to read |
| delimiter | STRING | --delimiter | delimiter for multiple `--from-string` values (default: `,`) |
| from-file | FILE | --from-file | match from file |
| from-string | STRING | --from-string | match from string |
Showing key inputs. assert-tool exposes 6 inputs in total.
example
# assert-tool: fail the run unless live hosts were foundassert_tool --in-file live.txt --regex '.+' assert-tool: checking live.txtrule: regex .+lines: 12matched: 12status: okexit: 0guidance
Use assert-tool to turn a file's contents into a pass or fail decision inside a workflow. It is control flow, not a scanner, so place it between stages to guard a precondition. For raw filtering rather than gating, use gf or fgrep-by-string.
Filters lines by a fixed string. Use it to select values, assert-tool to decide pass or fail on them.
Pattern-based grep wrapper for selecting matches. assert-tool turns matches into an exit code.
Appends only new lines and signals change. A different kind of gate, on novelty rather than condition.
faq
related
Import, export, and link workflow data with Airtable.
Decode Android APK files into smali sources and resources.
Extract all hosted zones from AWS Route53.
Output file lines by batch size, given START_LINE and END_LINE.
Extract a batch range from a file's lines or a folder's files, with parallel processing.
Organize all the community Nuclei templates from across the ecosystem in one place.
A results file feeds assert-tool, which checks it against your conditions and exits pass or fail so the workflow knows whether to continue.
Facts on this page come from the live Trickest tool library.