4 Commits

Author SHA1 Message Date
pyro57000
12e5ab38d2 bumped the version in the cargo.toml file 2025-04-22 12:46:23 -05:00
pyro57000
f2370e463d added help function to cli 2025-04-22 12:42:38 -05:00
pyro57000
92dd9766b8 refactored for CLI!!! 2025-04-22 12:10:45 -05:00
pyro57000
dbbae0eb4e added a function to parse your host notes and
generate the attack notes based off of them.
2025-04-16 17:28:39 -05:00
7 changed files with 298 additions and 90 deletions

View File

@@ -1241,7 +1241,7 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]] [[package]]
name = "pentest_tool" name = "pentest_tool"
version = "0.2.0" version = "3.1.1"
dependencies = [ dependencies = [
"chrono", "chrono",
"clearscreen", "clearscreen",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "pentest_tool" name = "pentest_tool"
version = "0.2.0" version = "3.1.1"
edition = "2021" edition = "2021"
[dependencies] [dependencies]

196
pentest_tool/src/cli.rs Normal file
View File

@@ -0,0 +1,196 @@
use std::path::PathBuf;
use std::process::exit;
use std::thread::JoinHandle;
use chrono::Datelike;
use clearscreen::clear;
use clearscreen;
use chrono::Local;
use crate::Project;
use crate::project_controls;
use crate::box_controls;
use crate::info_controls;
use crate::start_pentest;
use crate::get_user_input;
use crate::menu;
fn help(command: Option<String>){
if command.is_some(){
let help_cmd = command.unwrap();
match help_cmd.as_str(){
"list projects" | "lp" | "listp" | "list p" => {println!("list all projects"); return;},
"switch project" | "swp" | "switch p" | "switchp" => {println!("switch active project"); return;},
"show active project" | "show active" | "sa" | "show a" => {println!("show currently active project"); return;},
"create new project" | "cnp" | "new project" | "np" => {println!("create a new project and default note structure"); return;},
"save projects" | "sp" | "save" | "s" => {println!("save project information"); return;},
"import project" | "ip" | "import" => {println!("impot existing project"); return;},
"remove project" | "rp" | "remove" | "rmp" => {println!("remove project"); return;},
"show upcoming projects" | "sup" | "show upcoming" => {println!("show upcoming projects"); return;},
"promote project" | "pp" | "promote" => {println!("promote upcoming project to current project"); return;},
"new terminal" | "enter" | "enter terminal" | "nt" | "et" => {println!("spawn a new terminal window in the active project's distrobox"); return;},
"inline terminal" | "it" | "enter inline" | "ei" => {println!("spawn a terminal in this window using the current active project's distrobox"); return;},
"cobalt strike" | "cs" => {println!("open cobalt strike in the active project's distrobox"); return;},
"recreate distrobox" | "rdb" | "ndb" | "new distrobox" => {println!("recreate the active project's distrobox"); return;},
"generate userpass" | "userpass" | "gup" | "up" => {println!("generate userpass file based on the active project's notes"); return;},
"inital enum" | "ie" | "enum" => {println!("run the initial enum script on a nessus csv and save the output to the active project's notes"); return;},
"build attack notes" | "ban" | "attack notes" | "hn" => {println!("build the active project's attack note based on the active project's host notes (for external tests)"); return;},
"host discovery" | "build host discovery" | "hd" | "bhd" => {println!("print host discovery ping command for the active project, based on the scope table"); return;},
"port scan" | "cs port scan" | "cobaltstrike port scan" | "csps" | "ps" => {println!("print the cobalt strike portscan command based on the active project's scope table"); return;},
"parse port scan" | "pps" | "parse scan" => {println!("parse a cobalt strike portscan and save the files to the active project's files folder"); return;},
"stop boxes" | "stop distroboxes" | "sdb" => {println!("stop all distroboxes"); return;},
"password spray" | "pass spray" | "pas" => {println!("iterate through password spray note file and print the command to perform the spray, waiting the proper observation window beteen commands"); return;},
"bloodhound" | "bh" => {println!("launch bloodhound in the active project's distrobox"); return;},
"parse gather contacts" | "pgc" | "parse contacts" | "pc" => {println!("parse gather contacts output"); return;},
"prune distroboxes" | "pdb" | "prune" => {println!("prune distroboxes for all projects that are not being tracked by this tool (frees up system storage)"); return;},
_ => ()
}
}
println!("Welcom to Pyro's pentest command line!");
println!("available commands: name | aliases | ...");
print!("
list projects | lp | listp | list p
switch project | sp | switch p | switchp
show active project | show active | sa | show a
create new project | cnp | new project | np
save projects | sp | save | s
import project | ip | import
remove project | rp | remove | rmp
show upcoming project | sup | show upcoming
promote project | pp | promote
new terminal | enter | enter terminal | nt | et
inline terminal | it | enter inline | ei
cobalt strike | cs
recreate distrobox | rdb | ndb | new distrobox
generate userpass | userpass | gup | up
inital enum | ie | enum
host discovery | build host discovery | hd | bhd
port scan | cs port scan | cobaltstrike port scan | csps | ps
parse port scan | pps | parse scan
stop boxes | stop distroboxes | sdb
password spray | pass spray | pas
bloodhound | bh
parse gather contacts | pgc | parse contacts | pc
prune distroboxes | pdb | prune
help | ? | -h
")
}
pub fn run_command(cmd: String,
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) -> Option<JoinHandle<()>> {
let mut new_id = menu::next_project_id(&config_path);
let active_project = menu::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::<Vec<&str>>(){
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)}
}
if cmd.contains("help"){
if cmd.contains(" "){
let help_with = &cmd.split(" ").collect::<Vec<&str>>()[1].to_owned();
help(Some(help_with.to_owned()));
}
else{
help(None);
}
return None;
}
match cmd.as_str(){
"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.clone()); 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},
"prune distroboxes" | "pdb" | "prune" => {let prune_thread = box_controls::clean_unused_boxes(&projects, &boxtemplate); return prune_thread},
_ => {println!("unknown command."); return None;}
}
}
pub fn cli(interactive: bool,
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) -> Option<Vec<JoinHandle<()>>>{
let mut threads = Vec::new();
if interactive{
let mut loopize = true;
while loopize{
let command = get_user_input("command?");
match command.as_str(){
"exit" | "main menu" | "mm" | "menu" => loopize = false,
_ => {let thread_option = run_command(command, projects.clone(), 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())}},
}
}
}
if threads.len() > 0{
return Some(threads);
}
else {
return None;
}
}

