diff --git a/pentest_tool/src/cli.rs b/pentest_tool/src/cli.rs index d57dad1..96cb2b3 100644 --- a/pentest_tool/src/cli.rs +++ b/pentest_tool/src/cli.rs @@ -15,10 +15,39 @@ use crate::menu; fn help(command: Option){ - if command.is_none(){ - println!("Welcom to Pyro's pentest command line!"); - println!("available commands: name | aliases | ..."); - print!(" + 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 @@ -44,7 +73,6 @@ parse gather contacts | pgc | parse contacts | pc prune distroboxes | pdb | prune help | ? | -h ") - } } pub fn run_command(cmd: String, @@ -93,6 +121,16 @@ pub fn run_command(cmd: String, 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::>()[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},