Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb43a79ae1 | |||
| 7f8432bda6 |
@@ -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"
|
||||
|
||||
+16
-9
@@ -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),
|
||||
@@ -51,7 +50,7 @@ struct Args {
|
||||
|
||||
async fn try_sub(
|
||||
domain: String,
|
||||
wildcard_reses: HashMap<&String, Vec<String>>,
|
||||
wildcard_reses: &Arc<HashMap<&String, Vec<String>>>,
|
||||
tx: Sender<OutputMessage>,
|
||||
output: bool,
|
||||
resolver: Arc<TokioAsyncResolver>,
|
||||
@@ -102,20 +101,20 @@ async fn try_sub(
|
||||
}
|
||||
|
||||
async fn try_dir(url: String, tx: Sender<OutputMessage>, output: bool, pb: Arc<ProgressBar>) {
|
||||
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<OutputMessage>, output: bool, pb: Arc<P
|
||||
eprintln!("error sending output! {}", e);
|
||||
}
|
||||
}
|
||||
pb.println(&format!("{} {}", resp, url));
|
||||
pb.println(&format!(
|
||||
"{} {} - and what a beautiful teapot you are!",
|
||||
resp, url
|
||||
));
|
||||
}
|
||||
StatusCode::MOVED_PERMANENTLY => {
|
||||
if output {
|
||||
@@ -354,7 +356,11 @@ async fn main() {
|
||||
for dir in dirwordlist.split("\n").collect::<Vec<&str>>() {
|
||||
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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -455,10 +461,11 @@ async fn main() {
|
||||
try_dir(url, tx, output, pb).await;
|
||||
}
|
||||
}));
|
||||
let wc_arc = Arc::new(wild_card_results);
|
||||
let sub_stream = stream::iter(subs_to_try.into_iter().map(|sub| {
|
||||
let tx = tx.clone();
|
||||
let output = output.clone();
|
||||
let wc = wild_card_results.clone();
|
||||
let wc = &wc_arc;
|
||||
let resolver = resolver.clone();
|
||||
let pb = pb.clone();
|
||||
async move {
|
||||
@@ -466,7 +473,7 @@ async fn main() {
|
||||
}
|
||||
}));
|
||||
|
||||
let concurrency = 100;
|
||||
let concurrency = 1000;
|
||||
dir_stream
|
||||
.buffer_unordered(concurrency)
|
||||
.collect::<Vec<_>>()
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"rustc_fingerprint":16956027585667248358,"outputs":{"11857020428658561806":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/pyro/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/pyro/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.94.1 (e408947bf 2026-03-25)\nbinary: rustc\ncommit-hash: e408947bfd200af42db322daf0fadfe7e26d3bd1\ncommit-date: 2026-03-25\nhost: x86_64-unknown-linux-gnu\nrelease: 1.94.1\nLLVM version: 21.1.8\n","stderr":""}},"successes":{}}
|
||||
{"rustc_fingerprint":7410761613933813367,"outputs":{"7971740275564407648":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/pyro/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"17445564800283842379":{"success":true,"status":"","code":0,"stdout":"rustc 1.96.0 (ac68faa20 2026-05-25)\nbinary: rustc\ncommit-hash: ac68faa20c58cbccd01ee7208bf3b6e93a7d7f96\ncommit-date: 2026-05-25\nhost: x86_64-unknown-linux-gnu\nrelease: 1.96.0\nLLVM version: 22.1.2\n","stderr":""}},"successes":{}}
|
||||
Reference in New Issue
Block a user