diff --git a/pentest_tool/src/cli.rs b/pentest_tool/src/cli.rs index e4fa7b5..89f5db8 100644 --- a/pentest_tool/src/cli.rs +++ b/pentest_tool/src/cli.rs @@ -1,3 +1,4 @@ +use std::os::unix::thread; use std::path::PathBuf; use std::process::exit; use std::thread::JoinHandle; @@ -49,6 +50,7 @@ fn help(command: Option){ println!("Welcom to Pyro's pentest command line!"); println!("available commands: name | aliases | ..."); print!(" +menu | main menu | mm list projects | lp | listp | list p switch project | sp | switch p | switchp show active project | show active | sa | show a @@ -77,8 +79,29 @@ help | ? | -h ") } +pub fn get_active_project(projects: &Vec) -> &Project{ + let mut active_project = &projects[0]; + for project in projects{ + if project.active == true{ + active_project = project + } + } + return active_project +} + +pub fn next_project_id(config_path: &PathBuf) -> i32{ + let projects = project_controls::get_projects(config_path, false); + let mut new_id = 0; + for project in projects.clone(){ + if project.id > new_id{ + new_id = project.id + 1; + } + } + return new_id; +} + pub fn run_command(cmd: String, - projects: &mut Vec, + mut projects: &mut Vec, config_path: PathBuf, base_files: &PathBuf, base_notes: &PathBuf, @@ -92,9 +115,9 @@ pub fn run_command(cmd: String, upcoming_notes: &PathBuf, password_spray_file: &PathBuf, fingerprint: bool, - vault_name: String) -> (Option>, Vec) { - let mut new_id = menu::next_project_id(&config_path); - let active_project = menu::get_active_project(&projects); + vault_name: String) -> Option> { + let mut new_id = next_project_id(&config_path); + let active_project = get_active_project(&projects); let mut notes_folder_string = format!("{}", &active_project.notes_folder.display()); let mut obsidian_folder_vec = PathBuf::new(); let mut reached_vault_folder = false; @@ -131,40 +154,40 @@ pub fn run_command(cmd: String, else{ help(None); } - return (None, projects.clone()); + return None; } match cmd.as_str(){ - "list projects" | "lp" | "listp" | "list p" => {project_controls::list_projects(&projects); return (None, projects.clone())}, - "switch project" | "swp" | "switch p" | "switchp" => {project_controls::switch_project(&mut projects); return (None, projects.clone())}, - "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, projects.clone())}, - "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, projects.clone())}, - "save projects" | "sp" | "save" | "s" => {project_controls::save_projects(&projects, &config_path); return (None, projects.clone())}, - "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, projects.clone())}, - "remove project" | "rp" | "remove" | "rmp" => {project_controls::remove_project(&mut projects, &config_path); return (None, projects.clone())}, - "show upcoming projects" | "sup" | "show upcoming" => {project_controls::print_upcoming_projects(&projects); return (None, projects.clone())}, - "promote project" | "pp" | "promote" => {project_controls::promote_project(&mut projects, &config_path, base_files, base_notes, tools_dir, &boxtemplate, fingerprint); return (None, projects.clone())}, - "new terminal" | "enter" | "enter terminal" | "nt" | "et" => {box_controls::project_standalone_terminal(active_project.clone(), terminal.clone()); return (None, projects.clone())}, - "inline terminal" | "it" | "enter inline" | "ei" => {box_controls::project_inline_terminal(active_project.clone()); return (None, projects.clone())}, - "cobalt strike" | "cs" => {let cs_thread = box_controls::launch_cobalt_strike(active_project.clone()); return (cs_thread, projects.clone())}, - "recreate distrobox" | "rdb" | "ndb" | "new distrobox" => {box_controls::make_box(&active_project, &tools_dir, &boxtemplate, false, fingerprint); return (None, projects.clone())}, - "generate userpass" | "userpass" | "gup" | "up" => {info_controls::generate_userpass(&active_project); return (None, projects.clone())}, - "inital enum" | "ie" | "enum" => {info_controls::run_initial_enum(&active_project); return (None, projects.clone())}, - "build attack notes" | "ban" | "attack notes" | "hn" => {info_controls::build_cmd_for_host_discovery(&active_project); return (None, projects.clone());} - "host discovery" | "build host discovery" | "hd" | "bhd" => {info_controls::build_cmd_for_host_discovery(&active_project); return (None, projects.clone())}, - "port scan" | "cs port scan" | "cobaltstrike port scan" | "csps" | "ps" => {info_controls::build_cs_portscan_cmd(&active_project); return (None, projects.clone())}, - "parse port scan" | "pps" | "parse scan" => {info_controls::parse_csportscan(&active_project); return (None, projects.clone())}, - "stop boxes" | "stop distroboxes" | "sdb" => {box_controls::stop_all_boxes(&projects); return (None, projects.clone())}, - "password spray" | "pass spray" | "pas" => {info_controls::password_spray_help(&active_project, season, lseason, year, &tools_dir, &config_path); return (None, projects.clone())}, + "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}, + "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}, + "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}, + "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}, + "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}, + "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}, + "recreate distrobox" | "rdb" | "ndb" | "new distrobox" => {box_controls::make_box(&active_project, &tools_dir, &boxtemplate, false, fingerprint); return None}, + "generate userpass" | "userpass" | "gup" | "up" => {info_controls::generate_userpass(&active_project); return None}, + "inital enum" | "ie" | "enum" => {info_controls::run_initial_enum(&active_project); return None}, + "build attack notes" | "ban" | "attack notes" | "hn" => {info_controls::build_cmd_for_host_discovery(&active_project); return None;} + "host discovery" | "build host discovery" | "hd" | "bhd" => {info_controls::build_cmd_for_host_discovery(&active_project); return None}, + "port scan" | "cs port scan" | "cobaltstrike port scan" | "csps" | "ps" => {info_controls::build_cs_portscan_cmd(&active_project); return None}, + "parse port scan" | "pps" | "parse scan" => {info_controls::parse_csportscan(&active_project); return None}, + "stop boxes" | "stop distroboxes" | "sdb" => {box_controls::stop_all_boxes(&projects); return None}, + "password spray" | "pass spray" | "pas" => {info_controls::password_spray_help(&active_project, season, lseason, year, &tools_dir, &config_path); return None}, "bloodhound" | "bh" => {let bloodhound_handle = box_controls::launch_bloodhound_gui(active_project.clone()).unwrap(); return Some(bloodhound_handle);}, - "parse gather contacts" | "pgc" | "parse contacts" | "pc" => {info_controls::partse_gathercontacts(&active_project); return (None, projects.clone())}, - "prune distroboxes" | "pdb" | "prune" => {let prune_thread = box_controls::clean_unused_boxes(&projects, &boxtemplate); return (prune_thread, projects.clone())}, - "clear" | "clear screen" | "cls" => {clear().unwrap(); return (None, projects.clone())}, - _ => {println!("unknown command."); return (None, projects.clone());} + "parse gather contacts" | "pgc" | "parse contacts" | "pc" => {info_controls::partse_gathercontacts(&active_project); return None}, + "prune distroboxes" | "pdb" | "prune" => {let prune_thread = box_controls::clean_unused_boxes(&projects, &boxtemplate); return prune_thread}, + "clear" | "clear screen" | "cls" => {clear().unwrap(); return None}, + _ => {println!("unknown command."); return None;} } } pub fn cli(interactive: bool, - projects: &mut Vec, + mut projects: Vec, config_path: PathBuf, base_files: &PathBuf, base_notes: &PathBuf, @@ -178,12 +201,12 @@ pub fn cli(interactive: bool, upcoming_notes: &PathBuf, password_spray_file: &PathBuf, fingerprint: bool, - vault_name: String) -> (Option>>, projects){ + vault_name: String) { let mut threads = Vec::new(); - let active_project = menu::get_active_project(&projects); if interactive{ let mut loopize = true; while loopize{ + let active_project = get_active_project(&projects); print!(" Active Project: {}, {} Project Status: {} @@ -196,15 +219,22 @@ Obsidian URI: {} ", active_project.customer, active_project.project_name, active_project.stage, active_project.files_folder.display(), active_project.notes_folder.display(), active_project.boxname, "coming soon"); let command = get_user_input("command?"); match command.as_str(){ - "exit" | "main menu" | "mm" | "menu" => loopize = false, - _ => {let (thread_option, projects) = 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())}}, + "exit" => loopize = false, + "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);}}} + _ => {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); + if get_user_input("do you want to stop all the boxes?").contains("y"){ + box_controls::stop_all_boxes(&projects); + } } if threads.len() > 0{ - return (Some(threads), projects); - } - else { - return (None, projects.clone()); + println!("closing threads..."); + println!("note this will hang until all threads have completed"); + println!("please make sure to close all spawned programs such as cobalt strike and bloodhound."); + for thread in threads{ + let _ = thread.join(); + } } } \ No newline at end of file diff --git a/pentest_tool/src/main.rs b/pentest_tool/src/main.rs index c0cbadb..31a7523 100644 --- a/pentest_tool/src/main.rs +++ b/pentest_tool/src/main.rs @@ -17,12 +17,12 @@ pub struct Project{ } mod install; -mod menu; mod project_controls; mod box_controls; mod info_controls; mod start_pentest; mod cli; +mod menu; pub fn open_overwrite(path: &PathBuf) -> Option{ let file_create_res = fs::OpenOptions::new().create(true).write(true).open(path); @@ -160,8 +160,6 @@ fn main() { ", &project_base_folder.display(), &project_base_notes.display(), &tools_folder.display(), box_template, terminal_command, cracking_rig, &upcoming_files.display(), &upcoming_notes.display()); println!("loading project configs..."); let projects = project_controls::get_projects(&config_path, true); - println!("Enter to start main menu"); - let mut enter = String::new(); - std::io::stdin().read_line(&mut enter).unwrap(); - menu::main_menu(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); + 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); } diff --git a/pentest_tool/src/menu.rs b/pentest_tool/src/menu.rs index 813add9..b91cb1e 100644 --- a/pentest_tool/src/menu.rs +++ b/pentest_tool/src/menu.rs @@ -1,73 +1,29 @@ use std::path::PathBuf; -use std::process::exit; -use chrono::Datelike; +use std::thread::JoinHandle; use clearscreen::clear; use clearscreen; -use chrono::Local; +use crate::get_user_input; use crate::Project; -use crate::project_controls; -use crate::box_controls; -use crate::info_controls; -use crate::start_pentest; use crate::cli; -pub fn next_project_id(config_path: &PathBuf) -> i32{ - let projects = project_controls::get_projects(config_path, false); - let mut new_id = 0; - for project in projects.clone(){ - if project.id > new_id{ - new_id = project.id + 1; - } - } - return new_id; -} - -pub fn get_active_project(projects: &Vec) -> &Project{ - let mut active_project = &projects[0]; - for project in projects{ - if project.active == true{ - active_project = project - } - } - return active_project -} - -pub fn main_menu(mut projects: Vec, 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){ +pub fn main_menu(projects: &mut Vec, + 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) -> Option>>{ let mut loopize = true; - let mut new_id = next_project_id(&config_path); let mut threads = Vec::new(); - loop { - let active_project = get_active_project(&projects); - let mut notes_folder_string = format!("{}", &active_project.notes_folder.display()); - let mut obsidian_folder_vec = PathBuf::new(); - let mut reached_vault_folder = false; - for folder in notes_folder_string.split("/").collect::>(){ - if !folder.contains(&vault_name){ - reached_vault_folder = true; - obsidian_folder_vec.push(folder); - } - else{ - if reached_vault_folder{ - obsidian_folder_vec.push(folder); - } - } - } - let obsidian_uri = format!("obsidian://open?vault={}&file={}", vault_name, obsidian_folder_vec.display().to_string().replace("/", "%2F")); - let mut response = String::new(); - let now = Local::now(); - let month = now.month(); - let year = now.year(); - let mut season = String::new(); - let mut lseason = String::new(); - match month{ - 12 | 01 | 02 => {season = "Winter".to_owned(); lseason = "Fall".to_owned()}, - 03 | 04 | 05 => {season = "Spring".to_owned(); lseason = "Winter".to_owned()}, - 06 | 07 | 08 => {season = "Summer".to_owned(); lseason = "Spring".to_owned()}, - 09 | 10 | 11 => {season = "Fall".to_owned(); lseason = "Summer".to_owned()}, - _ => {println!("error getting season! Check code..."); exit(1)} - } - clear().expect("error clearing screen"); - print!(" + let banner = " ,,,;;::ccccc::;;;::c::;,;::cccccllc::::::;:::;;;;,,;,'',,;,,;;;;;;;:;;;;;,,,,,,,,,,,'''''',,,,,,'''' ,;;;::ccccc::::::ccc:;;;:ccccccclc::ccccccc::;;;;;;;;;;,,;;;;;;;;;;;;;;;,,,,,,,,,,,'''''''''',,,,,'' ,;;:::ccc:cc:::ccc:::::::ccccclcccllccccllc::::::;;;;;;;;;;;;;;;;;;;;;;,,,,,,,,,,,''''''''...'',,,,' @@ -114,18 +70,14 @@ pub fn main_menu(mut projects: Vec, config_path: PathBuf, base_files: & -NOTE OPTION 29 WILL SAVE YOUR PROJECTS BEFORE QUITTING + "; + while loopize { + let _enter_to_clear = get_user_input("press enter to display main menu."); + clear().expect("error clearing screen"); + print!(" +{} +NOTE OPTION 26 WILL SAVE YOUR PROJECTS BEFORE QUITTING -base prject folder: {} -upcoming project folder: {} -Current Project: {} {} -Working Folder: {} -Obsidian_uri: {} -Box Name: {} -Terminal Command: {} -Current Season: {} -Year: {} -General Notes: {} Main Menu: 1 .) Show Active Project @@ -152,57 +104,210 @@ General Notes: {} 22.) Launch bloodhound with the current project's distrobox 23.) Parse GatherContacts output file 24.) prune unused distroboxes (free up system storage) - 25.) enter cli - 26.) Quit Application -\n",&base_files.display(), &upcoming_files.display(), active_project.customer, active_project.project_name, active_project.files_folder.display(), active_project.notes_folder.display(), active_project.boxname, terminal, season, year, &obsidian_uri); - std::io::stdin().read_line(&mut response).expect("error getting menu input"); - clear().expect("error clearing screen"); - match response.as_str().trim_end(){ - "1" => {let (cli_thread_option, projects) = cli::run_command(String::from("show active project"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "2" => {let (cli_thread_option, projects) = cli::run_command(String::from("list projects"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "3" => {let (cli_thread_option, projects) = cli::run_command(String::from("switch project"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "4" => {let (cli_thread_option, projects) = cli::run_command(String::from("new project"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "5" => {let (cli_thread_option, projects) = cli::run_command(String::from("save projects"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "6" => {let (cli_thread_option, projects) = cli::run_command(String::from("import projects"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "7" => {let (cli_thread_option, projects) = cli::run_command(String::from("remove project"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "8" => {let (cli_thread_option, projects) = cli::run_command(String::from("show upcoming projects"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "9" => {let (cli_thread_option, projects) = cli::run_command(String::from("promote project"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "10" => {let (cli_thread_option, projects) = cli::run_command(String::from("new terminal"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "11" => {let (cli_thread_option, projects) = cli::run_command(String::from("inline terminal"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "12" => {let (cli_thread_option, projects) = cli::run_command(String::from("cobalt strike"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "13" => {let (cli_thread_option, projects) = cli::run_command(String::from("recreate distrobox"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "14" => {let (cli_thread_option, projects) = cli::run_command(String::from("generate userpass"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "15" => {let (cli_thread_option, projects) = cli::run_command(String::from("initail enum"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "16" => {let (cli_thread_option, projects) = cli::run_command(String::from("build attack notes"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "17" => {let (cli_thread_option, projects) = cli::run_command(String::from("host discovery"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "18" => {let (cli_thread_option, projects) = cli::run_command(String::from("port scan"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "19" => {let (cli_thread_option, projects) = cli::run_command(String::from("parse port scan"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "20" => {let (cli_thread_option, projects) = cli::run_command(String::from("stop boxes"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "21" => {let (cli_thread_option, projects) = cli::run_command(String::from("password spray"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "22" => {let (cli_thread_option, projects) = cli::run_command(String::from("bloodhound"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "23" => {let (cli_thread_option, projects) = cli::run_command(String::from("parse gather contacts"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "24" => {let (cli_thread_option, projects) = cli::run_command(String::from("prun distroboxes"), &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 cli_thread_option.is_some(){threads.push(cli_thread_option.unwrap());}}, - "25" => {let (cli_threads_option, projects) = cli::cli(true, &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 cli_threads_option.is_some(){for thread in cli_threads_option.unwrap(){threads.push(thread);}}}, - "26" => {project_controls::save_projects(&projects, &config_path); - let mut stop = String::new(); - println!("stop all boxes?\ny/n"); - std::io::stdin().read_line(&mut stop).unwrap(); - if stop.contains("y"){ - box_controls::stop_all_boxes(&projects); + 25.) enter external only menu + 26.) enter internal only menu + 27.) exit menu +\n", banner); + 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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "25" => {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)}}}, + "26" => {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)}}}, + "27" => loopize = false, + _ => println!("unknown selection, try again!"), + } + } + if threads.len() > 0{ + return Some(threads); + } + else{ + return None; + } + pub fn external_menu( + banner: &str, + projects: &mut Vec, + 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) -> Option>>{ + let mut loopize = true; + let mut threads = Vec::new(); + while loopize { + let _enter_to_clear = get_user_input("press enter to display external project menu."); + clear().expect("error clearing screen"); + print!(" + {} + NOTE OPTION 26 WILL SAVE YOUR PROJECTS BEFORE QUITTING + + + Main Menu: + 1 .) Show Active Project + 2 .) List Projects + 3 .) Switch Active Project + 4 .) create new project with Pyro's default layout + 5 .) Save Project Information + 6 .) Import New Project to Current projects list - and setup new Distrobox + 7 .) Remove Project + 8 .) Print upcoming projects + 9. ) promote project from upcoming to current + 10.) Open A New Terminal in Current Active Project + 11.) Open A Terminal In this windows for the current active project + 12.) re-create the distrobox for the current active project + 13.) generate userpass file from your obsidian notes + 14.) run pyro's initail enum script on a nessus csv for the current project + 15.) build external attack notes from host notes + 16.) Stop All Distroboxes + 17.) Password Spray (will print password to spray, and wait the obervation window time) + 18.) Parse GatherContacts output file + 19.) prune unused distroboxes (free up system storage) + 20.) exit menu + \n", banner); + 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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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("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("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("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("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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "20" => loopize = false, + _ => println!("unknown selection, try again!"), + } + } + if threads.len() > 0{ + return Some(threads); + } + else{ + return None; + } + } + + pub fn internal_menu( + banner: &str, + projects: &mut Vec, + 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) -> Option>>{ + let mut loopize = true; + let mut threads = Vec::new(); + while loopize { + let _enter_to_clear = get_user_input("press enter to display internal project menu."); + clear().expect("error clearing screen"); + print!(" + {} + NOTE OPTION 26 WILL SAVE YOUR PROJECTS BEFORE QUITTING + + + Main Menu: + 1 .) Show Active Project + 2 .) List Projects + 3 .) Switch Active Project + 4 .) create new project with Pyro's default layout + 5 .) Save Project Information + 6 .) Import New Project to Current projects list - and setup new Distrobox + 7 .) Remove Project + 8 .) Print upcoming projects + 9. ) promote project from upcoming to current + 10.) Open A New Terminal in Current Active Project + 11.) Open A Terminal In this windows for the current active project + 12.) open cobalt strike in the current project's distrobox + 13.) re-create the distrobox for the current active project + 14.) generate userpass file from your obsidian notes + 15.) print host discvoery command for internal pingsweep + 16.) print cobalt strike portscan command to include all in scope ranges + 17) parse a cobalt strike portscan CSV + 18.) Stop All Distroboxes + 19.) Password Spray (will print password to spray, and wait the obervation window time) + 20.) open bloodhound in the current project's distrobox + 21.) prune unused distroboxes (free up system storage) + 22.) exit menu + \n", banner); + 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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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());}}, + "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(), 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(), 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(), 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(), 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, + _ => println!("unknown selection, try again!"), } - loopize = false}, - _ => println!("uknonwn selection") - } - if loopize == false{ - break - } - println!("\n\n\npress enter to return to the menu"); - let mut enter = String::new(); - std::io::stdin().read_line(&mut enter).unwrap(); - } - println!("this will hang until all threads are finished."); - println!("make sure to close all programs opened with this menu, like cobalt strike or bloodhound."); - for thread in threads{ - thread.join().unwrap(); - } -} \ No newline at end of file + } + if threads.len() > 0{ + return Some(threads); + } + else{ + return None; + } + } +}