1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! Universal target parsing for security scanners.
//!
//! # Quick Start
//!
//! ```rust
//! use scantarget::Target;
//!
//! let target: Target = "https://example.com".parse().unwrap();
//! assert!(matches!(target, Target::Url(_)));
//!
//! let domain: Target = "example.com".parse().unwrap();
//! assert!(matches!(domain, Target::Domain(_)));
//! ```
/// CIDR expansion utilities.
/// Target list loading and management.
/// Target parsing and representation.
pub use crate;
pub use crate;
pub use crate;
/// Trait for any source of scan targets.
///
/// Implement this for custom target sources (APIs, databases, queues).
/// Parse a single target string.
///
/// Convenience wrapper around `Target::from_str`.
///
/// Example:
/// ```rust
/// use scantarget::{parse, Target};
///
/// assert_eq!(parse("https://example.com"), "https://example.com".parse::<Target>().ok());
/// assert!(parse("http://").is_none());
/// ```
/// Parse multiple targets from a newline-separated string.
///
/// Blank lines and lines starting with `#` are skipped.
///
/// Example:
/// ```rust
/// use scantarget::{parse_many, Target};
///
/// let targets = parse_many("https://example.com\n# comment\n203.0.113.10");
/// assert_eq!(
/// targets,
/// vec!["https://example.com".parse::<Target>().unwrap(), "203.0.113.10".parse::<Target>().unwrap()]
/// );
/// ```