diff --git a/Cargo.toml b/Cargo.toml index df10a51..79376fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,4 +13,3 @@ indicatif = "0.18.4" reqwest = { version = "0.12.4", features = ["blocking"] } tokio = { version = "1.52.3", features = ["full"] } trust-dns-resolver = "0.23.2" -urlencoding = "2.1.3" diff --git a/src/main.rs b/src/main.rs index 685bea1..5b918cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,6 @@ use std::sync::Arc; use std::{collections::HashMap, fs}; use tokio::sync::mpsc::{channel, Sender}; use trust_dns_resolver::{config::*, TokioAsyncResolver}; -use urlencoding::encode; enum OutputMessage { UrlResult(String), @@ -102,20 +101,20 @@ async fn try_sub( } async fn try_dir(url: String, tx: Sender, output: bool, pb: Arc) { - let resp_stat = reqwest::get(&encode(&url).to_string()).await; + let resp_stat = reqwest::get(&url).await; if resp_stat.is_ok() { let resp = resp_stat.unwrap().status(); match resp { StatusCode::OK => { if output { if let Err(e) = tx - .send(OutputMessage::UrlResult(format!("{} {}", resp, url))) + .send(OutputMessage::UrlResult(format!("{} {}", resp, &url))) .await { eprintln!("error sending output! {}", e); } } - pb.println(&format!("{} {}", resp, url)); + pb.println(&format!("{} {}", resp, &url)); } StatusCode::ACCEPTED => { if output { @@ -170,7 +169,10 @@ async fn try_dir(url: String, tx: Sender, output: bool, pb: Arc

{ if output { @@ -354,7 +356,11 @@ async fn main() { for dir in dirwordlist.split("\n").collect::>() { for target in &targets { if target.contains("http") { - dirs_to_try.push(format!("{}/{}", target, dir.trim())); + if dir.starts_with("/") || target.ends_with("/") { + dirs_to_try.push(format!("{}{}", target, dir.trim())); + } else { + dirs_to_try.push(format!("{}/{}", target, dir.trim())); + } } } }