Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fa1800337 | ||
|
|
e211433772 |
@@ -11,6 +11,7 @@ use chrono::Local;
|
|||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use crate::print_error;
|
use crate::print_error;
|
||||||
use crate::print_informational;
|
use crate::print_informational;
|
||||||
|
use crate::print_success;
|
||||||
use crate::Project;
|
use crate::Project;
|
||||||
use crate::project_controls;
|
use crate::project_controls;
|
||||||
use crate::box_controls;
|
use crate::box_controls;
|
||||||
@@ -265,6 +266,7 @@ fn print_banner(banner: &str){
|
|||||||
print!("{}", banner.custom_color((255,165,0)));
|
print!("{}", banner.custom_color((255,165,0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
pub fn cli(interactive: bool,
|
pub fn cli(interactive: bool,
|
||||||
mut projects: Vec<Project>,
|
mut projects: Vec<Project>,
|
||||||
config_path: PathBuf,
|
config_path: PathBuf,
|
||||||
@@ -376,19 +378,26 @@ for help enter help or ?. for information about a specific command enter help (c
|
|||||||
let mut workspace_config_path = config_path.clone();
|
let mut workspace_config_path = config_path.clone();
|
||||||
workspace_config_path.pop();
|
workspace_config_path.pop();
|
||||||
let mut project_conf_path = config_path.clone();
|
let mut project_conf_path = config_path.clone();
|
||||||
|
let mut success_message = String::new();
|
||||||
project_conf_path.pop();
|
project_conf_path.pop();
|
||||||
project_conf_path.push("projects.conf");
|
project_conf_path.push("projects.work");
|
||||||
|
let worksapces_in_use = project_conf_path.exists();
|
||||||
|
if worksapces_in_use{
|
||||||
if get_user_input("are your work projects currently loaded? (not yoru personal projects...)").to_lowercase().contains("y"){
|
if get_user_input("are your work projects currently loaded? (not yoru personal projects...)").to_lowercase().contains("y"){
|
||||||
workspace_config_path.push("projects.work");
|
workspace_config_path.push("projects.work");
|
||||||
|
success_message = String::from("projects.conf saved to projects.work");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
workspace_config_path.push("projects.personal");
|
workspace_config_path.push("projects.personal");
|
||||||
|
success_message = String::from("projects.conf saved to projects.personal");
|
||||||
}
|
}
|
||||||
let open_res = OpenOptions::new().create(true).write(true).open(workspace_config_path);
|
let open_res = OpenOptions::new().create(true).write(true).open(workspace_config_path);
|
||||||
if open_res.is_err(){
|
if open_res.is_err(){
|
||||||
print_error("error opeing workspace config file!", open_res.err().unwrap().to_string());
|
print_error("error opeing workspace config file!", open_res.err().unwrap().to_string());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
project_conf_path.pop();
|
||||||
|
project_conf_path.push("projects.conf");
|
||||||
let mut workspace_config_file = open_res.unwrap();
|
let mut workspace_config_file = open_res.unwrap();
|
||||||
let projects_read_res = read_to_string(project_conf_path);
|
let projects_read_res = read_to_string(project_conf_path);
|
||||||
if projects_read_res.is_ok(){
|
if projects_read_res.is_ok(){
|
||||||
@@ -402,6 +411,8 @@ for help enter help or ?. for information about a specific command enter help (c
|
|||||||
print_error("error reading projects config file!", projects_read_res.err().unwrap().to_string());
|
print_error("error reading projects config file!", projects_read_res.err().unwrap().to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
print_success(success_message);
|
||||||
|
}
|
||||||
if threads.len() > 0{
|
if threads.len() > 0{
|
||||||
println!("closing threads...");
|
println!("closing threads...");
|
||||||
println!("note this will hang until all threads have completed");
|
println!("note this will hang until all threads have completed");
|
||||||
@@ -410,4 +421,10 @@ for help enter help or ?. for information about a specific command enter help (c
|
|||||||
let _ = thread.join();
|
let _ = thread.join();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if worksapces_in_use{
|
||||||
|
print_success("projects saved to projects.conf, workspace project updated, threads finished. pentest_tool OUT!");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
print_success("projects saved to projects.conf, threads finished. pentest_tool OUT!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -193,10 +193,38 @@ pub fn bruteforce_subs(project: &Project, given_domains: Option<&Vec<String>>, g
|
|||||||
print_informational("sleeping for 10 seconds to allow for sudo password input.");
|
print_informational("sleeping for 10 seconds to allow for sudo password input.");
|
||||||
sleep(Duration::from_secs(10));
|
sleep(Duration::from_secs(10));
|
||||||
let gobuser_output = gobuster_cmd_res.unwrap().stdout;
|
let gobuser_output = gobuster_cmd_res.unwrap().stdout;
|
||||||
print_success("Gobuster enumeration Done!");
|
|
||||||
let gobuster_string = String::from_utf8_lossy(&gobuser_output);
|
let gobuster_string = String::from_utf8_lossy(&gobuser_output);
|
||||||
|
let mut final_string = String::new();
|
||||||
|
if gobuster_string.contains("specify the '--wildcard' switch"){
|
||||||
|
let gobuster_cmd_res = Command::new("distrobox")
|
||||||
|
.arg("enter")
|
||||||
|
.arg("--root")
|
||||||
|
.arg(working_project.boxname.to_owned())
|
||||||
|
.arg("--")
|
||||||
|
.arg("gobuster")
|
||||||
|
.arg("dns")
|
||||||
|
.arg("-d")
|
||||||
|
.arg(&domain)
|
||||||
|
.arg("-w")
|
||||||
|
.arg(wordlist.to_owned())
|
||||||
|
.arg("--wildcard")
|
||||||
|
.output();
|
||||||
|
if gobuster_cmd_res.is_err(){
|
||||||
|
let error = gobuster_cmd_res.err().unwrap();
|
||||||
|
println!("{}","From gobuster thread: Error running gobuster command!".red());
|
||||||
|
println!("{}", error.to_string().red());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let new_gobuser_output = gobuster_cmd_res.unwrap().stdout;
|
||||||
|
let new_gobuser_string = String::from_utf8_lossy(&new_gobuser_output);
|
||||||
|
final_string = new_gobuser_string.to_string();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
final_string = gobuster_string.to_string();
|
||||||
|
}
|
||||||
|
print_success("Gobuster enumeration Done!");
|
||||||
let mut domain_names = Vec::new();
|
let mut domain_names = Vec::new();
|
||||||
let lines: Vec<&str> = gobuster_string.split("\n").collect();
|
let lines: Vec<&str> = final_string.split("\n").collect();
|
||||||
for line in lines{
|
for line in lines{
|
||||||
if line.contains("Found:"){
|
if line.contains("Found:"){
|
||||||
let domain = line.split_whitespace().collect::<Vec<&str>>()[1];
|
let domain = line.split_whitespace().collect::<Vec<&str>>()[1];
|
||||||
|
|||||||
Reference in New Issue
Block a user