Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f99e395241 | ||
|
|
0cbe33357a | ||
|
|
4bd67a486f |
@@ -42,6 +42,7 @@ fn help(command: Option<String>){
|
||||
"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;},
|
||||
"clear" | "clear screen" | "cls" => {println!("clears the screen of command output"); return},
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
@@ -71,6 +72,7 @@ password spray | pass spray | pas
|
||||
bloodhound | bh
|
||||
parse gather contacts | pgc | parse contacts | pc
|
||||
prune distroboxes | pdb | prune
|
||||
clear | clear screen | cls
|
||||
help | ? | -h
|
||||
")
|
||||
}
|
||||
@@ -133,7 +135,7 @@ pub fn run_command(cmd: String,
|
||||
}
|
||||
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},
|
||||
"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},
|
||||
@@ -156,6 +158,7 @@ pub fn run_command(cmd: String,
|
||||
"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},
|
||||
"clear" | "clear screen" | "cls" => {clear().unwrap(); return None},
|
||||
_ => {println!("unknown command."); return None;}
|
||||
}
|
||||
}
|
||||
@@ -177,9 +180,20 @@ pub fn cli(interactive: bool,
|
||||
fingerprint: bool,
|
||||
vault_name: String) -> Option<Vec<JoinHandle<()>>>{
|
||||
let mut threads = Vec::new();
|
||||
let active_project = menu::get_active_project(&projects);
|
||||
if interactive{
|
||||
let mut loopize = true;
|
||||
while loopize{
|
||||
print!("
|
||||
Active Project: {}, {}
|
||||
Project Status: {}
|
||||
Files Folder: {}
|
||||
Notes Folder: {}
|
||||
Boxname: {}
|
||||
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,
|
||||
|
||||
@@ -1165,3 +1165,56 @@ pub fn parse_csportscan(project: &Project){
|
||||
println!("DONE all files saved to {}", outfile.display());
|
||||
println!("note if no hosts were found for a protocol their files will be empty.");
|
||||
}
|
||||
|
||||
/*fn get_scope(general: &PathBuf){
|
||||
println!("opening general notes...");
|
||||
let mut working = general.clone();
|
||||
working.push("general.md");
|
||||
let working_read = fs::read_to_string(working);
|
||||
if working_read.is_err(){
|
||||
let error = working_read.err().unwrap();
|
||||
println!("error reading general notes file!");
|
||||
println!("{}", error);
|
||||
return
|
||||
}
|
||||
let general_string = working_read.unwrap();
|
||||
println!("reading scop from general notes...");
|
||||
let mut scope_ranges = Vec::new();
|
||||
let general_lines: Vec<&str> = general_string.split("\n").collect();
|
||||
for line in general_lines{
|
||||
if line.contains("|"){
|
||||
if !line.contains("range"){
|
||||
if !line.contains("--"){
|
||||
let items: Vec<&str> = line.split("|").collect();
|
||||
let scop_item = items[1].trim();
|
||||
println!("{} LOADED!!", scop_item);
|
||||
scope_ranges.push(scop_item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
println!("scope loaded, parsing ip ranges...");
|
||||
let mut ips = Vec::new();
|
||||
for item in scope_ranges{
|
||||
if item.contains("/"){
|
||||
let network_split: Vec<&str> = item.split("/").collect();
|
||||
let network_part = network_split[0];
|
||||
let cidr = network_split[1];
|
||||
let network_octets: Vec<&str> = network_part.split(".").collect();
|
||||
let mut ip = String::new();
|
||||
match cidr{
|
||||
"24" => {let partial_ip = format!("{}.{}.{}.N", network_octets[0], network_octets[1], network_octets[2]);
|
||||
ip.push_str(partial_ip);
|
||||
},
|
||||
"16" => {let partial_ip = format!("{}.{}.N.N", network_octets[0], network_octets[1]);
|
||||
ip.push_str(partial_ip);},
|
||||
"8" => {let partial_ip = format!("{}.N.N.N", network_octets[0]); ip.push_str(partial_ip)}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
pub fn get_all_host_addresses(project: &Project){
|
||||
println!("to do");
|
||||
}
|
||||
@@ -33,7 +33,7 @@ pub fn switch_project(projects: &mut Vec<Project>){
|
||||
project.active = false;
|
||||
}
|
||||
else{
|
||||
println!("error unknown project id")
|
||||
println!("error unknown project id");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user