re-did how settings are handled and updated how to load the settings, modify them, and save them so that when you separate work and play it all works right this time!
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
use std::collections::HashMap;
|
||||||
|
use std::fs;
|
||||||
use std::fs::read_to_string;
|
use std::fs::read_to_string;
|
||||||
use std::fs::OpenOptions;
|
use std::fs::OpenOptions;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
@@ -9,6 +11,7 @@ use clearscreen::clear;
|
|||||||
use clearscreen;
|
use clearscreen;
|
||||||
use chrono::Local;
|
use chrono::Local;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
|
use crate::configuration::load_config;
|
||||||
use crate::print_error;
|
use crate::print_error;
|
||||||
use crate::print_informational;
|
use crate::print_informational;
|
||||||
use crate::print_success;
|
use crate::print_success;
|
||||||
@@ -153,21 +156,22 @@ pub fn next_project_id(config_path: &PathBuf) -> Option<i32>{
|
|||||||
}
|
}
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn run_command(cmd: String,
|
pub fn run_command(cmd: String,
|
||||||
mut projects: &mut Vec<Project>,
|
settings: &HashMap<&str, String>,
|
||||||
config_path: PathBuf,
|
config_path: &PathBuf,
|
||||||
base_files: &PathBuf,
|
mut projects: &mut Vec<Project>) -> Option<JoinHandle<()>> {
|
||||||
base_notes: &PathBuf,
|
let base_files = PathBuf::from(settings["project_files"].clone());
|
||||||
tools_dir: &PathBuf,
|
let base_notes = PathBuf::from(settings["project_notes"].clone());
|
||||||
boxtemplate: String,
|
let tools_dir = PathBuf::from(settings["tools_folder"].clone());
|
||||||
terminal: String,
|
let boxtemplate= settings["box_template"].clone();
|
||||||
cracking_rig: String,
|
let terminal = settings["terminal_command"].clone();
|
||||||
rockyou: String,
|
let cracking_rig = settings["cracking_rig"].clone();
|
||||||
rule: String,
|
let rockyou = settings["rockyou"].clone();
|
||||||
upcoming_files: &PathBuf,
|
let rule = settings["rule"].clone();
|
||||||
upcoming_notes: &PathBuf,
|
let upcoming_files = PathBuf::from(settings["upcoming_files"].clone());
|
||||||
password_spray_file: &PathBuf,
|
let upcoming_notes = PathBuf::from(settings["upcoming_notes"].clone());
|
||||||
fingerprint: bool,
|
let password_spray_file = PathBuf::from(settings["pass_spray_file"].clone());
|
||||||
vault_name: String) -> Option<JoinHandle<()>> {
|
let fingerprint = settings["fingerprint"].to_lowercase().contains("y");
|
||||||
|
let vault_name = settings["vault_name"].clone();
|
||||||
let new_id_res = next_project_id(&config_path);
|
let new_id_res = next_project_id(&config_path);
|
||||||
if new_id_res.is_none(){
|
if new_id_res.is_none(){
|
||||||
println!("{}", "failed to get new project ID!".red());
|
println!("{}", "failed to get new project ID!".red());
|
||||||
@@ -222,12 +226,12 @@ pub fn run_command(cmd: String,
|
|||||||
"list projects" | "lp" | "listp" | "list p" => {project_controls::list_projects(&projects); return None},
|
"list projects" | "lp" | "listp" | "list p" => {project_controls::list_projects(&projects); return None},
|
||||||
"switch project" | "swp" | "switch p" | "switchp" => {project_controls::switch_project(&mut projects); return None},
|
"switch project" | "swp" | "switch p" | "switchp" => {project_controls::switch_project(&mut projects); return None},
|
||||||
"show active project" | "show active" | "sa" | "show a" => {println!("\nclient: {}\n\nproject: {}\n\nbox: {}\n\nproject files: {}\n\nproject notes: {}\n", active_project.customer ,active_project.project_name, active_project.boxname, active_project.files_folder.display(), active_project.notes_folder.display()); return None},
|
"show active project" | "show active" | "sa" | "show a" => {println!("\nclient: {}\n\nproject: {}\n\nbox: {}\n\nproject files: {}\n\nproject notes: {}\n", active_project.customer ,active_project.project_name, active_project.boxname, active_project.files_folder.display(), active_project.notes_folder.display()); return None},
|
||||||
"create new project" | "cnp" | "new project" | "np" => {new_id = new_id + 1; start_pentest::start_pentest(&config_path, &mut projects, new_id, upcoming_files, upcoming_notes, &boxtemplate, password_spray_file); return None},
|
"create new project" | "cnp" | "new project" | "np" => {new_id = new_id + 1; start_pentest::start_pentest(&config_path, &mut projects, new_id, &upcoming_files, &upcoming_notes, &boxtemplate, &password_spray_file); return None},
|
||||||
"save projects" | "sp" | "save" | "s" => {project_controls::save_projects(&projects, &config_path); return None},
|
"save projects" | "sp" | "save" | "s" => {project_controls::save_projects(&projects, &config_path); return None},
|
||||||
"import project" | "ip" | "import" => {new_id = new_id + 1; project_controls::new_project(&mut projects, &base_files, &base_notes, &tools_dir, &boxtemplate, &config_path, new_id, &upcoming_files, &upcoming_notes, fingerprint); return None},
|
"import project" | "ip" | "import" => {new_id = new_id + 1; project_controls::new_project(&mut projects, &base_files, &base_notes, &tools_dir, &boxtemplate, &config_path, new_id, &upcoming_files, &upcoming_notes, fingerprint); return None},
|
||||||
"remove project" | "rp" | "remove" | "rmp" => {project_controls::remove_project(&mut projects, &config_path); return None},
|
"remove project" | "rp" | "remove" | "rmp" => {project_controls::remove_project(&mut projects, &config_path); return None},
|
||||||
"show upcoming projects" | "sup" | "show upcoming" => {project_controls::print_upcoming_projects(&projects); return None},
|
"show upcoming projects" | "sup" | "show upcoming" => {project_controls::print_upcoming_projects(&projects); return None},
|
||||||
"promote project" | "pp" | "promote" => {project_controls::promote_project(&mut projects, &config_path, base_files, base_notes, tools_dir, &boxtemplate, fingerprint); return None},
|
"promote project" | "pp" | "promote" => {project_controls::promote_project(&mut projects, &config_path, &base_files, &base_notes, &tools_dir, &boxtemplate, fingerprint); return None},
|
||||||
"new terminal" | "enter" | "enter terminal" | "nt" | "et" => {box_controls::project_standalone_terminal(active_project.clone(), terminal.clone()); return None},
|
"new terminal" | "enter" | "enter terminal" | "nt" | "et" => {box_controls::project_standalone_terminal(active_project.clone(), terminal.clone()); return None},
|
||||||
"inline terminal" | "it" | "enter inline" | "ei" => {box_controls::project_inline_terminal(active_project.clone()); return None},
|
"inline terminal" | "it" | "enter inline" | "ei" => {box_controls::project_inline_terminal(active_project.clone()); return None},
|
||||||
"cobalt strike" | "cs" => {let cs_thread = box_controls::launch_cobalt_strike(active_project.clone()); return cs_thread},
|
"cobalt strike" | "cs" => {let cs_thread = box_controls::launch_cobalt_strike(active_project.clone()); return cs_thread},
|
||||||
@@ -245,7 +249,7 @@ pub fn run_command(cmd: String,
|
|||||||
"prune distroboxes" | "pdb" | "prune" => {let prune_thread = box_controls::clean_unused_boxes(&projects, &boxtemplate); return prune_thread},
|
"prune distroboxes" | "pdb" | "prune" => {let prune_thread = box_controls::clean_unused_boxes(&projects, &boxtemplate); return prune_thread},
|
||||||
"parse normal nmap file" | "pnnf" | "parse nmap" | "pn" => {portscan_controls::parse_normal_nmap_output(&active_project); return None;},
|
"parse normal nmap file" | "pnnf" | "parse nmap" | "pn" => {portscan_controls::parse_normal_nmap_output(&active_project); return None;},
|
||||||
"show scope" | "ss" | "show s" | "s s" | "scope" => {let scope_res = info_controls::get_scope_entries(&active_project); if scope_res.is_some(){for host in scope_res.unwrap(){println!("{}", host)}}return None},
|
"show scope" | "ss" | "show s" | "s s" | "scope" => {let scope_res = info_controls::get_scope_entries(&active_project); if scope_res.is_some(){for host in scope_res.unwrap(){println!("{}", host)}}return None},
|
||||||
"update git tools" | "ugt" | "update git" | "ug" => {tool_controls::update_git_tools(tools_dir); return None},
|
"update git tools" | "ugt" | "update git" | "ug" => {tool_controls::update_git_tools(&tools_dir); return None},
|
||||||
"port scan" | "ps" | "nmap" | "nmap scan" | "ns" | "nm" => {portscan_controls::run_nmap_portscan(&active_project); return None;},
|
"port scan" | "ps" | "nmap" | "nmap scan" | "ns" | "nm" => {portscan_controls::run_nmap_portscan(&active_project); return None;},
|
||||||
"port scan command" | "psc" | "nmap command" | "nmc" => {portscan_controls::build_nmap_command(&active_project); return None;}
|
"port scan command" | "psc" | "nmap command" | "nmc" => {portscan_controls::build_nmap_command(&active_project); return None;}
|
||||||
"sharpersist command" | "spc" | "sharp scheduled task" | "sst" => {victim_commands::sharp_persist_command(&tools_dir); return None;},
|
"sharpersist command" | "spc" | "sharp scheduled task" | "sst" => {victim_commands::sharp_persist_command(&tools_dir); return None;},
|
||||||
@@ -257,7 +261,8 @@ pub fn run_command(cmd: String,
|
|||||||
"modify tool config" | "mtc" => {configuration::generate_tool_config(&config_path); return None;},
|
"modify tool config" | "mtc" => {configuration::generate_tool_config(&config_path); return None;},
|
||||||
"separate work and personal projects" | "swpp" | "separate projects" | "seppro" => {project_controls::separate_personal_work_projects(&config_path); return None;}
|
"separate work and personal projects" | "swpp" | "separate projects" | "seppro" => {project_controls::separate_personal_work_projects(&config_path); return None;}
|
||||||
"switch to personal projects" | "switch personal" => {let mut project_load_res = project_controls::swith_to_personal(&config_path); if project_load_res.is_some(){projects.clear();for project in project_load_res.unwrap(){projects.push(project);}}; return None;},
|
"switch to personal projects" | "switch personal" => {let mut project_load_res = project_controls::swith_to_personal(&config_path); if project_load_res.is_some(){projects.clear();for project in project_load_res.unwrap(){projects.push(project);}}; return None;},
|
||||||
"switch to work projects" | "switch work" => {let mut project_load_res = project_controls::swith_to_work(&config_path); if project_load_res.is_some(){projects.clear();for project in project_load_res.unwrap(){projects.push(project);}}; return None;}
|
"switch to work projects" | "switch work" => {let mut project_load_res = project_controls::swith_to_work(&config_path); if project_load_res.is_some(){projects.clear();for project in project_load_res.unwrap(){projects.push(project);}}; return None;},
|
||||||
|
"show settings" | "print settings" | "shset" | "pset" => {configuration::print_settings(&settings); return None},
|
||||||
_ => {help(None); println!("\n\n unknown command."); return None;}
|
_ => {help(None); println!("\n\n unknown command."); return None;}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -267,26 +272,23 @@ fn print_banner(banner: &str){
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn cli(interactive: bool,
|
pub fn cli(mut projects: &mut Vec<Project>, config_path: &PathBuf) {
|
||||||
mut projects: Vec<Project>,
|
|
||||||
config_path: PathBuf,
|
|
||||||
base_files: &PathBuf,
|
|
||||||
base_notes: &PathBuf,
|
|
||||||
tools_dir: &PathBuf,
|
|
||||||
boxtemplate: String,
|
|
||||||
terminal: String,
|
|
||||||
cracking_rig: String,
|
|
||||||
rockyou: String,
|
|
||||||
rule: String,
|
|
||||||
upcoming_files: &PathBuf,
|
|
||||||
upcoming_notes: &PathBuf,
|
|
||||||
password_spray_file: &PathBuf,
|
|
||||||
fingerprint: bool,
|
|
||||||
vault_name: String,) {
|
|
||||||
let mut threads = Vec::new();
|
let mut threads = Vec::new();
|
||||||
if interactive{
|
let mut loopize = true;
|
||||||
let mut loopize = true;
|
let mut work_loaded = true;
|
||||||
let banner = "
|
let mut workspace_config_path = config_path.clone();
|
||||||
|
let mut workspace_settings_path = config_path.clone();
|
||||||
|
workspace_config_path.pop();
|
||||||
|
workspace_settings_path.pop();
|
||||||
|
let mut project_conf_path = config_path.clone();
|
||||||
|
let mut success_message = String::new();
|
||||||
|
project_conf_path.pop();
|
||||||
|
project_conf_path.push("projects.work");
|
||||||
|
let worksapces_in_use = project_conf_path.exists();
|
||||||
|
if worksapces_in_use{
|
||||||
|
work_loaded = get_user_input("is thie loading your work projects?").to_lowercase().contains("y");
|
||||||
|
}
|
||||||
|
let banner = "
|
||||||
,,,;;::ccccc::;;;::c::;,;::cccccllc::::::;:::;;;;,,;,'',,;,,;;;;;;;:;;;;;,,,,,,,,,,,'''''',,,,,,''''
|
,,,;;::ccccc::;;;::c::;,;::cccccllc::::::;:::;;;;,,;,'',,;,,;;;;;;;:;;;;;,,,,,,,,,,,'''''',,,,,,''''
|
||||||
,;;;::ccccc::::::ccc:;;;:ccccccclc::ccccccc::;;;;;;;;;;,,;;;;;;;;;;;;;;;,,,,,,,,,,,'''''''''',,,,,''
|
,;;;::ccccc::::::ccc:;;;:ccccccclc::ccccccc::;;;;;;;;;;,,;;;;;;;;;;;;;;;,,,,,,,,,,,'''''''''',,,,,''
|
||||||
,;;:::ccc:cc:::ccc:::::::ccccclcccllccccllc::::::;;;;;;;;;;;;;;;;;;;;;;,,,,,,,,,,,''''''''...'',,,,'
|
,;;:::ccc:cc:::ccc:::::::ccccclcccllccccllc::::::;;;;;;;;;;;;;;;;;;;;;;,,,,,,,,,,,''''''''...'',,,,'
|
||||||
@@ -334,16 +336,17 @@ pub fn cli(interactive: bool,
|
|||||||
|
|
||||||
|
|
||||||
";
|
";
|
||||||
print_banner(banner);
|
print_banner(banner);
|
||||||
while loopize{
|
while loopize{
|
||||||
project_controls::save_projects(&projects, &config_path);
|
let settings = configuration::load_config(config_path);
|
||||||
let active_project_res = get_active_project(&projects);
|
project_controls::save_projects(&projects, &config_path);
|
||||||
if active_project_res.is_none(){
|
let active_project_res = get_active_project(&projects);
|
||||||
println!("{}", "failed to get active project!".red());
|
if active_project_res.is_none(){
|
||||||
return;
|
println!("{}", "failed to get active project!".red());
|
||||||
}
|
return;
|
||||||
let active_project = active_project_res.unwrap();
|
}
|
||||||
let current_information = format!("
|
let active_project = active_project_res.unwrap();
|
||||||
|
let current_information = format!("
|
||||||
Active Project: {}, {}
|
Active Project: {}, {}
|
||||||
Project Status: {}
|
Project Status: {}
|
||||||
Files Folder: {}
|
Files Folder: {}
|
||||||
@@ -355,41 +358,45 @@ for help enter help or ?. for information about a specific command enter help (c
|
|||||||
|
|
||||||
|
|
||||||
", active_project.customer.green(), active_project.project_name.green(), active_project.stage.green(), active_project.files_folder.display().to_string().green(), active_project.notes_folder.display().to_string().green(), active_project.boxname.green(), "coming soon".red());
|
", active_project.customer.green(), active_project.project_name.green(), active_project.stage.green(), active_project.files_folder.display().to_string().green(), active_project.notes_folder.display().to_string().green(), active_project.boxname.green(), "coming soon".red());
|
||||||
println!("{}", config_path.display());
|
load_config(config_path);
|
||||||
let prompt = format!("\n{}:{}\nCommand?", active_project.customer.custom_color((255,165,0)), active_project.project_name.custom_color((255,165,0)));
|
|
||||||
let command = get_user_input(&prompt);
|
let prompt = format!("\n{}:{}\nCommand?", active_project.customer.custom_color((255,165,0)), active_project.project_name.custom_color((255,165,0)));
|
||||||
match command.as_str(){
|
let command = get_user_input(&prompt);
|
||||||
"exit" => loopize = false,
|
if command.contains("switch work") || command.contains("switch to work projects"){
|
||||||
"menu" | "main menu" | "mm" => {let menu_thread_option = menu::main_menu(&mut projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.clone(), cracking_rig.clone(), rockyou.clone(), rule.clone(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.clone()); if menu_thread_option.is_some(){for thread in menu_thread_option.unwrap(){threads.push(thread);}}},
|
work_loaded = true;
|
||||||
"print banner" | "banner" => print_banner(banner),
|
|
||||||
"clear" | "clear screen" | "cls" => {clear().unwrap(); print_banner(banner);},
|
|
||||||
"list threads" | "threads" | "lst" => println!("There are {} threads still running.", threads.len()),
|
|
||||||
"info" => println!("{}", current_information),
|
|
||||||
"test_table" => {let mut lines = Vec::new(); lines.push("column1||column2||column3||column4".to_owned()); lines.push("thing1||thing2||thing3||thing4".to_owned()); lines.push("ttttttttttttttttthing5||thing6||thing7||thing8".to_owned()); tableize(lines);}
|
|
||||||
_ => {let thread_option = run_command(command, &mut projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.clone(), cracking_rig.clone(), rockyou.clone(), rule.clone(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.clone()); if thread_option.is_some(){threads.push(thread_option.unwrap())}},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
project_controls::save_projects(&projects, &config_path);
|
else if command.contains("switch personal") || command.contains("switch to personal projects"){
|
||||||
if get_user_input("do you want to stop all the boxes?").contains("y"){
|
work_loaded = false;
|
||||||
box_controls::stop_all_boxes(&projects);
|
}
|
||||||
|
match command.as_str(){
|
||||||
|
"exit" => loopize = false,
|
||||||
|
"menu" | "main menu" | "mm" => {let menu_thread_option = menu::main_menu(&mut projects, config_path.clone(), &settings);},
|
||||||
|
"print banner" | "banner" => print_banner(banner),
|
||||||
|
"clear" | "clear screen" | "cls" => {clear().unwrap(); print_banner(banner);},
|
||||||
|
"list threads" | "threads" | "lst" => println!("There are {} threads still running.", threads.len()),
|
||||||
|
"info" => println!("{}", current_information),
|
||||||
|
"test_table" => {let mut lines = Vec::new(); lines.push("column1||column2||column3||column4".to_owned()); lines.push("thing1||thing2||thing3||thing4".to_owned()); lines.push("ttttttttttttttttthing5||thing6||thing7||thing8".to_owned()); tableize(lines);}
|
||||||
|
_ => {let thread_option = run_command(command, &settings, config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
project_controls::save_projects(&projects, &config_path);
|
||||||
|
if get_user_input("do you want to stop all the boxes?").contains("y"){
|
||||||
|
box_controls::stop_all_boxes(&projects);
|
||||||
|
}
|
||||||
print_informational("saving workspace projects...");
|
print_informational("saving workspace projects...");
|
||||||
let mut workspace_config_path = config_path.clone();
|
|
||||||
workspace_config_path.pop();
|
|
||||||
let mut project_conf_path = config_path.clone();
|
|
||||||
let mut success_message = String::new();
|
|
||||||
project_conf_path.pop();
|
|
||||||
project_conf_path.push("projects.work");
|
|
||||||
let worksapces_in_use = project_conf_path.exists();
|
let worksapces_in_use = project_conf_path.exists();
|
||||||
if worksapces_in_use{
|
if worksapces_in_use{
|
||||||
if get_user_input("are your work projects currently loaded? (not yoru personal projects...)").to_lowercase().contains("y"){
|
if work_loaded{
|
||||||
|
print_informational("saving projects.work");
|
||||||
workspace_config_path.push("projects.work");
|
workspace_config_path.push("projects.work");
|
||||||
success_message = String::from("projects.conf saved to projects.work");
|
workspace_settings_path.push("conf.working");
|
||||||
|
success_message = String::from("projects.conf saved to projects.work\nconf saved to conf.working");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
print_informational("saving projects.personal");
|
||||||
workspace_config_path.push("projects.personal");
|
workspace_config_path.push("projects.personal");
|
||||||
success_message = String::from("projects.conf saved to projects.personal");
|
workspace_settings_path.push("conf.personal");
|
||||||
|
success_message = String::from("projects.conf saved to projects.personal\nconf saved to conf.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(){
|
||||||
@@ -411,6 +418,17 @@ 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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let remove_res = fs::remove_file(&workspace_settings_path);
|
||||||
|
if remove_res.is_err(){
|
||||||
|
print_error("error removing to save over workspace settings!", remove_res.err().unwrap().to_string());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
remove_res.unwrap();
|
||||||
|
let copy_res = fs::copy(config_path, &workspace_settings_path);
|
||||||
|
if copy_res.is_err(){
|
||||||
|
print_error("error copying worksapce settings!", copy_res.err().unwrap().to_string());
|
||||||
|
}
|
||||||
|
}
|
||||||
print_success(success_message);
|
print_success(success_message);
|
||||||
}
|
}
|
||||||
if threads.len() > 0{
|
if threads.len() > 0{
|
||||||
@@ -422,7 +440,7 @@ for help enter help or ?. for information about a specific command enter help (c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if worksapces_in_use{
|
if worksapces_in_use{
|
||||||
print_success("projects saved to projects.conf, workspace project updated, threads finished. pentest_tool OUT!");
|
print_success("projects saved to projects.conf, workspace projects updated, workspace settings saved, threads finished. pentest_tool OUT!");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
print_success("projects saved to projects.conf, threads finished. pentest_tool OUT!");
|
print_success("projects saved to projects.conf, threads finished. pentest_tool OUT!");
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use std::path::PathBuf;
|
use std::{collections::HashMap, path::PathBuf};
|
||||||
use std::fs::read_to_string;
|
use std::fs::read_to_string;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use crate::{get_user_input, open_overwrite};
|
use crate::{get_user_input, open_overwrite, tableize};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -147,3 +147,42 @@ vault_name:{}
|
|||||||
write_res.unwrap();
|
write_res.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pub fn load_config(config: &PathBuf) -> HashMap<&'static str, String>{
|
||||||
|
let mut settings_map = HashMap::new();
|
||||||
|
let settings_string = read_to_string(&config).expect("error reading config file");
|
||||||
|
let settings: Vec<&str> = settings_string.split("\n").collect();
|
||||||
|
for line in settings{
|
||||||
|
if line.len() > 1{
|
||||||
|
let setting_vec: Vec<&str> = line.split(":").collect();
|
||||||
|
match setting_vec[0]{
|
||||||
|
"Project_files" => {settings_map.insert("project_files", setting_vec[1].trim_end().to_owned());},
|
||||||
|
"Project_notes" => {settings_map.insert("project_notes", setting_vec[1].trim_end().to_owned());},
|
||||||
|
"tools_folder" => {settings_map.insert("tools_folder",setting_vec[1].trim_end().to_owned());},
|
||||||
|
"upcoming_files" => {settings_map.insert("upcoming_files",setting_vec[1].trim_end().to_owned());},
|
||||||
|
"upcoming_notes" => {settings_map.insert("upcoming_notes",setting_vec[1].trim_end().to_owned());},
|
||||||
|
"box_template" => {settings_map.insert("box_template", setting_vec[1].trim_end().to_owned());},
|
||||||
|
"terminal" => {settings_map.insert("terminal_command", setting_vec[1].trim_end().to_owned());},
|
||||||
|
"cracking_rig" => {settings_map.insert("cracking_rig", setting_vec[1].trim_end().to_owned());},
|
||||||
|
"rockyou_location" => {settings_map.insert("rockyou", setting_vec[1].trim_end().to_owned());},
|
||||||
|
"rule_location" => {settings_map.insert("rule", setting_vec[1].trim_end().to_owned());},
|
||||||
|
"pass_file"=> {settings_map.insert("pass_spray_file", setting_vec[1].trim_end().to_owned());},
|
||||||
|
"fingerprint" => {settings_map.insert("fingerprint", setting_vec[1].trim_end().to_owned());},
|
||||||
|
"vault_name" => {settings_map.insert("vault_name", setting_vec[1].trim_end().to_owned());},
|
||||||
|
_ => println!("error unknown setting: {}", setting_vec[0])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return settings_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn print_settings(settings: &HashMap<&str, String>){
|
||||||
|
let mut lines = Vec::new();
|
||||||
|
lines.push(String::from("Settings||value"));
|
||||||
|
for setting in settings.keys(){
|
||||||
|
let new_line = format!("{}||{}", setting, settings[setting]);
|
||||||
|
lines.push(new_line);
|
||||||
|
}
|
||||||
|
tableize(lines);
|
||||||
|
}
|
||||||
@@ -211,53 +211,11 @@ fn main() {
|
|||||||
if config_path.as_path().exists() == false{
|
if config_path.as_path().exists() == false{
|
||||||
install::install(&config_path);
|
install::install(&config_path);
|
||||||
}
|
}
|
||||||
let mut project_base_folder = PathBuf::new();
|
|
||||||
let mut project_base_notes = PathBuf::new();
|
|
||||||
let mut tools_folder = PathBuf::new();
|
|
||||||
let mut terminal_command = String::new();
|
|
||||||
let mut box_template = String::new();
|
|
||||||
let mut cracking_rig = String::new();
|
|
||||||
let mut rockyou = String::new();
|
|
||||||
let mut rule = String::new();
|
|
||||||
let mut upcoming_files = PathBuf::new();
|
|
||||||
let mut upcoming_notes = PathBuf::new();
|
|
||||||
let mut pass_spray_file = PathBuf::new();
|
|
||||||
let mut fingerprint = false;
|
|
||||||
let mut vault_name = String::new();
|
|
||||||
println!("\nconfig already generated\nloading config file...\n");
|
println!("\nconfig already generated\nloading config file...\n");
|
||||||
let settings_string = fs::read_to_string(&config_path).expect("error reading config file");
|
let settings = configuration::load_config(&config_path);
|
||||||
let settings: Vec<&str> = settings_string.split("\n").collect();
|
for setting in settings.keys(){
|
||||||
for line in settings{
|
println!("{}: {}", setting, settings[setting].green());
|
||||||
if line.len() > 1{
|
|
||||||
let setting_vec: Vec<&str> = line.split(":").collect();
|
|
||||||
match setting_vec[0]{
|
|
||||||
"Project_files" => project_base_folder.push(setting_vec[1].trim_end()),
|
|
||||||
"Project_notes" => project_base_notes.push(setting_vec[1].trim_end()),
|
|
||||||
"tools_folder" => tools_folder.push(setting_vec[1].trim_end()),
|
|
||||||
"upcoming_files" => upcoming_files.push(setting_vec[1].trim_end()),
|
|
||||||
"upcoming_notes" => upcoming_notes.push(setting_vec[1].trim_end()),
|
|
||||||
"box_template" => box_template = setting_vec[1].trim_end().to_owned(),
|
|
||||||
"terminal" => terminal_command = setting_vec[1].trim_end().to_owned(),
|
|
||||||
"cracking_rig" => cracking_rig = setting_vec[1].trim_end().to_owned(),
|
|
||||||
"rockyou_location" => rockyou = setting_vec[1].trim_end().to_owned(),
|
|
||||||
"rule_location" => rule = setting_vec[1].trim_end().to_owned(),
|
|
||||||
"pass_file"=> pass_spray_file.push(setting_vec[1]),
|
|
||||||
"fingerprint" => {if setting_vec[1].contains("y"){fingerprint = true}},
|
|
||||||
"vault_name" => vault_name = setting_vec[1].trim_end().to_owned(),
|
|
||||||
_ => println!("error unknown setting: {}", setting_vec[0])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print!("
|
|
||||||
Project Folders: {}
|
|
||||||
Note Folders: {}
|
|
||||||
Tools Folder: {}
|
|
||||||
distrobox template: {}
|
|
||||||
terminal_command: {}
|
|
||||||
cracking_rig: {}\n
|
|
||||||
upcoming project folders: {}
|
|
||||||
upcoming project notes: {}
|
|
||||||
", &project_base_folder.display().to_string().green(), &project_base_notes.display().to_string().green(), &tools_folder.display().to_string().green(), box_template.to_string().green(), terminal_command.green(), cracking_rig.green(), &upcoming_files.display().to_string().green(), &upcoming_notes.display().to_string().green());
|
|
||||||
println!("{}","loading project configs...".green());
|
println!("{}","loading project configs...".green());
|
||||||
let projects_res = project_controls::get_projects(&config_path, true);
|
let projects_res = project_controls::get_projects(&config_path, true);
|
||||||
if projects_res.is_none(){
|
if projects_res.is_none(){
|
||||||
@@ -265,7 +223,7 @@ fn main() {
|
|||||||
println!("{}", "CHECK YOUR PROJECTS.CONF FILE".red());
|
println!("{}", "CHECK YOUR PROJECTS.CONF FILE".red());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let projects = projects_res.unwrap();
|
let mut projects = projects_res.unwrap();
|
||||||
let _continue = get_user_input("press enter to load Command Line Interface");
|
let _continue = get_user_input("press enter to load Command Line Interface");
|
||||||
cli::cli(true, projects, config_path, &project_base_folder, &project_base_notes, &tools_folder, box_template, terminal_command, cracking_rig, rockyou, rule, &upcoming_files, &upcoming_notes, &pass_spray_file, fingerprint, vault_name);
|
cli::cli(&mut projects, &config_path);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::thread::JoinHandle;
|
use std::thread::JoinHandle;
|
||||||
|
use std::collections::HashMap;
|
||||||
use clearscreen::clear;
|
use clearscreen::clear;
|
||||||
use clearscreen;
|
use clearscreen;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
@@ -7,23 +8,13 @@ use crate::get_user_input;
|
|||||||
use crate::Project;
|
use crate::Project;
|
||||||
use crate::cli;
|
use crate::cli;
|
||||||
|
|
||||||
pub fn main_menu(projects: &mut Vec<Project>,
|
pub fn main_menu(given_projects: &mut Vec<Project>,
|
||||||
config_path: PathBuf,
|
config_path: PathBuf,
|
||||||
base_files: &PathBuf,
|
settings: &HashMap<&str, String>
|
||||||
base_notes: &PathBuf,
|
) -> Option<Vec<JoinHandle<()>>>{
|
||||||
tools_dir: &PathBuf,
|
|
||||||
boxtemplate: String,
|
|
||||||
terminal: String,
|
|
||||||
cracking_rig: String,
|
|
||||||
rockyou: String,
|
|
||||||
rule: String,
|
|
||||||
upcoming_files: &PathBuf,
|
|
||||||
upcoming_notes: &PathBuf,
|
|
||||||
password_spray_file: &PathBuf,
|
|
||||||
fingerprint: bool,
|
|
||||||
vault_name: String) -> Option<Vec<JoinHandle<()>>>{
|
|
||||||
let mut loopize = true;
|
let mut loopize = true;
|
||||||
let mut threads = Vec::new();
|
let mut threads = Vec::new();
|
||||||
|
let mut projects = given_projects.clone();
|
||||||
let banner = "
|
let banner = "
|
||||||
,,,;;::ccccc::;;;::c::;,;::cccccllc::::::;:::;;;;,,;,'',,;,,;;;;;;;:;;;;;,,,,,,,,,,,'''''',,,,,,''''
|
,,,;;::ccccc::;;;::c::;,;::cccccllc::::::;:::;;;;,,;,'',,;,,;;;;;;;:;;;;;,,,,,,,,,,,'''''',,,,,,''''
|
||||||
,;;;::ccccc::::::ccc:;;;:ccccccclc::ccccccc::;;;;;;;;;;,,;;;;;;;;;;;;;;;,,,,,,,,,,,'''''''''',,,,,''
|
,;;;::ccccc::::::ccc:;;;:ccccccclc::ccccccc::;;;;;;;;;;,,;;;;;;;;;;;;;;;,,,,,,,,,,,'''''''''',,,,,''
|
||||||
@@ -108,35 +99,35 @@ ___ ___ _ ___ ___
|
|||||||
30.) exit menu
|
30.) exit menu
|
||||||
".custom_color((255,165,0)));
|
".custom_color((255,165,0)));
|
||||||
match get_user_input("selection?").as_str(){
|
match get_user_input("selection?").as_str(){
|
||||||
"1" => {let thread_option = cli::run_command("show active project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"1" => {let thread_option = cli::run_command("show active project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"2" => {let thread_option = cli::run_command("list projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"2" => {let thread_option = cli::run_command("list &mut projects".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"3" => {let thread_option = cli::run_command("switch project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"3" => {let thread_option = cli::run_command("switch project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"5" => {let thread_option = cli::run_command("save projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"5" => {let thread_option = cli::run_command("save &mut projects".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"6" => {let thread_option = cli::run_command("import project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"6" => {let thread_option = cli::run_command("import project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"7" => {let thread_option = cli::run_command("remove project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"7" => {let thread_option = cli::run_command("remove project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"8" => {let thread_option = cli::run_command("show upcoming projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"8" => {let thread_option = cli::run_command("show upcoming &mut projects".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"9" => {let thread_option = cli::run_command("promote project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"9" => {let thread_option = cli::run_command("promote project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"10" => {let thread_option = cli::run_command("new terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"10" => {let thread_option = cli::run_command("new terminal".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"12" => {let thread_option = cli::run_command("cobalt strike".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"12" => {let thread_option = cli::run_command("cobalt strike".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"13" => {let thread_option = cli::run_command("recreate distrobox".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"13" => {let thread_option = cli::run_command("recreate distrobox".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"14" => {let thread_option = cli::run_command("generate userpass".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"14" => {let thread_option = cli::run_command("generate userpass".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"15" => {let thread_option = cli::run_command("initial enum".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"15" => {let thread_option = cli::run_command("initial enum".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"16" => {let thread_option = cli::run_command("build attack notes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"16" => {let thread_option = cli::run_command("build attack notes".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"17" => {let thread_option = cli::run_command("host discovery".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"17" => {let thread_option = cli::run_command("host discovery".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"18" => {let thread_option = cli::run_command("port scan".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"18" => {let thread_option = cli::run_command("port scan".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"19" => {let thread_option = cli::run_command("parse port scan".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"19" => {let thread_option = cli::run_command("parse port scan".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"20" => {let thread_option = cli::run_command("stop boxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"20" => {let thread_option = cli::run_command("stop boxes".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"21" => {let thread_option = cli::run_command("password spray".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"21" => {let thread_option = cli::run_command("password spray".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"22" => {let thread_option = cli::run_command("bloodhound".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"22" => {let thread_option = cli::run_command("bloodhound".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"23" => {let thread_option = cli::run_command("parse gather contacts".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"23" => {let thread_option = cli::run_command("parse gather contacts".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"24" => {let thread_option = cli::run_command("prune distroboxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"24" => {let thread_option = cli::run_command("prune distroboxes".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"25" => {let thread_option = cli::run_command("dns records".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"25" => {let thread_option = cli::run_command("dns records".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"26" => {let thread_option = cli::run_command("brute force subdomains".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"26" => {let thread_option = cli::run_command("brute force subdomains".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"27" => {let thread_option = cli::run_command("dns enumeration".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"27" => {let thread_option = cli::run_command("dns enumeration".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||||
"28" => {let threads_option = external_menu(banner, projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.clone(), cracking_rig.clone(), rockyou.clone(), rule.clone(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.clone()); if threads_option.is_some(){for thread in threads_option.unwrap(){threads.push(thread)}}},
|
"28" => {let threads_option = external_menu(banner, &mut projects, config_path.clone(), settings); if threads_option.is_some(){for thread in threads_option.unwrap(){threads.push(thread);}}},
|
||||||
"29" => {let threads_option = internal_menu(banner, projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.clone(), cracking_rig.clone(), rockyou.clone(), rule.clone(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.clone()); if threads_option.is_some(){for thread in threads_option.unwrap(){threads.push(thread)}}},
|
"29" => {let threads_option = internal_menu(banner, &mut projects, config_path.clone(), settings); if threads_option.is_some(){for thread in threads_option.unwrap(){threads.push(thread);}}},
|
||||||
"30" => loopize = false,
|
"30" => loopize = false,
|
||||||
_ => println!("{}","unknown selection, try again!".red()),
|
_ => println!("{}","unknown selection, try again!".red()),
|
||||||
}
|
}
|
||||||
@@ -149,21 +140,10 @@ ___ ___ _ ___ ___
|
|||||||
}
|
}
|
||||||
pub fn external_menu(
|
pub fn external_menu(
|
||||||
banner: &str,
|
banner: &str,
|
||||||
projects: &mut Vec<Project>,
|
mut projects: &mut Vec<Project>,
|
||||||
config_path: PathBuf,
|
config_path: PathBuf,
|
||||||
base_files: &PathBuf,
|
settings: &HashMap<&str, String>
|
||||||
base_notes: &PathBuf,
|
) -> Option<Vec<JoinHandle<()>>>{
|
||||||
tools_dir: &PathBuf,
|
|
||||||
boxtemplate: String,
|
|
||||||
terminal: String,
|
|
||||||
cracking_rig: String,
|
|
||||||
rockyou: String,
|
|
||||||
rule: String,
|
|
||||||
upcoming_files: &PathBuf,
|
|
||||||
upcoming_notes: &PathBuf,
|
|
||||||
password_spray_file: &PathBuf,
|
|
||||||
fingerprint: bool,
|
|
||||||
vault_name: String) -> Option<Vec<JoinHandle<()>>>{
|
|
||||||
let mut loopize = true;
|
let mut loopize = true;
|
||||||
let mut threads = Vec::new();
|
let mut threads = Vec::new();
|
||||||
while loopize {
|
while loopize {
|
||||||
@@ -204,28 +184,28 @@ ___ ___ _ ___ ___
|
|||||||
23.) exit menu
|
23.) exit menu
|
||||||
".custom_color((255,165,0)));
|
".custom_color((255,165,0)));
|
||||||
match get_user_input("selection?").as_str(){
|
match get_user_input("selection?").as_str(){
|
||||||
"1" => {let thread_option = cli::run_command("show active project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"1" => {let thread_option = cli::run_command("show active project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||||
"2" => {let thread_option = cli::run_command("list projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"2" => {let thread_option = cli::run_command("list projects".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"3" => {let thread_option = cli::run_command("switch project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"3" => {let thread_option = cli::run_command("switch project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"5" => {let thread_option = cli::run_command("save projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"5" => {let thread_option = cli::run_command("save projects".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"6" => {let thread_option = cli::run_command("import project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"6" => {let thread_option = cli::run_command("import project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"7" => {let thread_option = cli::run_command("remove project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"7" => {let thread_option = cli::run_command("remove project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"8" => {let thread_option = cli::run_command("show upcoming projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"8" => {let thread_option = cli::run_command("show upcoming projects".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"9" => {let thread_option = cli::run_command("promote project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"9" => {let thread_option = cli::run_command("promote project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"10" => {let thread_option = cli::run_command("new terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"10" => {let thread_option = cli::run_command("new terminal".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"12" => {let thread_option = cli::run_command("recreate distrobox".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"12" => {let thread_option = cli::run_command("recreate distrobox".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"13" => {let thread_option = cli::run_command("generate userpass".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"13" => {let thread_option = cli::run_command("generate userpass".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"14" => {let thread_option = cli::run_command("initial enum".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"14" => {let thread_option = cli::run_command("initial enum".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"15" => {let thread_option = cli::run_command("build attack notes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"15" => {let thread_option = cli::run_command("build attack notes".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||||
"26" => {let thread_option = cli::run_command("stop boxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"26" => {let thread_option = cli::run_command("stop boxes".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||||
"17" => {let thread_option = cli::run_command("password spray".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"17" => {let thread_option = cli::run_command("password spray".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||||
"18" => {let thread_option = cli::run_command("parse gather contacts".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"18" => {let thread_option = cli::run_command("parse gather contacts".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||||
"19" => {let thread_option = cli::run_command("prune distroboxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"19" => {let thread_option = cli::run_command("prune distroboxes".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||||
"20" => {let thread_option = cli::run_command("dns records".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"20" => {let thread_option = cli::run_command("dns records".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||||
"21" => {let thread_option = cli::run_command("brute force subdomains".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"21" => {let thread_option = cli::run_command("brute force subdomains".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||||
"22" => {let thread_option = cli::run_command("dns enumeration".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"22" => {let thread_option = cli::run_command("dns enumeration".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||||
"23" => loopize = false,
|
"23" => loopize = false,
|
||||||
_ => println!("{}", "unknown selection, try again!".red()),
|
_ => println!("{}", "unknown selection, try again!".red()),
|
||||||
}
|
}
|
||||||
@@ -240,21 +220,9 @@ ___ ___ _ ___ ___
|
|||||||
|
|
||||||
pub fn internal_menu(
|
pub fn internal_menu(
|
||||||
banner: &str,
|
banner: &str,
|
||||||
projects: &mut Vec<Project>,
|
mut projects: &mut Vec<Project>,
|
||||||
config_path: PathBuf,
|
config_path: PathBuf,
|
||||||
base_files: &PathBuf,
|
settings: &HashMap<&str, String>) -> Option<Vec<JoinHandle<()>>>{
|
||||||
base_notes: &PathBuf,
|
|
||||||
tools_dir: &PathBuf,
|
|
||||||
boxtemplate: String,
|
|
||||||
terminal: String,
|
|
||||||
cracking_rig: String,
|
|
||||||
rockyou: String,
|
|
||||||
rule: String,
|
|
||||||
upcoming_files: &PathBuf,
|
|
||||||
upcoming_notes: &PathBuf,
|
|
||||||
password_spray_file: &PathBuf,
|
|
||||||
fingerprint: bool,
|
|
||||||
vault_name: String) -> Option<Vec<JoinHandle<()>>>{
|
|
||||||
let mut loopize = true;
|
let mut loopize = true;
|
||||||
let mut threads = Vec::new();
|
let mut threads = Vec::new();
|
||||||
while loopize {
|
while loopize {
|
||||||
@@ -294,27 +262,26 @@ ___ ___ _ ___ ___
|
|||||||
22.) exit menu
|
22.) exit menu
|
||||||
".custom_color((255,165,0)));
|
".custom_color((255,165,0)));
|
||||||
match get_user_input("selection?").as_str(){
|
match get_user_input("selection?").as_str(){
|
||||||
"1" => {let thread_option = cli::run_command("show active project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"1" => {let thread_option = cli::run_command("show active project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"2" => {let thread_option = cli::run_command("list projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"2" => {let thread_option = cli::run_command("list projects".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"3" => {let thread_option = cli::run_command("switch project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"3" => {let thread_option = cli::run_command("switch project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"5" => {let thread_option = cli::run_command("save projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"5" => {let thread_option = cli::run_command("save projects".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"6" => {let thread_option = cli::run_command("import project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"6" => {let thread_option = cli::run_command("import project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"7" => {let thread_option = cli::run_command("remove project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"7" => {let thread_option = cli::run_command("remove project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"8" => {let thread_option = cli::run_command("show upcoming projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"8" => {let thread_option = cli::run_command("show upcoming projects".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"9" => {let thread_option = cli::run_command("promote project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"9" => {let thread_option = cli::run_command("promote project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"10" => {let thread_option = cli::run_command("new terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"10" => {let thread_option = cli::run_command("new terminal".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"12" => {let thread_option = cli::run_command("cobalt strike".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"12" => {let thread_option = cli::run_command("cobalt strike".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"13" => {let thread_option = cli::run_command("recreate distrobox".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"13" => {let thread_option = cli::run_command("recreate distrobox".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"14" => {let thread_option = cli::run_command("generate userpass".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"14" => {let thread_option = cli::run_command("generate userpass".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"15" => {let thread_option = cli::run_command("host discovery".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"15" => {let thread_option = cli::run_command("host discovery".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"16" => {let thread_option = cli::run_command("port scan".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"16" => {let thread_option = cli::run_command("port scan".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"17" => {let thread_option = cli::run_command("parse port scan".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"18" => {let thread_option = cli::run_command("stop boxes".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"18" => {let thread_option = cli::run_command("stop boxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"19" => {let thread_option = cli::run_command("password spray".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"19" => {let thread_option = cli::run_command("password spray".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"20" => {let thread_option = cli::run_command("bloodhound".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"20" => {let thread_option = cli::run_command("bloodhound".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
"21" => {let thread_option = cli::run_command("prune distroboxes".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||||
"21" => {let thread_option = cli::run_command("prune distroboxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
|
||||||
"22" => loopize = false,
|
"22" => loopize = false,
|
||||||
_ => println!("{}", "unknown selection, try again!".red()),
|
_ => println!("{}", "unknown selection, try again!".red()),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,10 @@ use std::time::Duration;
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
|
|
||||||
|
use crate::configuration;
|
||||||
use crate::get_user_input;
|
use crate::get_user_input;
|
||||||
use crate::open_overwrite;
|
use crate::open_overwrite;
|
||||||
|
use crate::print_informational;
|
||||||
use crate::tableize;
|
use crate::tableize;
|
||||||
use crate::Project;
|
use crate::Project;
|
||||||
use crate::box_controls::make_box;
|
use crate::box_controls::make_box;
|
||||||
@@ -502,6 +504,13 @@ pub fn list_projects(projects: &Vec<Project>){
|
|||||||
|
|
||||||
|
|
||||||
pub fn separate_personal_work_projects(config_path: &PathBuf){
|
pub fn separate_personal_work_projects(config_path: &PathBuf){
|
||||||
|
let config = config_path.clone();
|
||||||
|
let mut config_personal = config_path.clone();
|
||||||
|
config_personal.pop();
|
||||||
|
config_personal.push("conf.personal");
|
||||||
|
let mut config_work = config_path.clone();
|
||||||
|
config_work.pop();
|
||||||
|
config_work.push("conf.working");
|
||||||
let mut projects_conf_path = config_path.clone();
|
let mut projects_conf_path = config_path.clone();
|
||||||
projects_conf_path.pop();
|
projects_conf_path.pop();
|
||||||
projects_conf_path.push("projects.conf");
|
projects_conf_path.push("projects.conf");
|
||||||
@@ -511,7 +520,6 @@ pub fn separate_personal_work_projects(config_path: &PathBuf){
|
|||||||
let mut personal_conf_path = config_path.clone();
|
let mut personal_conf_path = config_path.clone();
|
||||||
personal_conf_path.pop();
|
personal_conf_path.pop();
|
||||||
personal_conf_path.push("projects.personal");
|
personal_conf_path.push("projects.personal");
|
||||||
println!("{}", projects_conf_path.display());
|
|
||||||
let project_read_res = read_to_string(&projects_conf_path);
|
let project_read_res = read_to_string(&projects_conf_path);
|
||||||
if project_read_res.is_err(){
|
if project_read_res.is_err(){
|
||||||
print_error("error reading current projects config file!", project_read_res.err().unwrap().to_string());
|
print_error("error reading current projects config file!", project_read_res.err().unwrap().to_string());
|
||||||
@@ -522,13 +530,15 @@ pub fn separate_personal_work_projects(config_path: &PathBuf){
|
|||||||
let mut personal_projects = Vec::new();
|
let mut personal_projects = Vec::new();
|
||||||
let mut work_projects = Vec::new();
|
let mut work_projects = Vec::new();
|
||||||
let mut default = String::new();
|
let mut default = String::new();
|
||||||
|
print_success("current projects loaded!");
|
||||||
|
print_informational("we'll now go through project by project, answer yes or no to the following questions...");
|
||||||
for line in project_lines{
|
for line in project_lines{
|
||||||
let words: Vec<&str> = line.split(":").collect();
|
if line.contains("default"){
|
||||||
if words.len() > 3{
|
default = line.trim_end().to_owned();
|
||||||
if words[0].contains("default"){
|
}
|
||||||
default = line.to_owned();
|
else{
|
||||||
}
|
let words: Vec<&str> = line.split(":").collect();
|
||||||
else{
|
if words.len() > 3{
|
||||||
println!("{} {}", words[0], words[1]);
|
println!("{} {}", words[0], words[1]);
|
||||||
if get_user_input("should this project be added to your personal projects config files?").to_lowercase().contains("y"){
|
if get_user_input("should this project be added to your personal projects config files?").to_lowercase().contains("y"){
|
||||||
personal_projects.push(line.to_owned());
|
personal_projects.push(line.to_owned());
|
||||||
@@ -550,7 +560,7 @@ pub fn separate_personal_work_projects(config_path: &PathBuf){
|
|||||||
}
|
}
|
||||||
let person_config_open_res = fs::OpenOptions::new().create(true).write(true).open(personal_conf_path);
|
let person_config_open_res = fs::OpenOptions::new().create(true).write(true).open(personal_conf_path);
|
||||||
if person_config_open_res.is_err(){
|
if person_config_open_res.is_err(){
|
||||||
print_error("error opening personal config file!", person_config_open_res.err().unwrap().to_string());
|
print_error("error opening personal projects config file!", person_config_open_res.err().unwrap().to_string());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let mut work_config_file = work_config_open_res.unwrap();
|
let mut work_config_file = work_config_open_res.unwrap();
|
||||||
@@ -580,9 +590,98 @@ pub fn separate_personal_work_projects(config_path: &PathBuf){
|
|||||||
write!(personal_config_file, "{}\n", project).unwrap();
|
write!(personal_config_file, "{}\n", project).unwrap();
|
||||||
}
|
}
|
||||||
print_success("projects separated successfully!");
|
print_success("projects separated successfully!");
|
||||||
|
print_informational("now we'll separate the configuration files.");
|
||||||
|
let current_config_type = get_user_input("is the current settings loaded for work? (not personal)");
|
||||||
|
if current_config_type.to_lowercase().contains("y"){
|
||||||
|
let copy_res = fs::copy(&config, &config_work);
|
||||||
|
if copy_res.is_err(){
|
||||||
|
print_error("error copying config file to config.work!", copy_res.unwrap().to_string());
|
||||||
|
let copy_cmd = format!("cp {} {}", &config.display(), &config_work.display());
|
||||||
|
print_informational(copy_cmd);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
copy_res.unwrap();
|
||||||
|
print_success("conf.work successfully created!");
|
||||||
|
}
|
||||||
|
print_informational("Next we will create a new config file for work.\nIt will be save as conf.personal");
|
||||||
|
print_informational("\nplease select create from scratch at the next prompt, and fill out the information for your personal settings");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
let copy_res = fs::copy(&config, &config_personal);
|
||||||
|
if copy_res.is_err(){
|
||||||
|
print_error("error copying config file to config.personal!", copy_res.unwrap().to_string());
|
||||||
|
let copy_cmd = format!("cp {} {}", &config.display(), &config_personal.display());
|
||||||
|
print_informational(copy_cmd);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
copy_res.unwrap();
|
||||||
|
print_success("conf.personal successfully created!");
|
||||||
|
}
|
||||||
|
print_informational("Next we will create a new config file for work.\nIt will be save as conf.working");
|
||||||
|
print_informational("\nplease select create from scratch at the next prompt, and fill out the information for your work settings");
|
||||||
|
}
|
||||||
|
configuration::generate_tool_config(&config);
|
||||||
|
print_informational("great! now we're going to copy that to the specified new config file!");
|
||||||
|
if current_config_type.to_lowercase().contains("y"){
|
||||||
|
let copy_res = fs::copy(&config, &config_personal);
|
||||||
|
if copy_res.is_err(){
|
||||||
|
print_error("error copying to conf.personal!", copy_res.err().unwrap().to_string());
|
||||||
|
let copy_cmd = format!("plase run the following command in your terminal\ncp {} {}", &config.display(), &config_personal.display());
|
||||||
|
print_informational(copy_cmd);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
copy_res.unwrap();
|
||||||
|
print_success("conf.personal successfully created!");
|
||||||
|
let remove_res = fs::remove_file(&config);
|
||||||
|
if remove_res.is_err(){
|
||||||
|
print_error("error restroing original config file!", remove_res.err().unwrap().to_string());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
remove_res.unwrap();
|
||||||
|
let copy_res = fs::copy(&config_work, &config);
|
||||||
|
if copy_res.is_err(){
|
||||||
|
print_error("error restoring original config file!", copy_res.err().unwrap().to_string());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
copy_res.unwrap();
|
||||||
|
print_success("original configuration successfully restored!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
let copy_res = fs::copy(&config, &config_work);
|
||||||
|
if copy_res.is_err(){
|
||||||
|
print_error("error copying to conf.work!", copy_res.err().unwrap().to_string());
|
||||||
|
let copy_cmd = format!("plase run the following command in your terminal\ncp {} {}", &config.display(), &config_work.display());
|
||||||
|
print_informational(copy_cmd);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
copy_res.unwrap();
|
||||||
|
print_success("conf.personal successfully created!");
|
||||||
|
let remove_res = fs::remove_file(&config);
|
||||||
|
if remove_res.is_err(){
|
||||||
|
print_error("error restoring original config!", remove_res.err().unwrap().to_string());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
remove_res.unwrap();
|
||||||
|
let copy_res = fs::copy(&config_personal, &config);
|
||||||
|
if copy_res.is_err(){
|
||||||
|
print_error("error resoring original config!", copy_res.err().unwrap().to_string());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
copy_res.unwrap();
|
||||||
|
print_success("original configuration successfully restored!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn swith_to_personal(config: &PathBuf) -> Option<Vec<Project>>{
|
pub fn swith_to_personal(config: &PathBuf) -> Option<Vec<Project>>{
|
||||||
|
let mut personal_config_path = config.clone();
|
||||||
|
personal_config_path.pop();
|
||||||
|
personal_config_path.push("conf.personal");
|
||||||
let mut projects_path = config.clone();
|
let mut projects_path = config.clone();
|
||||||
projects_path.pop();
|
projects_path.pop();
|
||||||
let mut personal_projects = config.clone();
|
let mut personal_projects = config.clone();
|
||||||
@@ -602,11 +701,30 @@ pub fn swith_to_personal(config: &PathBuf) -> Option<Vec<Project>>{
|
|||||||
}
|
}
|
||||||
let mut project_conf = open_res.unwrap();
|
let mut project_conf = open_res.unwrap();
|
||||||
write!(project_conf, "{}", person_projects_string).unwrap();
|
write!(project_conf, "{}", person_projects_string).unwrap();
|
||||||
|
print_success("projects changed successfully!");
|
||||||
let new_projects = get_projects(config, true);
|
let new_projects = get_projects(config, true);
|
||||||
|
let remove_res = fs::remove_file(config);
|
||||||
|
if remove_res.is_ok(){
|
||||||
|
remove_res.unwrap();
|
||||||
|
let copy_res = fs::copy(personal_config_path, config);
|
||||||
|
if copy_res.is_ok(){
|
||||||
|
copy_res.unwrap();
|
||||||
|
print_success("settings successfully changed!");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
print_error("error changing settings!", copy_res.err().unwrap().to_string());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
print_error("error removing current settings!", remove_res.err().unwrap().to_string());
|
||||||
|
}
|
||||||
return new_projects;
|
return new_projects;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn swith_to_work(config: &PathBuf) -> Option<Vec<Project>>{
|
pub fn swith_to_work(config: &PathBuf) -> Option<Vec<Project>>{
|
||||||
|
let mut work_config_path = config.clone();
|
||||||
|
work_config_path.pop();
|
||||||
|
work_config_path.push("conf.working");
|
||||||
let mut projects_path = config.clone();
|
let mut projects_path = config.clone();
|
||||||
projects_path.pop();
|
projects_path.pop();
|
||||||
let mut work_projects = config.clone();
|
let mut work_projects = config.clone();
|
||||||
@@ -626,6 +744,22 @@ pub fn swith_to_work(config: &PathBuf) -> Option<Vec<Project>>{
|
|||||||
}
|
}
|
||||||
let mut project_conf = open_res.unwrap();
|
let mut project_conf = open_res.unwrap();
|
||||||
write!(project_conf, "{}", work_projects_string).unwrap();
|
write!(project_conf, "{}", work_projects_string).unwrap();
|
||||||
|
print_success("projects changed successfully!");
|
||||||
let new_projects = get_projects(config, true);
|
let new_projects = get_projects(config, true);
|
||||||
|
let remove_res = fs::remove_file(config);
|
||||||
|
if remove_res.is_ok(){
|
||||||
|
remove_res.unwrap();
|
||||||
|
let copy_res = fs::copy(work_config_path, config);
|
||||||
|
if copy_res.is_ok(){
|
||||||
|
copy_res.unwrap();
|
||||||
|
print_success("settings successfully changed!");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
print_error("error changing settings!", copy_res.err().unwrap().to_string());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
print_error("error removing current settings!", remove_res.err().unwrap().to_string());
|
||||||
|
}
|
||||||
return new_projects;
|
return new_projects;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user