mirror of
https://github.com/edu4rdshl/rusolver.git
synced 2026-07-17 23:24:55 +00:00
Add support for using a wordlist as stdin for bruteforcing.
Signed-off-by: Edu4rdSHL <edu4rdshl@protonmail.com>
This commit is contained in:
parent
634a748961
commit
1a435019d8
1 changed files with 16 additions and 1 deletions
17
src/main.rs
17
src/main.rs
|
|
@ -28,6 +28,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
.long("threads")
|
.long("threads")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("Number of threads. Default: 100"),
|
.help("Number of threads. Default: 100"),
|
||||||
|
).arg(
|
||||||
|
Arg::with_name("domain")
|
||||||
|
.short("d")
|
||||||
|
.long("domain")
|
||||||
|
.takes_value(true)
|
||||||
|
.help("Target domain. When it's specified, a wordlist can be used from stdin for bruteforcing."),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("resolvers")
|
Arg::with_name("resolvers")
|
||||||
|
|
@ -101,7 +107,16 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let mut buffer = String::new();
|
let mut buffer = String::new();
|
||||||
let mut stdin = io::stdin();
|
let mut stdin = io::stdin();
|
||||||
stdin.read_to_string(&mut buffer).await?;
|
stdin.read_to_string(&mut buffer).await?;
|
||||||
let hosts: Vec<String> = buffer.lines().map(str::to_owned).collect();
|
|
||||||
|
let hosts: Vec<String> = if matches.is_present("domain") {
|
||||||
|
let domain = value_t!(matches, "domain", String).unwrap();
|
||||||
|
buffer
|
||||||
|
.lines()
|
||||||
|
.map(|word| format!("{}.{}", word, domain))
|
||||||
|
.collect()
|
||||||
|
} else {
|
||||||
|
buffer.lines().map(str::to_owned).collect()
|
||||||
|
};
|
||||||
|
|
||||||
futures::stream::iter(hosts.into_iter().map(|host| {
|
futures::stream::iter(hosts.into_iter().map(|host| {
|
||||||
let resolver_fut = resolvers
|
let resolver_fut = resolvers
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue