scantarget — Target parsing and expansion
Why
Scanning workflows fail when target input is inconsistent (https://, plain domain, IP, CIDR, mixed formats). scantarget standardizes target ingestion and normalization so scanners process a stable target model instead of parsing strings repeatedly.
It gives you parse utilities, list loaders, and CIDR expansion in one place, reducing scanner-specific parsing bugs and input edge-case drift.
Quick Start
use ;
Features
- Parse URLs, domains, IPs, and CIDR values with strong validation.
TargetListandTargetListErrorfor ingest workflows.- Expand CIDR ranges into concrete targets.
- Parse from args, strings, files, and stdin.
- Optional trait adapter with
TargetSource.
TOML Configuration
scantarget supports TOML target lists in this shape:
= ["https://example.com", "example.org", "203.0.113.0/30"]
use TargetList;
let targets = from_toml.unwrap;
API Overview
Targetenum:Url,Domain,Ip,Cidr.TargetParseError: parse error model.parse,parse_many: convenience parsing helpers.TargetList/TargetListError: grouped targets and loaders.expand_cidr,expand_all: CIDR expansion helpers.TargetSource: trait for custom target providers.
Examples
1) Parse mixed user input
use parse_many;
let targets = parse_many;
assert_eq!;
2) Expand CIDR before dispatch
use ;
let cidr = parse.unwrap;
let expanded = expand_all;
for t in expanded
3) Implement TargetSource for a custom feed
use ;
Traits
scantarget defines TargetSource when you need to feed scanner targets from a queue, API, or custom database instead of CLI/file text.
Related Crates
License
MIT, Corum Collective LLC
Docs: https://docs.rs/scantarget
Santh ecosystem: https://santh.io