mirror of
https://github.com/edu4rdshl/fhc.git
synced 2026-07-17 23:24:50 +00:00
parent
b0876d0f16
commit
2888858d4e
4 changed files with 694 additions and 571 deletions
1209
Cargo.lock
generated
1209
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
19
Cargo.toml
19
Cargo.toml
|
|
@ -12,19 +12,14 @@ readme = "README.md"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tokio = { version = "1.20.1", features = ["full", "io-util"] }
|
tokio = { version = "1.36.0", features = ["full", "io-util"] }
|
||||||
futures = "0.3.23"
|
futures = "0.3.30"
|
||||||
clap = "2.33.4"
|
clap = "2.34.0"
|
||||||
reqwest = { version = "0.11.11", features = ["trust-dns", "rustls-tls", "native-tls"] }
|
reqwest = { version = "0.11.24", features = ["trust-dns", "rustls-tls", "native-tls"] }
|
||||||
openssl = { version = "0.10.41", features = ["vendored"] }
|
openssl = { version = "0.10.64", features = ["vendored"] }
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
scraper = "0.13.0"
|
scraper = "0.19.0"
|
||||||
async-recursion = "1.0.0"
|
async-recursion = "1.0.5"
|
||||||
|
|
||||||
# https://github.com/bluejekyll/trust-dns/pull/1632
|
|
||||||
[patch.crates-io]
|
|
||||||
trust-dns-resolver = { git = "https://github.com/Findomain/trust-dns", package = "trust-dns-resolver", branch = "custombranch" }
|
|
||||||
|
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = 'thin'
|
lto = 'thin'
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ use {
|
||||||
futures::stream::StreamExt,
|
futures::stream::StreamExt,
|
||||||
rand::{distributions::Alphanumeric, thread_rng as rng, Rng},
|
rand::{distributions::Alphanumeric, thread_rng as rng, Rng},
|
||||||
reqwest::{
|
reqwest::{
|
||||||
self,
|
|
||||||
header::{CONTENT_LENGTH, CONTENT_TYPE, USER_AGENT},
|
header::{CONTENT_LENGTH, CONTENT_TYPE, USER_AGENT},
|
||||||
redirect::Policy,
|
redirect::Policy,
|
||||||
Client, Response, Url,
|
Client, Response, Url,
|
||||||
|
|
|
||||||
32
src/main.rs
32
src/main.rs
|
|
@ -2,10 +2,7 @@ use {
|
||||||
clap::{value_t, App, Arg},
|
clap::{value_t, App, Arg},
|
||||||
fhc::{httplib, structs::LibOptions, utils},
|
fhc::{httplib, structs::LibOptions, utils},
|
||||||
std::collections::HashSet,
|
std::collections::HashSet,
|
||||||
tokio::{
|
tokio::io::{self, AsyncReadExt},
|
||||||
self,
|
|
||||||
io::{self, AsyncReadExt},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
|
@ -55,6 +52,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("Max number of redirects. Default: 0"),
|
.help("Max number of redirects. Default: 0"),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("bruteforce")
|
||||||
|
.short("b")
|
||||||
|
.long("bruteforce")
|
||||||
|
.takes_value(false)
|
||||||
|
.help("Bruteforce subdomains."),
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("1xx")
|
Arg::with_name("1xx")
|
||||||
.short("1")
|
.short("1")
|
||||||
|
|
@ -115,20 +119,24 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|
||||||
let client = httplib::return_http_client(timeout, max_redirects);
|
let client = httplib::return_http_client(timeout, max_redirects);
|
||||||
|
|
||||||
// Read stdin
|
|
||||||
|
|
||||||
let mut stdin = io::stdin();
|
|
||||||
let mut buffer = String::new();
|
let mut buffer = String::new();
|
||||||
stdin.read_to_string(&mut buffer).await?;
|
|
||||||
|
|
||||||
let hosts: HashSet<String> = if matches.is_present("domain") {
|
let mut hosts = HashSet::new();
|
||||||
|
|
||||||
|
if matches.is_present("domain") {
|
||||||
let domain = value_t!(matches, "domain", String).unwrap();
|
let domain = value_t!(matches, "domain", String).unwrap();
|
||||||
buffer
|
if matches.is_present("bruteforce") {
|
||||||
|
io::stdin().read_to_string(&mut buffer).await?;
|
||||||
|
hosts = buffer
|
||||||
.lines()
|
.lines()
|
||||||
.map(|word| format!("{word}.{domain}"))
|
.map(|word| format!("{word}.{domain}"))
|
||||||
.collect()
|
.collect();
|
||||||
} else {
|
} else {
|
||||||
buffer.lines().map(str::to_owned).collect()
|
hosts.insert(domain);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
io::stdin().read_to_string(&mut buffer).await?;
|
||||||
|
hosts = buffer.lines().map(str::to_owned).collect();
|
||||||
};
|
};
|
||||||
|
|
||||||
let lib_options = LibOptions {
|
let lib_options = LibOptions {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue