7 Commits
2.1.5 ... 2.1.7

Author SHA1 Message Date
pyro57000
a798e39461 did the distrobox stuff 2025-02-20 13:09:12 -06:00
pyro57000
4e1ab4c30f split making a distrobox into its own function
this will allow us to write more functions
like the newly added one to re-create the
current project's distrobox
2025-02-20 13:08:20 -06:00
pyro57000
ac037a15a9 fixed the start_pentest function 2025-02-13 14:14:00 -06:00
Pyro57000
345124baf1 Update README.md 2025-01-21 10:57:15 -06:00
Pyro57000
a9a451a8cf Update ToDo.md 2025-01-21 10:52:12 -06:00
Pyro57000
7081280247 Update ToDo.md 2025-01-21 10:51:57 -06:00
Pyro57000
2d97e81920 Create ToDo.md 2025-01-21 10:51:28 -06:00
8 changed files with 129 additions and 77 deletions

View File

@@ -75,7 +75,8 @@ Once the project is done and I'm ready to clean up the distrobox I use option 7
1. clone this repository `git clone https://github.com/Pyro57000/pentest_tool.git`
2. cd into the nested "pentest_tool" folder `cd pentest_tool/pentest_tool`
3. use cargo to build the release binary `cargo build --release`
4. follow the same installation instructions, skipping the step where you download the release binary.
4. copy the compiled binary to a folder on your path `sudo cp ./target/release/pentest_tool /usr/bin/`
5. follow the same installation instructions, skipping the step where you download the release binary.

25
ToDo.md Normal file
View File

@@ -0,0 +1,25 @@
# planned features
1.) finish hash cracking with a dedictated cracking rig code.
2.) cracte hash cracking with current computer code.
3.) adapt new project code to searh the upcomming folder before prompting for a path.
4.) create code that moves projects to a "writing" state and folder.
5.) create code that tracks "current, upcomming, and writing" states, maybe automatic zipping of folders after writing is done?
# Unplanned, but would be cool
1.) create a "server" and "Client" infrastructure that can help manage the distrobox clients and the main server
2.) maybe expand this server client model to interact with cracking rigs and what not.
3.) implment a function to searchsploit and copy wanted exploits to the project folder.
4.) implement a function to execute those copied exploits.
# NOTE
if you wish to contribute, please do! just fix a bug or implement any of the above features and make a pull request!!
I'll keep plugging away as I have time throughout my days as well.

View File

