diff --git a/start_pentest/src/main.rs b/start_pentest/src/main.rs index ec0c08b..b44a79c 100644 --- a/start_pentest/src/main.rs +++ b/start_pentest/src/main.rs @@ -4,13 +4,25 @@ Purpose: To automate setting up my notes at the start of a pentest project Install Instructions: Change the "Pentest_notes" variable below to the directory you keep your pentest notes in. Then run cargo build to compile and copy the binary at ./target/debug/start_pentest to something like /usr/bin some special instructions for the file formats -the scope.txt file should be in the following format +the scope.txt file should be in the following formats + +EXTERNAL: host 3rd_party approval -example: + +INTERNAL: +network environment inscope? + +examples: +External: 192.168.1.1 no yes 192.168.1.2 yes no etc etc. +Internal: +192.168.1.0/24 servers yes +192.168.2.0/24 workstations yes +192.168.3.0/24 ICS no + */ use std::fs; use std::env; @@ -153,6 +165,7 @@ fn internal(project_folder_path: String, comapny_name: &String, project_name: &S let mut creds_notes = fs::File::create(format!("{}/creds.md", &loot_folder)).expect("error creating creds note"); let mut todo_notes = fs::File::create(format!("{}/todo.md", &project_folder_path)).expect("error creating todo notes"); let mut cleanup_notes = fs::File::create(format!("{}/cleanup.md", &project_folder_path)).expect("error creating cleanup notes"); + let mut password_spray = fs::File::create(format!("{}/password_spray.md", &project_folder_path)).expect("error creating password spray notes"); // for tagging notes let oyear = project_name.split("_").collect::>()[0]; let year = format!("year-{}", oyear); @@ -164,6 +177,7 @@ fn internal(project_folder_path: String, comapny_name: &String, project_name: &S writeln!(&mut todo_notes, "#{} #{} #{} #todo", comapny_name, project_type, year).expect("error writing tag line on todo"); writeln!(&mut finding_notes, "#{} #{} #{} #findings", comapny_name, project_type, year).expect("error writing tags line on findings"); writeln!(&mut systeminfo, "#{} #{} #{} #general", comapny_name, project_type, year).expect("error writing tag line for system info"); + writeln!(&mut systeminfo, "#{} #{} #{} #Password_sprays", comapny_name, project_type, year).expect("error writing tag line for password spraying"); writeln!(&mut netsta, "#{} #{} #{} #general", comapny_name, project_type, year).expect("error writing tagline in the netstat file"); writeln!(&mut creds_notes, "| System | username | password |").expect("error writing creds notes"); writeln!(&mut creds_notes, "| ------ | -------- | -------- |").expect("error writing creds notes"); @@ -270,12 +284,16 @@ powerup.ps1/sharpup.exe notes. ").expect("error writing to findings notes on internal"); write!(&mut todo_notes, " + - [ ] local checks - [ ] find shares - [ ] snaffle - [ ] bloodhound - [ ] admin or RDP? - [ ] certify +- [ ] portscan +- [ ] sql stuff +- [ ] passwords in AD Descriptions? - [ ] password spray ").expect("error writing todo list"); write!(&mut netsta," @@ -286,6 +304,29 @@ write!(&mut systeminfo," ``` ```").expect("error writing code block to system info"); +write!(&mut password_spray, " + +- [ ] useraspass +- [ ] Seasonyear! +- [ ] Seasonyear +- [ ] seasonyear! +- [ ] seasonyear +- [ ] {comapny_name}year! +- [ ] {company_name}year +- [ ] {comapny_name}foundingyear! +- [ ] {company_name}foundingyear +- [ ] {company_name}streetnumber! +- [ ] {company_name}streetnumber +- [ ] Password +- [ ] P@ssw0rd +- [ ] Password1! +- [ ] Passwordyear! +- [ ] P@55w0rd +- [ ] P@$$w0rd +- [ ] Service +- [ ] Service! +- [ ] Serviceyear! +", company_name=comapny_name).expect("error writing password spray check list"); } fn main() { @@ -322,16 +363,17 @@ start_pentest ./scope.txt victim_company_incorporated 2022_external_pentest if config_string.contains("folder_path") && config_string.contains("notes_path"){ let config_string_vec: Vec<&str> = config_string.split("\n").collect(); for line in config_string_vec{ - if line.contains("folder"){ + if line.contains("project_folder_path"){ let line_vec: Vec<&str> = line.split(":").collect(); project_files = line_vec[1].to_owned(); } - else if line.contains("notes"){ + else if line.contains("project_notes_path"){ let line_vec: Vec<&str> = line.split(":").collect(); pentest_notes = line_vec[1].to_owned(); } } } + println!("Project files path: {}\nProject Notes path: {}", project_files, pentest_notes); if args.len() == 4{ // the following two lines make the scope a vector let scope_content = fs::read_to_string(&args[1]).expect("Error reading scope file"); @@ -381,4 +423,4 @@ If this test is a common test and you would like a default note structure implem print!("{}", usage); } -} \ No newline at end of file +}