View File

@@ -105,67 +105,75 @@ pub fn run_initial_enum(project: &Project){
} }
pub fn build_external_attack_notes(project: &Project){ pub fn build_external_attack_notes(project: &Project){
#[derive(Clone)] #[derive(Clone)]
struct Port{ struct Port{
number: String, service: String,
hosts: Vec<String>, hosts: Vec<String>
} }
let mut ports: Vec<Port> = Vec::new(); let mut ports: Vec<Port> = Vec::new();
let mut host_notes_path = project.notes_folder.clone(); let mut host_notes_path = project.notes_folder.clone();
let mut attack_notes_path = host_notes_path.clone();
host_notes_path.push("host_notes.md"); host_notes_path.push("host_notes.md");
let mut attack_notes_path = project.notes_folder.clone();
attack_notes_path.push("attacks.md"); attack_notes_path.push("attacks.md");
let host_notes_read_res = fs::read_to_string(host_notes_path); let host_notes_read_res = fs::read_to_string(host_notes_path);
if host_notes_read_res.is_err(){ if host_notes_read_res.is_err(){
let error = host_notes_read_res.err().unwrap(); let error = host_notes_read_res.err().unwrap();
println!("error reading host notes!"); println!("error reading host notes");
println!("{}", error); println!("{}", error);
return; return;
} }
let host_notes = host_notes_read_res.unwrap(); let host_notes_string = host_notes_read_res.unwrap();
let attack_open_res = fs::OpenOptions::new().append(true).create(true).open(attack_notes_path); let host_parts: Vec<&str> = host_notes_string.split("---").collect();
if attack_open_res.is_err(){ let mut host = String::new();
let error = attack_open_res.err().unwrap(); for part in host_parts{
println!("error opening attack notes!"); let lines: Vec<&str> = part.split("\n").collect();
println!("{}", error); for line in lines{
return;
}
let attack_notes = attack_open_res.unwrap();
for line in host_notes.split("\n").collect::<Vec<&str>>(){
let mut current_host = String::new();
if line.len() > 1{
if line.contains("# "){ if line.contains("# "){
if !line.contains("## "){ if !line.contains("## "){
current_host = line.split_whitespace().collect::<Vec<&str>>()[1].trim().to_owned(); host = line.split("# ").collect::<Vec<&str>>()[1].to_owned();
} }
} }
if line.contains("|"){ if line.contains("|"){
let table_data:Vec <&str> = line.split("|").collect(); if line.contains(":"){
for item in table_data{ let entries: Vec<&str> = line.split("|").collect();
let mut is_new = true; let service = entries[2].trim().to_owned();
if item.contains(":"){ for entry in entries{
if entry.contains(":"){
let port_number = entry.trim().to_owned();
let mut new = true;
for port in &mut ports{ for port in &mut ports{
if port.number == item.trim(){ if port.service == service{
if port.hosts.contains(&current_host){ new = false;
port.hosts.push(current_host.clone()); let host_entry = format!("{} {}", host.clone(), port_number.clone());
} port.hosts.push(host_entry);
is_new = false;
} }
} }
if is_new{ match new{
let new_port = Port{number: line.trim().to_owned(), hosts:vec![current_host.clone()]}; true => {let new_port = Port{service: service.clone(), hosts: vec![format!("{} {}", host.clone(), port_number.clone())]}; ports.push(new_port);},
false => ()
} }
} }
} }
} }
} }
} }
for port in ports{ println!("{} parsed!", host);
let output = format!("# {}\nHOSTS:\n", port.number); }
println!("parsed host_notes.md, writing to attacks.md...");
let attack_open_res = open_append(&attack_notes_path);
if attack_open_res.is_none(){
println!("ooof error opening attack notes, returning...");
return;
}
let mut attack_file = attack_open_res.unwrap();
write!(attack_file, "\n---\n").expect("since we used the open options already this should never fail.");
for port in ports.clone(){
write!(attack_file, "# {}\n", port.service).expect("since we used the open options already this should never fail.");
write!(attack_file, "HOSTS:\n").expect("since we used the open options already this should never fail.");
for host in port.hosts{ for host in port.hosts{
// output.push_str("## {}"); write!(attack_file, "## {}\n\n", host).expect("since we used the open options already this should never fail.");
write!(attack_file, "\n---\n").expect("since we used the open options already this should never fail.");
} }
} }
} }

