run test ssl in parallel against a list of urls
This commit is contained in:
7
multi_testssl/Cargo.lock
generated
Normal file
7
multi_testssl/Cargo.lock
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "multi_testssl"
|
||||||
|
version = "0.1.0"
|
||||||
8
multi_testssl/Cargo.toml
Normal file
8
multi_testssl/Cargo.toml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[package]
|
||||||
|
name = "multi_testssl"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
30
multi_testssl/src/main.rs
Normal file
30
multi_testssl/src/main.rs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
use std::fs;
|
||||||
|
use std::env;
|
||||||
|
use std::process::{Command, Stdio};
|
||||||
|
fn main() {
|
||||||
|
let args: Vec<String> = env::args().collect();
|
||||||
|
if args.len() != 2{
|
||||||
|
print!("
|
||||||
|
USAGE:
|
||||||
|
multidirb /path/to/urls.txt
|
||||||
|
")
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
let text = fs::read_to_string(&args[1]).expect("error reading urls file");
|
||||||
|
fs::create_dir("./testssl_output").expect("error creating folder");
|
||||||
|
let lines: Vec<&str> = text.split("\n").collect();
|
||||||
|
for line in lines{
|
||||||
|
let words: Vec<&str> = line.split(" ").collect();
|
||||||
|
for word in words{
|
||||||
|
if word.contains("http"){
|
||||||
|
let url = word;
|
||||||
|
let word_vec: Vec<&str> = word.split("/").collect();
|
||||||
|
let filename = format!("./testssl_output/{}",word_vec[2]);
|
||||||
|
let outfile = fs::File::create(filename).expect("error creating output file");
|
||||||
|
let command_output = Stdio::from(outfile);
|
||||||
|
Command::new("testssl").arg(url).stdout(command_output).spawn().expect("error running dirb command");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user