@@ -1,4 +1,11 @@
use std::process;
use std::{path::PathBuf, process};
use std::env;
use std::fs;
use std::io::stdin;
use std::io::Write;
use std::thread;
use std::time::Duration;
use std::str::FromStr;
use crate::Project;
pub fn stop_all_boxes(projects: &Vec<Project>){
@@ -63,3 +70,69 @@ pub fn project_standalone_terminal(project: Project, mut terminal: String){
pub fn project_inline_terminal(project: Project){
process::Command::new("distrobox").arg("enter").arg("--root").arg(project.boxname).arg("--").arg("script").arg("-a").arg("-B").arg("/pentest/working/terminal.log").status().expect("error opeing konsole");
}
pub fn make_box(project: &Project, tools_dir: &PathBuf, boxtemplate: &String, new: bool){
if !new{
let _distrobox_stop_status = process::Command::new("distrobox").arg("stop").arg("--root").arg(&project.boxname).status().expect("error stopping distrobox");
let distrobox_rm_status = process::Command::new("distrobox-rm")
.arg("--root")
.arg("-f")
.arg(&project.boxname)
.status().expect("error calling distrobox");
if distrobox_rm_status.success(){
println!("Distrobox Removal Successful!!!");
}
else{
println!("Distrobox Removal Failed, manual removal required!");
}
}
let mut box_name_path = project.files_folder.clone();
let mut box_name = format!("atarchbox_{}", &project.customer);
box_name_path.push("boxname");
let mut box_name_file = fs::File::create(box_name_path).expect("Error creating box name file");
box_name_file.write_all(&box_name.as_bytes()).expect("error writing boxname to box file");
let pentest_volume = format!("{}:/pentest:rw", &project.files_folder.display());
let toold_volume = format!("{}:/tools:rw", tools_dir.display());
println!("distrobox create --root --clone {} --volume {} --volume {} --name {}", boxtemplate, toold_volume, pentest_volume, box_name);
let distrobox_result = process::Command::new("distrobox")
.arg("create")
.arg("--root")
.arg("--clone")
.arg(boxtemplate)
.arg("--volume")
.arg(&toold_volume)
.arg("--volume")
.arg(&pentest_volume)
.arg("--name")
.arg(&box_name)
.status()
.expect("error getting distrobox status");
if distrobox_result.success(){
println!("we made a distrobox oh boy!");
let distrobox_start_result = process::Command::new("distrobox")
.arg("enter")
.arg("--root")
.arg(&box_name)
.arg("--")
.arg("sudo")
.arg("-s")
.arg("ln")
.arg("-sf")
.arg("/pentest/boxname")
.arg("/etc/boxname")
.status()
.expect("error getting response from distrobox start");
if distrobox_start_result.success(){
println!("distrobox was started as well!!!! good job me!");
}
else{
println!("ooof did not start successfully try entering it yoruself");
println!("distrobox enter --rrot {} -- sudo -s ln -sf /pentest/boxname /etc/boxname", &box_name);
}
}
else{
println!("ooof distrobox did not work.... try creating it yourself");
println!("distrobox create --root --clone {} --volume {} --volume {} --name {}", boxtemplate, &toold_volume, &pentest_volume, &box_name);
println!("distrobox enter --rrot {} -- sudo -s ln -sf /pentest/boxname /etc/boxname", &box_name);
}
}

View File

@@ -1,14 +1,10 @@
use core::hash;
use std::fs;
use std::fs::read_to_string;
use std::io::BufReader;
use std::io::Read;
use std::io::Write;
use std::path::PathBuf;
use std::process;
use std::result;
use std::thread;
use std::thread::spawn;
use std::time::Duration;
use std::io::stdin;
use walkdir::WalkDir;

View File

@@ -69,7 +69,7 @@ fn main() {
"box_template" => box_template = setting_vec[1].trim_end().to_owned(),
"terminal" => terminal_command = setting_vec[1].trim_end().to_owned(),
"cracking_rig" => cracking_rig = setting_vec[1].trim_end().to_owned(),
"rockyou_location" => rockyou = setting_vec[1].trim_ascii_end().to_owned(),
"rockyou_location" => rockyou = setting_vec[1].trim_end().to_owned(),
"rule_location" => rule = setting_vec[1].trim_end().to_owned(),
_ => println!("error unknown setting: {}", setting_vec[0])
}

View File

@@ -117,17 +117,18 @@ Year: {}
7 .) Remove Project
8 .) Open A New Terminal in Current Active Project
9 .) Open A Terminal In this windows for the current active project
10.) Open Project Files Folder In Dolphin
11.) Open Project Notes Folder In Dolphin
12.) generate userpass file from your obsidian notes
13.) run pyro's initail enum script on a nessus csv for the current project
14.) Print Project Info For Report
15.) Build host discovery cmd command from scope in notes
16.) build portscan command from scope in notes
17.) Stop All Distroboxes
18.) Password Spray (will print password to spray, and wait the obervation window time)
19.) crack password hashes on your cracking rig
20.) Quit Application
10.) re-create the distrobox for the current active project
11.) Open Project Files Folder In Dolphin
12.) Open Project Notes Folder In Dolphin
13.) generate userpass file from your obsidian notes
14.) run pyro's initail enum script on a nessus csv for the current project
15.) Print Project Info For Report
16.) Build host discovery cmd command from scope in notes
17.) build portscan command from scope in notes
18.) Stop All Distroboxes
19.) Password Spray (will print password to spray, and wait the obervation window time)
20.) crack password hashes on your cracking rig
21.) Quit Application
\n", active_project.customer, active_project.project_name, active_project.files_folder.display(), active_project.notes_folder.display(), active_project.boxname, terminal, season, year);
std::io::stdin().read_line(&mut response).expect("error getting menu input");
clear().expect("error clearing screen");
@@ -144,17 +145,18 @@ Year: {}
"7" => project_controls::remove_project(&mut projects, &config_path),
"8" => box_controls::project_standalone_terminal(active_project.clone(), terminal.clone()),
"9" => box_controls::project_inline_terminal(active_project.clone()),
"10" => info_controls::open_in_dolphin("files", active_project.clone()),
"11" => info_controls::open_in_dolphin("notes", active_project.clone()),
"12" => info_controls::generate_userpass(&active_project),
"13" => info_controls::run_initial_enum(&active_project),
"14" =>info_controls::print_report_information(active_project.clone()),
"15" => info_controls::build_cmd_for_host_discovery(&active_project),
"16" => info_controls::build_cs_portscan_cmd(&active_project),
"17" => box_controls::stop_all_boxes(&projects),
"18" => info_controls::password_spray_help(&active_project, season, lseason, year, &tools_dir, &config_path),
"19" => info_controls::crack_hashes(&cracking_rig, &active_project, &terminal, &rockyou, &rule),
"20" => {project_controls::save_projects(&projects, &config_path);
"10" => box_controls::make_box(&active_project, &tools_dir, &boxtemplate, false),
"11" => info_controls::open_in_dolphin("files", active_project.clone()),
"12" => info_controls::open_in_dolphin("notes", active_project.clone()),
"13" => info_controls::generate_userpass(&active_project),
"14" => info_controls::run_initial_enum(&active_project),
"15" =>info_controls::print_report_information(active_project.clone()),
"16" => info_controls::build_cmd_for_host_discovery(&active_project),
"17" => info_controls::build_cs_portscan_cmd(&active_project),
"18" => box_controls::stop_all_boxes(&projects),
"19" => info_controls::password_spray_help(&active_project, season, lseason, year, &tools_dir, &config_path),
"20" => info_controls::crack_hashes(&cracking_rig, &active_project, &terminal, &rockyou, &rule),
"21" => {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();

View File

@@ -8,6 +8,7 @@ use std::thread;
use std::time::Duration;
use std::str::FromStr;
use crate::Project;
use crate::box_controls::make_box;
pub fn switch_project(projects: &mut Vec<Project>){
for project in projects.clone(){
@@ -183,54 +184,6 @@ pub fn new_project(projects: &mut Vec<Project>, project_dir: &PathBuf, notes_dir
}
thread::sleep(Duration::from_secs(2));
let box_name = format!("atarchbox_{}", customer_name);
let mut box_name_path = new_project_dir.clone();
box_name_path.push("boxname");
let mut box_name_file = fs::File::create(box_name_path).expect("Error creating box name file");
box_name_file.write_all(&box_name.as_bytes()).expect("error writing boxname to box file");
let pentest_volume = format!("{}:/pentest:rw", new_project_dir.display());
let toold_volume = format!("{}:/tools:rw", tools_dir.display());
println!("distrobox create --root --clone {} --volume {} --volume {} --name {}", boxtemplate, toold_volume, pentest_volume, box_name);
let distrobox_result = process::Command::new("distrobox")
.arg("create")
.arg("--root")
.arg("--clone")
.arg(boxtemplate)
.arg("--volume")
.arg(&toold_volume)
.arg("--volume")
.arg(&pentest_volume)
.arg("--name")
.arg(&box_name)
.status()
.expect("error getting distrobox status");
if distrobox_result.success(){
println!("we made a distrobox oh boy!");
let distrobox_start_result = process::Command::new("distrobox")
.arg("enter")
.arg("--root")
.arg(&box_name)
.arg("--")
.arg("sudo")
.arg("-s")
.arg("ln")
.arg("-sf")
.arg("/pentest/boxname")
.arg("/etc/boxname")
.status()
.expect("error getting response from distrobox start");
if distrobox_start_result.success(){
println!("distrobox was started as well!!!! good job me!");
}
else{
println!("ooof did not start successfully try entering it yoruself");
println!("distrobox enter --rrot {} -- sudo -s ln -sf /pentest/boxname /etc/boxname", &box_name);
}
}
else{
println!("ooof distrobox did not work.... try creating it yourself");
println!("distrobox create --root --clone {} --volume {} --volume {} --name {}", boxtemplate, &toold_volume, &pentest_volume, &box_name);
println!("distrobox enter --rrot {} -- sudo -s ln -sf /pentest/boxname /etc/boxname", &box_name);
}
let new_project = Project{customer: customer_name.trim_end().to_owned(),
project_name: project_name.trim_end().to_owned(),
notes_folder: new_note_dir,
@@ -239,6 +192,7 @@ pub fn new_project(projects: &mut Vec<Project>, project_dir: &PathBuf, notes_dir
id: new_id,
boxname: box_name,
};
make_box(&new_project, &tools_dir, &boxtemplate, true);
projects.push(new_project);
save_projects(projects, config_path);

View File

@@ -247,6 +247,7 @@ pub fn start_pentest(config_path: &PathBuf) {
let mut company_name = String::new();
let mut project_name = String::new();
let mut config_file_path_buf = config_path.clone();
config_file_path_buf.pop();
let mut passpray_path = config_file_path_buf.clone();
passpray_path.push("passwordspray.md");
config_file_path_buf.push("new_projects.conf");