View File

@@ -22,6 +22,7 @@ mod project_controls;
mod box_controls; mod box_controls;
mod info_controls; mod info_controls;
mod start_pentest; mod start_pentest;
mod cli;
pub fn open_overwrite(path: &PathBuf) -> Option<File>{ pub fn open_overwrite(path: &PathBuf) -> Option<File>{
let file_create_res = fs::OpenOptions::new().create(true).write(true).open(path); let file_create_res = fs::OpenOptions::new().create(true).write(true).open(path);
@@ -158,7 +159,7 @@ fn main() {
upcoming project notes: {} upcoming project notes: {}
", &project_base_folder.display(), &project_base_notes.display(), &tools_folder.display(), box_template, terminal_command, cracking_rig, &upcoming_files.display(), &upcoming_notes.display()); ", &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..."); println!("loading project configs...");
let projects = project_controls::get_projects(&config_path); let projects = project_controls::get_projects(&config_path, true);
println!("Enter to start main menu"); println!("Enter to start main menu");
let mut enter = String::new(); let mut enter = String::new();
std::io::stdin().read_line(&mut enter).unwrap(); std::io::stdin().read_line(&mut enter).unwrap();

View File

@@ -9,9 +9,10 @@ use crate::project_controls;
use crate::box_controls; use crate::box_controls;
use crate::info_controls; use crate::info_controls;
use crate::start_pentest; use crate::start_pentest;
use crate::cli;
fn next_project_id(config_path: &PathBuf) -> i32{ pub fn next_project_id(config_path: &PathBuf) -> i32{
let projects = project_controls::get_projects(config_path); let projects = project_controls::get_projects(config_path, false);
let mut new_id = 0; let mut new_id = 0;
for project in projects.clone(){ for project in projects.clone(){
if project.id > new_id{ if project.id > new_id{
@@ -21,7 +22,7 @@ fn next_project_id(config_path: &PathBuf) -> i32{
return new_id; return new_id;
} }
fn get_active_project(projects: &Vec<Project>) -> &Project{ pub fn get_active_project(projects: &Vec<Project>) -> &Project{
let mut active_project = &projects[0]; let mut active_project = &projects[0];
for project in projects{ for project in projects{
if project.active == true{ if project.active == true{
@@ -113,7 +114,7 @@ pub fn main_menu(mut projects: Vec<Project>, config_path: PathBuf, base_files: &
NOTE OPTION 28 WILL SAVE YOUR PROJECTS BEFORE QUITTING NOTE OPTION 29 WILL SAVE YOUR PROJECTS BEFORE QUITTING
base prject folder: {} base prject folder: {}
upcoming project folder: {} upcoming project folder: {}
@@ -140,56 +141,49 @@ General Notes: {}
11.) Open A Terminal In this windows for the current active project 11.) Open A Terminal In this windows for the current active project
12.) open current project's cobalt strike 12.) open current project's cobalt strike
13.) re-create the distrobox for the current active project 13.) re-create the distrobox for the current active project
14.) Open Project Files Folder In Dolphin 14.) generate userpass file from your obsidian notes
15.) Open Project Notes Folder In Dolphin 15.) run pyro's initail enum script on a nessus csv for the current project
16.) generate userpass file from your obsidian notes 16.) build external attack notes from host notes
17.) run pyro's initail enum script on a nessus csv for the current project 17.) Build host discovery cmd command from scope in notes
18.) Print Project Info For Report 18.) build portscan command from scope in notes
19.) Build host discovery cmd command from scope in notes 19.) parse a cs portscan services.tsv file
20.) build portscan command from scope in notes 20.) Stop All Distroboxes
21.) parse a cs portscan services.tsv file 21.) Password Spray (will print password to spray, and wait the obervation window time)
22.) Stop All Distroboxes 22.) Launch bloodhound with the current project's distrobox
23.) Password Spray (will print password to spray, and wait the obervation window time) 23.) Parse GatherContacts output file
24.) crack password hashes on your cracking rig 24.) prune unused distroboxes (free up system storage)
25.) Launch bloodhound with the current project's distrobox 25.) enter cli
26.) Parse GatherContacts output file 26.) Quit Application
27.) prune unused distroboxes (free up system storage)
28.) 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); \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"); std::io::stdin().read_line(&mut response).expect("error getting menu input");
clear().expect("error clearing screen"); clear().expect("error clearing screen");
match response.as_str().trim_end(){ match response.as_str().trim_end(){
"1" => 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()), "1" => {let cli_thread_option = cli::run_command(String::from("show active project"), projects.clone(), 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" => {println!("+++++++++++++++++++++"); "2" => {let cli_thread_option = cli::run_command(String::from("list projects"), projects.clone(), 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());}},
for project in &projects{ "3" => {let cli_thread_option = cli::run_command(String::from("switch project"), projects.clone(), 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());}},
println!("++Customer: {}|Project name: {}|Stage: {}++",project.customer ,project.project_name, project.stage)} "4" => {let cli_thread_option = cli::run_command(String::from("new project"), projects.clone(), 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());}},
println!("++++++++++++++++++++")}, "5" => {let cli_thread_option = cli::run_command(String::from("save projects"), projects.clone(), 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" => project_controls::switch_project(&mut projects), "6" => {let cli_thread_option = cli::run_command(String::from("import projects"), projects.clone(), 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" => {new_id = new_id + 1; start_pentest::start_pentest(&config_path, &mut projects, new_id, upcoming_files, upcoming_notes, &boxtemplate, password_spray_file)}, "7" => {let cli_thread_option = cli::run_command(String::from("remove project"), projects.clone(), 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" => project_controls::save_projects(&projects, &config_path), "8" => {let cli_thread_option = cli::run_command(String::from("show upcoming projects"), projects.clone(), 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" => {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)}, "9" => {let cli_thread_option = cli::run_command(String::from("promote project"), projects.clone(), 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" => project_controls::remove_project(&mut projects, &config_path), "10" => {let cli_thread_option = cli::run_command(String::from("new terminal"), projects.clone(), 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" => project_controls::print_upcoming_projects(&projects), "11" => {let cli_thread_option = cli::run_command(String::from("inline terminal"), projects.clone(), 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" => project_controls::promote_project(&mut projects, &config_path, base_files, base_notes, tools_dir, &boxtemplate, fingerprint), "12" => {let cli_thread_option = cli::run_command(String::from("cobalt strike"), projects.clone(), 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" => box_controls::project_standalone_terminal(active_project.clone(), terminal.clone()), "13" => {let cli_thread_option = cli::run_command(String::from("recreate distrobox"), projects.clone(), 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" => box_controls::project_inline_terminal(active_project.clone()), "14" => {let cli_thread_option = cli::run_command(String::from("generate userpass"), projects.clone(), 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 cs_thread = box_controls::launch_cobalt_strike(active_project.clone()); if cs_thread.is_some(){threads.push(cs_thread.unwrap());}}, "15" => {let cli_thread_option = cli::run_command(String::from("initail enum"), projects.clone(), 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" => box_controls::make_box(&active_project, &tools_dir, &boxtemplate, false, fingerprint), "16" => {let cli_thread_option = cli::run_command(String::from("build attack notes"), projects.clone(), 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" => info_controls::open_in_dolphin("files", active_project.clone()), "17" => {let cli_thread_option = cli::run_command(String::from("host discovery"), projects.clone(), 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" => info_controls::open_in_dolphin("notes", active_project.clone()), "18" => {let cli_thread_option = cli::run_command(String::from("port scan"), projects.clone(), 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" => info_controls::generate_userpass(&active_project), "19" => {let cli_thread_option = cli::run_command(String::from("parse port scan"), projects.clone(), 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" => info_controls::run_initial_enum(&active_project), "20" => {let cli_thread_option = cli::run_command(String::from("stop boxes"), projects.clone(), 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" => info_controls::print_report_information(active_project.clone()), "21" => {let cli_thread_option = cli::run_command(String::from("password spray"), projects.clone(), 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" => info_controls::build_cmd_for_host_discovery(&active_project), "22" => {let cli_thread_option = cli::run_command(String::from("bloodhound"), projects.clone(), 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" => info_controls::build_cs_portscan_cmd(&active_project), "23" => {let cli_thread_option = cli::run_command(String::from("parse gather contacts"), projects.clone(), 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" => info_controls::parse_csportscan(&active_project), "24" => {let cli_thread_option = cli::run_command(String::from("prun distroboxes"), projects.clone(), 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" => box_controls::stop_all_boxes(&projects), "25" => {let cli_threads_option = cli::cli(true, projects.clone(), 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);}}},
"23" => info_controls::password_spray_help(&active_project, season, lseason, year, &tools_dir, &config_path), "26" => {project_controls::save_projects(&projects, &config_path);
"24" => info_controls::crack_hashes(&cracking_rig, &active_project, &terminal, &rockyou, &rule),
"25" => {let bloodhound_handle = box_controls::launch_bloodhound_gui(active_project.clone()).unwrap(); threads.push(bloodhound_handle);},
"26" => info_controls::partse_gathercontacts(&active_project),
"27" => {let prune_thread = box_controls::clean_unused_boxes(&projects, &boxtemplate); if prune_thread.is_some(){threads.push(prune_thread.unwrap());}},
"28" => {project_controls::save_projects(&projects, &config_path);
let mut stop = String::new(); let mut stop = String::new();
println!("stop all boxes?\ny/n"); println!("stop all boxes?\ny/n");
std::io::stdin().read_line(&mut stop).unwrap(); std::io::stdin().read_line(&mut stop).unwrap();

View File

@@ -289,7 +289,7 @@ pub fn remove_project(projects: &mut Vec<Project>, config_path: &PathBuf){
} }
} }
pub fn get_projects(config_path: &PathBuf) -> Vec<Project>{ pub fn get_projects(config_path: &PathBuf, show: bool) -> Vec<Project>{
let mut mut_config_path = config_path.clone(); let mut mut_config_path = config_path.clone();
mut_config_path.pop(); mut_config_path.pop();
mut_config_path.push("projects.conf"); mut_config_path.push("projects.conf");
@@ -326,7 +326,9 @@ pub fn get_projects(config_path: &PathBuf) -> Vec<Project>{
} }
let project_stage = settings[6].to_owned(); let project_stage = settings[6].to_owned();
let new_project = Project{customer: customer, project_name: project, files_folder: project_folder, notes_folder: notes_folder, active: active, id: first, boxname: boxname, stage: project_stage}; let new_project = Project{customer: customer, project_name: project, files_folder: project_folder, notes_folder: notes_folder, active: active, id: first, boxname: boxname, stage: project_stage};
if show{
println!("{} {} LOADED!", &new_project.customer, &new_project.project_name); println!("{} {} LOADED!", &new_project.customer, &new_project.project_name);
}
projects.push(new_project); projects.push(new_project);
} }
} }
@@ -444,3 +446,10 @@ pub fn promote_project(projects: &mut Vec<Project>, config_path: &PathBuf, proje
projects.append(&mut projects_to_save); projects.append(&mut projects_to_save);
save_projects(&projects_to_save, config_path); save_projects(&projects_to_save, config_path);
} }
pub fn list_projects(projects: &Vec<Project>){
println!("+++++++++++++++++++++");
for project in projects{
println!("++Customer: {}|Project name: {}|Stage: {}++",project.customer ,project.project_name, project.stage)}
println!("++++++++++++++++++++")
}