Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a798e39461 | ||
|
|
4e1ab4c30f | ||
|
|
ac037a15a9 | ||
|
|
345124baf1 | ||
|
|
a9a451a8cf | ||
|
|
7081280247 | ||
|
|
2d97e81920 | ||
|
|
761f71c6c1 | ||
|
|
882afe0f67 | ||
|
|
1f47ff8229 | ||
|
|
f40c0e31c1 | ||
|
|
bf95a375fb | ||
|
|
00e19bc1b4 | ||
|
|
fd64caefc1 | ||
|
|
e8b557bb4e | ||
|
|
b2822a614a | ||
|
|
37a942b8b3 | ||
|
|
a56e2f990c |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/pentest_tool/target
|
||||||
@@ -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`
|
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`
|
2. cd into the nested "pentest_tool" folder `cd pentest_tool/pentest_tool`
|
||||||
3. use cargo to build the release binary `cargo build --release`
|
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
25
ToDo.md
Normal 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.
|
||||||
2015
pentest_tool/Cargo.lock
generated
2015
pentest_tool/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,11 @@ version = "0.2.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
chrono = "0.4.39"
|
||||||
clearscreen = "3.0.0"
|
clearscreen = "3.0.0"
|
||||||
directories = "5.0.1"
|
directories = "5.0.1"
|
||||||
fs_extra = "1.3.0"
|
fs_extra = "1.3.0"
|
||||||
|
futures-io = { version = "0.2.0-beta" }
|
||||||
|
reqwest = {version = "0.12.12", features = ["blocking", "json"]}
|
||||||
|
rodio = "0.20.1"
|
||||||
|
walkdir = "2.5.0"
|
||||||
|
|||||||
BIN
pentest_tool/resources/bell.mp3
Normal file
BIN
pentest_tool/resources/bell.mp3
Normal file
Binary file not shown.
@@ -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;
|
use crate::Project;
|
||||||
|
|
||||||
pub fn stop_all_boxes(projects: &Vec<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){
|
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");
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,16 @@
|
|||||||
use std::fs;
|
use std::fs;
|
||||||
use std::fs::read_to_string;
|
use std::fs::read_to_string;
|
||||||
|
use std::io::BufReader;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process;
|
use std::process;
|
||||||
|
use std::thread;
|
||||||
|
use std::time::Duration;
|
||||||
|
use std::io::stdin;
|
||||||
|
use walkdir::WalkDir;
|
||||||
|
use clearscreen::clear;
|
||||||
|
use clearscreen;
|
||||||
|
use rodio::{Decoder, OutputStream, Sink};
|
||||||
use crate::Project;
|
use crate::Project;
|
||||||
|
|
||||||
pub fn run_initial_enum(project: &Project){
|
pub fn run_initial_enum(project: &Project){
|
||||||
@@ -180,3 +188,397 @@ pub fn build_cs_portscan_cmd(project: &Project){
|
|||||||
let final_command = portscan_cmd.replace("!!!", &combined_ranges);
|
let final_command = portscan_cmd.replace("!!!", &combined_ranges);
|
||||||
println!("{}", final_command);
|
println!("{}", final_command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn find_file(dir: &PathBuf, file_name: &str) -> Option<String>{
|
||||||
|
for entry in WalkDir::new(dir){
|
||||||
|
let entry = entry.unwrap();
|
||||||
|
let path = entry.path();
|
||||||
|
if path.is_file() && path.file_name().unwrap() == file_name{
|
||||||
|
return Some(path.to_str().unwrap().to_string());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn nefarious_config(tools_dir: &PathBuf) -> String{
|
||||||
|
let nefarious_spray_path = find_file(tools_dir, "obf-NefariousSpray.exe");
|
||||||
|
let mut outline = String::new();
|
||||||
|
let mut exemethod = String::new();
|
||||||
|
loop {
|
||||||
|
println!("how do you need to run it?");
|
||||||
|
print!("
|
||||||
|
1.) execut-assembly
|
||||||
|
2.) inlineExecute-assembly
|
||||||
|
3.) from disk with cobalt strike
|
||||||
|
4.) from disk without cobalt strike
|
||||||
|
");
|
||||||
|
let exemethod_result = stdin().read_line(&mut exemethod);
|
||||||
|
if exemethod_result.is_err(){
|
||||||
|
println!("we need input here dummy!");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
match exemethod.as_str(){
|
||||||
|
"1\n" => outline = format!("execute-assembly {} spray -p ||PASSWORD|| -o C:\\temp\\fr\\||PASSWORD||.txt", nefarious_spray_path.map_or("".to_string(), |s| s)),
|
||||||
|
"2\n" => outline = format!("inlineExecute-Assembly --dotnetassembly {} --assemblyargs spray -p ||PASSWORD|| -o C:\\temp\\fr\\||PASSWORD||.txt --etw --amsi --pipe totallyawesomepipeyo", nefarious_spray_path.map_or("".to_string(), |s| s)),
|
||||||
|
"3\n" => outline = {let mut path = String::new(); println!("path to nefarious spray.exe"); stdin().read_line(&mut path).unwrap(); format!("run {} spray -p ||PASSWORD|| -o C:\\temp\\fr\\||PASSWORD||.txt", path.trim_ascii_end())},
|
||||||
|
"4\n" => outline = {let mut path = String::new(); println!("path to nefarious spray.exe"); stdin().read_line(&mut path).unwrap(); format!("{} spray -p ||PASSWORD|| -o C:\\temp\\fr\\||PASSWORD||.txt", path.trim_ascii_end())},
|
||||||
|
_ => println!("unknown exec method... try again")
|
||||||
|
}
|
||||||
|
return outline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn msolspray_config(tools_dir: &PathBuf) -> String{
|
||||||
|
let mut msolspray_path = String::new();
|
||||||
|
let mut outline = String::new();
|
||||||
|
let mut userlist = String::new();
|
||||||
|
let mut spray_target = String::new();
|
||||||
|
loop{
|
||||||
|
println!("path to your users list?");
|
||||||
|
let result = stdin().read_line(&mut userlist);
|
||||||
|
if result.is_err(){
|
||||||
|
println!("we need input here dummy!");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
loop{
|
||||||
|
println!("target URL (probably a fireprox url)");
|
||||||
|
let result = stdin().read_line(&mut spray_target);
|
||||||
|
if result.is_err(){
|
||||||
|
println!("we need input here dummy!");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
loop {
|
||||||
|
let mut response = String::new();
|
||||||
|
println!("is MSOLSpray.py in your path? (for example installed via pipx or pip)");
|
||||||
|
let path_result = stdin().read_line(&mut response);
|
||||||
|
if path_result.is_err(){
|
||||||
|
println!("we need input here dummy!!");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
response = response.to_lowercase();
|
||||||
|
if response.contains("y"){
|
||||||
|
msolspray_path = "MSOLSpray".to_owned();
|
||||||
|
}
|
||||||
|
else if response.contains("n"){
|
||||||
|
println!("trying to automatically find msolspray.py in your tools folder...");
|
||||||
|
let find_result = find_file(tools_dir, "MSOLSpray.py");
|
||||||
|
if find_result.is_some(){
|
||||||
|
msolspray_path = find_result.unwrap();
|
||||||
|
loop {
|
||||||
|
let mut response = String::new();
|
||||||
|
println!("Found it! located at {}", msolspray_path);
|
||||||
|
println!("is that correct?");
|
||||||
|
let result = stdin().read_line(&mut response);
|
||||||
|
if result.is_err(){
|
||||||
|
println!("we need input here bruv, try again...");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
response = response.to_lowercase();
|
||||||
|
if response.contains("n"){
|
||||||
|
loop{
|
||||||
|
msolspray_path = "".to_owned();
|
||||||
|
println!("ok, so where is msolspray.py then?");
|
||||||
|
let result = stdin().read_line(&mut msolspray_path);
|
||||||
|
if result.is_err(){
|
||||||
|
println!("we need input here burv...");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
msolspray_path = format!("python {}", msolspray_path);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
loop {
|
||||||
|
println!("OOOOF we didn't find it burh... where is MSOLSpray.py located?");
|
||||||
|
match stdin().read_line(&mut msolspray_path){
|
||||||
|
Ok(_response) => break,
|
||||||
|
Err(_e) => println!("we need input here bruv... try again")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
outline = format!("{} {} -p ||PASSWORD|| --url {}", msolspray_path.trim_end(), userlist.trim_end(), spray_target.trim_end());
|
||||||
|
return outline;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn password_spray_help(project: &Project, season: String, lseason: String, year: i32, tools_dir: &PathBuf, config_path: &PathBuf){
|
||||||
|
let mut wait_time:u64 = 0;
|
||||||
|
let mut wait_time_response = String::new();
|
||||||
|
let mut bell_path = config_path.clone();
|
||||||
|
bell_path.pop();
|
||||||
|
bell_path.push("bell.mp3");
|
||||||
|
let mut tool_to_use = String::new();
|
||||||
|
loop {
|
||||||
|
println!("which tool?");
|
||||||
|
print!("
|
||||||
|
1.) nefarious spray
|
||||||
|
2.) msolspray.py
|
||||||
|
");
|
||||||
|
let exemethod_result = stdin().read_line(&mut tool_to_use);
|
||||||
|
if exemethod_result.is_err(){
|
||||||
|
println!("we need input here dummy!");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
loop {
|
||||||
|
println!("Observation window in minutes?");
|
||||||
|
match stdin().read_line(&mut wait_time_response){
|
||||||
|
Ok(_response) => {{
|
||||||
|
let trimmed = wait_time_response.trim_end();
|
||||||
|
let time_parse_reslut = trimmed.parse::<u64>();
|
||||||
|
if time_parse_reslut.is_err(){
|
||||||
|
println!("error parsing wait time into u64!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
wait_time = time_parse_reslut.unwrap();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}},
|
||||||
|
Err(_e) => println!("we need you to put in the minutes for the obervation window please!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let wait_dur = Duration::from_secs(wait_time);
|
||||||
|
let mut password_spray_file = project.notes_folder.clone();
|
||||||
|
password_spray_file.push("password_spray.md");
|
||||||
|
println!("{}", password_spray_file.display());
|
||||||
|
let mut password_spray_string = String::new();
|
||||||
|
let password_spray_read_result = fs::read_to_string(&password_spray_file);
|
||||||
|
if password_spray_read_result.is_err(){
|
||||||
|
println!("error reading password spray file!!!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
password_spray_string = password_spray_read_result.unwrap();
|
||||||
|
}
|
||||||
|
let mut passwords = Vec::new();
|
||||||
|
let mut sprayed_passwords = Vec::new();
|
||||||
|
println!("loading lines to parse...");
|
||||||
|
for line in password_spray_string.split("\n"){
|
||||||
|
if line.len() > 3{
|
||||||
|
if !line.contains("[x]"){
|
||||||
|
println!("parsing {} ...", line);
|
||||||
|
let words: Vec<&str> = line.split_whitespace().collect();
|
||||||
|
let mut password = words.last().unwrap().to_string();
|
||||||
|
if password.contains("year"){
|
||||||
|
password = password.replace("year", year.to_string().as_str());
|
||||||
|
}
|
||||||
|
if password.contains("Season"){
|
||||||
|
let seasonpassword = password.replace("Season", &season);
|
||||||
|
passwords.push(seasonpassword);
|
||||||
|
let lseasonpassword = password.replace("Season", &lseason);
|
||||||
|
passwords.push(lseasonpassword);
|
||||||
|
}
|
||||||
|
if password.contains("season"){
|
||||||
|
let seasonpassword = password.replace("season", &season.to_lowercase());
|
||||||
|
passwords.push(seasonpassword);
|
||||||
|
let lseasonpassword = password.replace("season", &lseason.to_lowercase());
|
||||||
|
passwords.push(lseasonpassword);
|
||||||
|
}
|
||||||
|
passwords.push(password);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
let words: Vec<&str> = line.split_whitespace().collect();
|
||||||
|
let password = words.last().unwrap().to_string();
|
||||||
|
println!("{} already sprayed, making note...", &password);
|
||||||
|
sprayed_passwords.push(password);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
println!("passwords loaded, and parsed!");
|
||||||
|
println!("starting password display and timer operations...");
|
||||||
|
let mut outline = String::new();
|
||||||
|
match tool_to_use.as_str(){
|
||||||
|
"1\n" => outline = nefarious_config(tools_dir),
|
||||||
|
"2\n" => outline = msolspray_config(tools_dir),
|
||||||
|
_ => println!("unkown tool to use, try again...")
|
||||||
|
}
|
||||||
|
for password in &passwords{
|
||||||
|
let mut _spraycontinue = String::new();
|
||||||
|
let mut printline = outline.replace("||PASSWORD||", password);
|
||||||
|
if password.contains("useraspass"){
|
||||||
|
printline = printline.replace("-p useraspass", "--UserAsPass")
|
||||||
|
}
|
||||||
|
println!("\n{}\n", printline);
|
||||||
|
println!("enter s to save an return to main menu, or just enter to start timer");
|
||||||
|
stdin().read_line(&mut _spraycontinue).unwrap();
|
||||||
|
sprayed_passwords.push(password.to_owned());
|
||||||
|
if _spraycontinue.contains("s"){
|
||||||
|
let new_spray_file = fs::OpenOptions::new().write(true).truncate(true).open(&password_spray_file);
|
||||||
|
if new_spray_file.is_err(){
|
||||||
|
println!("error saving progress, please make note of where you are and update the file accordingly");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
let mut open_spray_file = new_spray_file.unwrap();
|
||||||
|
let mut new_file_text = String::new();
|
||||||
|
for sprayed_pass in &sprayed_passwords{
|
||||||
|
new_file_text = format!("{}\n- [x] {}", new_file_text, sprayed_pass);
|
||||||
|
}
|
||||||
|
for password in &passwords{
|
||||||
|
if sprayed_passwords.contains(password) == false{
|
||||||
|
new_file_text = format!("{}\n- [ ] {}", new_file_text, password);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let save_result = open_spray_file.write_all(new_file_text.as_bytes());
|
||||||
|
if save_result.is_err(){
|
||||||
|
println!("saving failed!\nplease copy the below lines into your password spray notes!");
|
||||||
|
println!("{}", new_file_text);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
println!("password saved complete!!!");
|
||||||
|
println!("returning to main menu...");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
println!("waiting for {} minutes...", wait_dur.as_secs());
|
||||||
|
thread::sleep(wait_dur * 60);
|
||||||
|
let (_stream, stream_handle) = OutputStream::try_default().unwrap();
|
||||||
|
let sink = Sink::try_new(&stream_handle).unwrap();
|
||||||
|
let bell_file = fs::File::open(&bell_path).unwrap();
|
||||||
|
let source = Decoder::new(BufReader::new(bell_file)).unwrap();
|
||||||
|
sink.append(source);
|
||||||
|
sink.sleep_until_end();
|
||||||
|
clear().unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn crack_hashes(cracking_rig: &String, project: &Project, terminal: &String, rockyou: &String, rule: &String){
|
||||||
|
let mut hash_file = String::new();
|
||||||
|
println!("trying to automatically find hashes.txt file...");
|
||||||
|
let find_result = find_file(&project.files_folder, "hashes.txt");
|
||||||
|
if find_result.is_some(){
|
||||||
|
hash_file = find_result.unwrap();
|
||||||
|
println!("hash file found!");
|
||||||
|
let mut res = String::new();
|
||||||
|
println!("is {} the file you want to crack?", hash_file);
|
||||||
|
match stdin().read_line(&mut res){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(_e) => {println!("we need input here dummy! returning..."); return;}
|
||||||
|
}
|
||||||
|
res = res.to_lowercase();
|
||||||
|
if res.contains("n"){
|
||||||
|
println!("ooof ok, where is the file you want then?");
|
||||||
|
loop{
|
||||||
|
match stdin().read_line(&mut hash_file){
|
||||||
|
Ok(_r) => break,
|
||||||
|
Err(_e) => println!("we need input here dummy! try again...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if res.contains("y"){
|
||||||
|
println!("nice! checking for cracking directory...");
|
||||||
|
let listing_res = process::Command::new("ssh").arg(&cracking_rig).arg("'ls ~'").output();
|
||||||
|
if listing_res.is_err(){
|
||||||
|
println!("Error checking for cracking directory!");
|
||||||
|
println!("Error: {}", listing_res.unwrap_err());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
let listing_stdout = listing_res.unwrap().stdout;
|
||||||
|
let listing = String::from_utf8_lossy(&listing_stdout);
|
||||||
|
if listing.contains("hash_cracking") == false{
|
||||||
|
println!("no folder found, creating it...");
|
||||||
|
let mkdir = process::Command::new("ssh").arg(&cracking_rig).arg("'mkdir ~/hash_cracking'").status();
|
||||||
|
if mkdir.is_err(){
|
||||||
|
println!("error creating directory! try again...");
|
||||||
|
println!("Error: {}", mkdir.unwrap_err());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let scp_arg = format!("'scp {} {}:~/hash_cracking/{}'", &hash_file, cracking_rig, &hash_file);
|
||||||
|
let scp_res = process::Command::new("ssh").arg(&cracking_rig).arg(scp_arg).status();
|
||||||
|
if scp_res.is_err(){
|
||||||
|
println!("error uploading hashes file!");
|
||||||
|
println!("Error: {}", scp_res.unwrap_err());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
println!("nice, hach file uploaded! determining correct terminal command...");
|
||||||
|
let terminal = terminal.split(" ").collect::<Vec<&str>>()[0];
|
||||||
|
process::Command::new(terminal).arg("-e").arg("ssh").arg(&cracking_rig);
|
||||||
|
let mut hash_type_res = String::new();
|
||||||
|
let mut cracking_arg = String::new();
|
||||||
|
let mut crack_box = String::new();
|
||||||
|
let mut crack_box_res = String::new();
|
||||||
|
println!("do you use a distrobox to crack passwords?");
|
||||||
|
loop{
|
||||||
|
match stdin().read_line(&mut crack_box_res){
|
||||||
|
Ok(_r) => break,
|
||||||
|
Err(_e) => println!("we need input here dummy, try again")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
crack_box_res = crack_box_res.to_lowercase();
|
||||||
|
if crack_box_res.contains("y"){
|
||||||
|
println!("What's the distrobox's name?");
|
||||||
|
loop{
|
||||||
|
match stdin().read_line(&mut crack_box){
|
||||||
|
Ok(_r) => break,
|
||||||
|
Err(_e) => println!("we need input here dummy, try again!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
crack_box = "no".to_owned();
|
||||||
|
}
|
||||||
|
|
||||||
|
if crack_box == "no".to_owned(){
|
||||||
|
cracking_arg = format!("sudo hashcat -m ||MODE|| -a 0 -r {} /home/{}/hash_cracking/{} {}", rule, cracking_rig.split("@").collect::<Vec<&str>>()[1], &hash_file, &rockyou);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
cracking_arg = format!("distrobox enter --root {} -- sudo -S hashcat -m ||MODE|| -a 0 -r {} /home/{}/hash_cracking/{} {}", crack_box, rule, cracking_rig.split("@").collect::<Vec<&str>>()[1], &hash_file, &rockyou);
|
||||||
|
}
|
||||||
|
loop{
|
||||||
|
println!("Hash type?");
|
||||||
|
print!("
|
||||||
|
1.) kerberos
|
||||||
|
2.) ntlm
|
||||||
|
3.) other
|
||||||
|
");
|
||||||
|
let _res = stdin().read_line(&mut hash_type_res);
|
||||||
|
if _res.is_err(){
|
||||||
|
println!("we need input here dummy! try again...");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
match hash_type_res.as_str(){
|
||||||
|
"1\n" => {cracking_arg = cracking_arg.replace("||MODE||", "19700"); break;},
|
||||||
|
"2\n" => {cracking_arg = cracking_arg.replace("||MODE||", "1000"); break;},
|
||||||
|
"3\n" => {let mut mode = String::new();
|
||||||
|
println!("code for the mode you want to use?");
|
||||||
|
loop{
|
||||||
|
match stdin().read_line(&mut mode){
|
||||||
|
Ok(_r) => break,
|
||||||
|
Err(_e) => println!("we need input here dummy, try again...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cracking_arg = cracking_arg.replace("||MODE||", &mode);
|
||||||
|
break;
|
||||||
|
},
|
||||||
|
_ => println!("unknown selection... try again...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let spaw_res = process::Command::new(terminal).arg("-e").arg("ssh").arg(&cracking_rig).arg(cracking_arg).spawn();
|
||||||
|
if spaw_res.is_err(){
|
||||||
|
println!("error spawing new terminal to ssh with!");
|
||||||
|
println!("ERROR: {}", spaw_res.unwrap_err());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,167 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
use std::fs::File;
|
||||||
|
use std::io::Read;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
use std::io::stdin;
|
||||||
|
use std::io::copy;
|
||||||
|
use reqwest::blocking::get;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process;
|
use std::process;
|
||||||
|
use std::process::exit;
|
||||||
|
|
||||||
|
|
||||||
|
fn setup_folders(config_path: &PathBuf) -> (String, String, String, String, String, String, String, String, String){
|
||||||
|
let mut delete_for_cleanup = config_path.clone();
|
||||||
|
delete_for_cleanup.pop();
|
||||||
|
let mut failed = false;
|
||||||
|
let mut new_files_folder = String::new();
|
||||||
|
let mut new_notes_folder = String::new();
|
||||||
|
let mut upcomming_files_folder = String::new();
|
||||||
|
let mut upcomming_notes_folder = String::new();
|
||||||
|
let mut tools_folder = String::new();
|
||||||
|
let mut cracking_rig = String::new();
|
||||||
|
let mut cracking_user = String::new();
|
||||||
|
let mut rockyou = String::new();
|
||||||
|
let mut rule = String::new();
|
||||||
|
while new_files_folder.is_empty() || new_notes_folder.is_empty() || tools_folder.is_empty(){
|
||||||
|
if new_files_folder.is_empty(){
|
||||||
|
println!("path to save active project files?");
|
||||||
|
match stdin().read_line(&mut new_files_folder){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(_e) => println!("we need input here dummy... We will reprompt on the next loop...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if new_notes_folder.is_empty(){
|
||||||
|
println!("path to save active project notes?");
|
||||||
|
match stdin().read_line(&mut new_notes_folder){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(_e) => println!("we need input here dummy... We will reprompt on the next loop...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if tools_folder.is_empty(){
|
||||||
|
println!("path to custom tools (like github tools and what not)");
|
||||||
|
match stdin().read_line(&mut tools_folder){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(_e) => println!("we need input here dummy... We will reprompt on the next loop...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if upcomming_files_folder.is_empty(){
|
||||||
|
println!("path to save upcomming project files?");
|
||||||
|
match stdin().read_line(&mut upcomming_files_folder){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(_e) => println!("we need input here dummy... We will reprompt on the next loop...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if upcomming_notes_folder.is_empty(){
|
||||||
|
println!("path to save upcomming project notes?");
|
||||||
|
match stdin().read_line(&mut upcomming_notes_folder){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(_e) => println!("we need input here dummy... We will reprompt on the next loop...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if cracking_rig.is_empty(){
|
||||||
|
let mut have_rig = String::new();
|
||||||
|
println!("do you have a separate computer that you can ssh into to crack passwords on?");
|
||||||
|
match stdin().read_line(&mut have_rig){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(_e) => println!("we need input here dummy, try again...")
|
||||||
|
}
|
||||||
|
have_rig = have_rig.to_lowercase();
|
||||||
|
if have_rig.contains("y"){
|
||||||
|
println!("excellent! Whats the IP or hostname?");
|
||||||
|
loop{
|
||||||
|
match stdin().read_line(&mut cracking_rig){
|
||||||
|
Ok(_r) => break,
|
||||||
|
Err(_e) => println!("we need input here dummy, try again...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
println!("user to ssh as for the cracking rig?");
|
||||||
|
loop{
|
||||||
|
match stdin().read_line(&mut cracking_user){
|
||||||
|
Ok(_r) => break,
|
||||||
|
Err(_e) => println!("we need input here dummy, try again...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
println!("Path to rockyou.txt on the cracking rig?");
|
||||||
|
loop{
|
||||||
|
match stdin().read_line(&mut rockyou){
|
||||||
|
Ok(_r) => break,
|
||||||
|
Err(_e) => println!("we need input here dummyu try again...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
println!("Path to one rule to rule them all on the cracking rig?");
|
||||||
|
loop{
|
||||||
|
match stdin().read_line(&mut rule){
|
||||||
|
Ok(_r) => break,
|
||||||
|
Err(_e) => println!("we need input here dummyu try again...")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if have_rig.contains("n"){
|
||||||
|
println!("ooof ok freeloader");
|
||||||
|
cracking_rig = "n".to_owned();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
new_files_folder = new_files_folder.trim_end().to_owned();
|
||||||
|
new_notes_folder = new_notes_folder.trim_end().to_owned();
|
||||||
|
upcomming_files_folder = upcomming_files_folder.trim_end().to_owned();
|
||||||
|
upcomming_notes_folder = upcomming_notes_folder.trim_end().to_owned();
|
||||||
|
tools_folder = tools_folder.trim_end().to_owned();
|
||||||
|
cracking_rig = cracking_rig.trim_end().to_owned();
|
||||||
|
cracking_user = cracking_user.trim_end().to_owned();
|
||||||
|
let new_files_path = PathBuf::from(&new_files_folder);
|
||||||
|
let new_notes_path = PathBuf::from(&new_notes_folder);
|
||||||
|
let upcomming_files_path = PathBuf::from(&upcomming_files_folder);
|
||||||
|
let upcomming_notes_path = PathBuf::from(&upcomming_notes_folder);
|
||||||
|
let tools_path = PathBuf::from(&tools_folder.trim_end());
|
||||||
|
if new_files_path.exists() == false{
|
||||||
|
println!("active project file folder does not exist, creating...");
|
||||||
|
match fs::create_dir_all(&new_files_folder){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(e) => {println!("Error creating active project files Folder!: {}", e);failed = true;}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if new_notes_path.exists() == false{
|
||||||
|
println!("active project notes folder does not exist creating...");
|
||||||
|
match fs::create_dir_all(new_notes_path){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(e) => {println!("Error creating active project notes Folder!: {}", e);failed = true;}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if tools_path.exists() == false{
|
||||||
|
println!("tools folder does not exist creating...");
|
||||||
|
match fs::create_dir_all(tools_path){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(e) => {println!("Error creating tools Folder!: {}", e);failed = true;}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if upcomming_files_path.exists() == false{
|
||||||
|
println!("upcomming project files folder does not exist creating...");
|
||||||
|
match fs::create_dir_all(upcomming_files_path){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(e) => {println!("Error creating upcomming project files Folder!: {}", e);failed = true;}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if upcomming_notes_path.exists() == false{
|
||||||
|
println!("upcomming project notes folder does not exist creating...");
|
||||||
|
match fs::create_dir_all(upcomming_notes_path){
|
||||||
|
Ok(_r) => (),
|
||||||
|
Err(e) => {println!("Error creating upcomming project notes Folder!: {}", e);failed = true;}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if failed{
|
||||||
|
println!("install failed, cleaning up files...");
|
||||||
|
match fs::remove_dir_all(&delete_for_cleanup){
|
||||||
|
Ok(_r) => println!("cleanup successfull, please correct previously reported errors and rerun"),
|
||||||
|
Err(e) => println!("cleanup failed!: {}\nManually delete the following folder and retry\n{}", e, delete_for_cleanup.display())
|
||||||
|
}
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
return (new_files_folder, new_notes_folder, tools_folder, upcomming_files_folder, upcomming_notes_folder, cracking_rig, cracking_user, rockyou, rule);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -16,16 +175,21 @@ pub fn install(config_path: &PathBuf){
|
|||||||
let mut config_folder_path: PathBuf = config_path.clone();
|
let mut config_folder_path: PathBuf = config_path.clone();
|
||||||
config_folder_path.pop();
|
config_folder_path.pop();
|
||||||
let mut projects_conf_path = config_folder_path.clone();
|
let mut projects_conf_path = config_folder_path.clone();
|
||||||
|
let mut bell_file_path = config_folder_path.clone();
|
||||||
let del_on_fail = config_folder_path.clone();
|
let del_on_fail = config_folder_path.clone();
|
||||||
projects_conf_path.push("projects.conf");
|
projects_conf_path.push("projects.conf");
|
||||||
fs::create_dir_all(&config_folder_path).expect("error creating config dir");
|
fs::create_dir_all(&config_folder_path).expect("error creating config dir");
|
||||||
|
bell_file_path.push("bell.mp3");
|
||||||
|
let bell_sound_url = "https://github.com/Pyro57000/pentest_tool/raw/refs/heads/main/resources/bell.mp3";
|
||||||
|
let response = get(bell_sound_url).unwrap();
|
||||||
|
let response_length = response.content_length().unwrap_or(0);
|
||||||
|
let mut bell_file = File::create(bell_file_path).unwrap();
|
||||||
|
copy(&mut response.take(response_length), &mut bell_file).unwrap();
|
||||||
|
println!("bell notification tone sucessfully downloaded!");
|
||||||
let mut config_file = fs::File::create(config_path).expect("error creating file");
|
let mut config_file = fs::File::create(config_path).expect("error creating file");
|
||||||
let mut projects_conf_file = fs::File::create(projects_conf_path).expect("error creating projects config file");
|
let mut projects_conf_file = fs::File::create(projects_conf_path).expect("error creating projects config file");
|
||||||
projects_conf_file.write_all(b"customer:name:notes:files:active:box_name\n").expect("error writing default project info");
|
projects_conf_file.write_all(b"customer:name:notes:files:active:box_name\n").expect("error writing default project info");
|
||||||
let mut terminal_response = String::new();
|
let mut terminal_response = String::new();
|
||||||
let mut notes_response = String::new();
|
|
||||||
let mut files_response = String::new();
|
|
||||||
let mut tools_response = String::new();
|
|
||||||
let mut template_name = String::new();
|
let mut template_name = String::new();
|
||||||
let mut have_template = String::new();
|
let mut have_template = String::new();
|
||||||
println!("terminal you use? (example: konsole, xfce, gnome, etc)");
|
println!("terminal you use? (example: konsole, xfce, gnome, etc)");
|
||||||
@@ -46,12 +210,7 @@ pub fn install(config_path: &PathBuf){
|
|||||||
else{
|
else{
|
||||||
_terminal_command = _terminal_commands[terminal_response.trim_end()].to_owned();
|
_terminal_command = _terminal_commands[terminal_response.trim_end()].to_owned();
|
||||||
}
|
}
|
||||||
println!("path to save project notes?");
|
let (files_response, notes_response, tools_response, project_folder_path, project_note_path, cracking_rig, cracking_user, rockyou, rule) = setup_folders(&config_path);
|
||||||
std::io::stdin().read_line(&mut notes_response).unwrap();
|
|
||||||
println!("path to save project files?");
|
|
||||||
std::io::stdin().read_line(&mut files_response).unwrap();
|
|
||||||
println!("path to folder with your custom tools?");
|
|
||||||
std::io::stdin().read_line(&mut tools_response).unwrap();
|
|
||||||
print!("
|
print!("
|
||||||
This tool is mainly to handle distrobox creation and usage.
|
This tool is mainly to handle distrobox creation and usage.
|
||||||
It's expecting you to have a distrobox that you will use as a template.
|
It's expecting you to have a distrobox that you will use as a template.
|
||||||
@@ -70,12 +229,18 @@ Do you have a distrobox set up to function as your template for all new projects
|
|||||||
let _list = process::Command::new("distrobox").arg("list").arg("--root").status();
|
let _list = process::Command::new("distrobox").arg("list").arg("--root").status();
|
||||||
println!("distrobox template name?");
|
println!("distrobox template name?");
|
||||||
std::io::stdin().read_line(&mut template_name).unwrap();
|
std::io::stdin().read_line(&mut template_name).unwrap();
|
||||||
let config_string = format!("Project_files:{}\nProject_notes:{}\ntools_folder:{}\nterminal:{}", files_response.trim_end(), notes_response.trim_end(), tools_response.trim_end(), _terminal_command.trim_end());
|
let config_string = format!("Project_files:{}\nProject_notes:{}\ntools_folder:{}\nbox_template:{}\nterminal:{}\ncracking_rig:{}@{}\nrockyou_location:{}\nrule_location:{}", files_response.trim_end(), notes_response.trim_end(), tools_response.trim_end(),template_name.trim_end(), _terminal_command.trim_end(), cracking_user.trim_ascii_end(), cracking_rig.trim_end(), rockyou.trim_end(), rule.trim_end());
|
||||||
config_file.write_all(config_string.as_bytes()).expect("error writing to config file");
|
config_file.write_all(config_string.as_bytes()).expect("error writing to config file");
|
||||||
let default_projectline = format!("default:default:{}:{}:yes:{}", ¬es_response.trim_end(), &files_response.trim_end(), &template_name.trim_end());
|
let default_projectline = format!("default:default:{}:{}:yes:{}", ¬es_response.trim_end(), &files_response.trim_end(), &template_name.trim_end());
|
||||||
projects_conf_file.write_all(default_projectline.as_bytes()).expect("error writing default project line");
|
projects_conf_file.write_all(default_projectline.as_bytes()).expect("error writing default project line");
|
||||||
|
println!("active project folders: {}", &files_response);
|
||||||
|
println!("upcomming project folders: {}", &project_folder_path);
|
||||||
|
println!("active project notes: {}", ¬es_response);
|
||||||
|
println!("upcomming prjoect notes: {}", &project_note_path);
|
||||||
|
println!("tools folder: {}", &tools_response);
|
||||||
|
println!("distrobox template: {}", &template_name);
|
||||||
|
println!("terminal command: {}", &_terminal_command);
|
||||||
println!("config file generated and saved to {}\n", config_path.display());
|
println!("config file generated and saved to {}\n", config_path.display());
|
||||||
println!("please rerun the program");
|
|
||||||
|
|
||||||
|
|
||||||
let config_path = &config_folder_path.clone();
|
let config_path = &config_folder_path.clone();
|
||||||
@@ -84,16 +249,6 @@ Do you have a distrobox set up to function as your template for all new projects
|
|||||||
install_path.push("new_projects.conf");
|
install_path.push("new_projects.conf");
|
||||||
password_spray_template_path.push("passwordspray.md");
|
password_spray_template_path.push("passwordspray.md");
|
||||||
let password_spray_template_path = install_path.clone();
|
let password_spray_template_path = install_path.clone();
|
||||||
let mut conf_file = fs::File::create(install_path).expect("error creating config file");
|
|
||||||
let mut project_folder_path = String::new();
|
|
||||||
let mut porject_note_path = String::new();
|
|
||||||
println!("path to the project folders directory?");
|
|
||||||
std::io::stdin().read_line(&mut project_folder_path).expect("error reading project folder from stdin");
|
|
||||||
println!("path to the project notes directory");
|
|
||||||
std::io::stdin().read_line(&mut porject_note_path).expect("error reading project note folder form stdin");
|
|
||||||
write!(conf_file, "project_folder_path:{}
|
|
||||||
project_notes_path:{}
|
|
||||||
", project_folder_path.trim_end(), porject_note_path.trim_end()).expect("error writing config file");
|
|
||||||
let mut passpray_file = fs::File::create(password_spray_template_path).expect("error creating passwordspray file");
|
let mut passpray_file = fs::File::create(password_spray_template_path).expect("error creating passwordspray file");
|
||||||
write!(passpray_file, "
|
write!(passpray_file, "
|
||||||
- [ ] useraspass
|
- [ ] useraspass
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ fn main() {
|
|||||||
let mut tools_folder = PathBuf::new();
|
let mut tools_folder = PathBuf::new();
|
||||||
let mut terminal_command = String::new();
|
let mut terminal_command = String::new();
|
||||||
let mut box_template = String::new();
|
let mut box_template = String::new();
|
||||||
|
let mut cracking_rig = String::new();
|
||||||
|
let mut rockyou = String::new();
|
||||||
|
let mut rule = String::new();
|
||||||
println!("\nconfig already generated\nloading config file...\n");
|
println!("\nconfig already generated\nloading config file...\n");
|
||||||
let settings_string = fs::read_to_string(&config_path).expect("error reading config file");
|
let settings_string = fs::read_to_string(&config_path).expect("error reading config file");
|
||||||
let settings: Vec<&str> = settings_string.split("\n").collect();
|
let settings: Vec<&str> = settings_string.split("\n").collect();
|
||||||
@@ -65,6 +68,9 @@ fn main() {
|
|||||||
"tools_folder" => tools_folder.push(setting_vec[1].trim_end()),
|
"tools_folder" => tools_folder.push(setting_vec[1].trim_end()),
|
||||||
"box_template" => box_template = setting_vec[1].trim_end().to_owned(),
|
"box_template" => box_template = setting_vec[1].trim_end().to_owned(),
|
||||||
"terminal" => terminal_command = 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_end().to_owned(),
|
||||||
|
"rule_location" => rule = setting_vec[1].trim_end().to_owned(),
|
||||||
_ => println!("error unknown setting: {}", setting_vec[0])
|
_ => println!("error unknown setting: {}", setting_vec[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,12 +80,13 @@ fn main() {
|
|||||||
Note Folders: {}
|
Note Folders: {}
|
||||||
Tools Folder: {}
|
Tools Folder: {}
|
||||||
distrobox template: {}
|
distrobox template: {}
|
||||||
terminal_command: {}\n
|
terminal_command: {}
|
||||||
", project_base_folder.display(), project_base_notes.display(), tools_folder.display(), box_template, terminal_command);
|
cracking_rig: {}\n
|
||||||
|
", project_base_folder.display(), project_base_notes.display(), tools_folder.display(), box_template, terminal_command, cracking_rig);
|
||||||
println!("loading project configs...");
|
println!("loading project configs...");
|
||||||
let projects = project_controls::get_projects(&config_path);
|
let projects = project_controls::get_projects(&config_path);
|
||||||
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();
|
||||||
menu::main_menu(projects, config_path, &project_base_folder, &project_base_notes, &tools_folder, box_template, terminal_command);
|
menu::main_menu(projects, config_path, &project_base_folder, &project_base_notes, &tools_folder, box_template, terminal_command, cracking_rig, rockyou, rule);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
use std::process::exit;
|
||||||
|
use chrono::Datelike;
|
||||||
use clearscreen::clear;
|
use clearscreen::clear;
|
||||||
use clearscreen;
|
use clearscreen;
|
||||||
|
use chrono::Local;
|
||||||
use crate::Project;
|
use crate::Project;
|
||||||
use crate::project_controls;
|
use crate::project_controls;
|
||||||
use crate::box_controls;
|
use crate::box_controls;
|
||||||
@@ -28,12 +31,24 @@ fn get_active_project(projects: &Vec<Project>) -> &Project{
|
|||||||
return active_project
|
return active_project
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main_menu(mut projects: Vec<Project>, config_path: PathBuf, base_files: &PathBuf, base_notes: &PathBuf, tools_dir: &PathBuf, boxtemplate: String, terminal: String){
|
pub fn main_menu(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){
|
||||||
let mut loopize = true;
|
let mut loopize = true;
|
||||||
let mut new_id = next_project_id(&config_path);
|
let mut new_id = next_project_id(&config_path);
|
||||||
loop {
|
loop {
|
||||||
let active_project = get_active_project(&projects);
|
let active_project = get_active_project(&projects);
|
||||||
let mut response = String::new();
|
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)}
|
||||||
|
}
|
||||||
clear().expect("error clearing screen");
|
clear().expect("error clearing screen");
|
||||||
print!("
|
print!("
|
||||||
,,,;;::ccccc::;;;::c::;,;::cccccllc::::::;:::;;;;,,;,'',,;,,;;;;;;;:;;;;;,,,,,,,,,,,'''''',,,,,,''''
|
,,,;;::ccccc::;;;::c::;,;::cccccllc::::::;:::;;;;,,;,'',,;,,;;;;;;;:;;;;;,,,,,,,,,,,'''''',,,,,,''''
|
||||||
@@ -85,6 +100,12 @@ pub fn main_menu(mut projects: Vec<Project>, config_path: PathBuf, base_files: &
|
|||||||
NOTE OPTION 18 WILL SAVE YOUR PROJECTS BEFORE QUITTING
|
NOTE OPTION 18 WILL SAVE YOUR PROJECTS BEFORE QUITTING
|
||||||
|
|
||||||
Current Project: {} {}
|
Current Project: {} {}
|
||||||
|
Working Folder: {}
|
||||||
|
Notes Folder: {}
|
||||||
|
Box Name: {}
|
||||||
|
Terminal Command: {}
|
||||||
|
Current Season: {}
|
||||||
|
Year: {}
|
||||||
|
|
||||||
Main Menu:
|
Main Menu:
|
||||||
1 .) Show Active Project
|
1 .) Show Active Project
|
||||||
@@ -96,16 +117,19 @@ Current Project: {} {}
|
|||||||
7 .) Remove Project
|
7 .) Remove Project
|
||||||
8 .) Open A New Terminal in Current Active Project
|
8 .) Open A New Terminal in Current Active Project
|
||||||
9 .) Open A Terminal In this windows for the current active project
|
9 .) Open A Terminal In this windows for the current active project
|
||||||
10.) Open Project Files Folder In Dolphin
|
10.) re-create the distrobox for the current active project
|
||||||
11.) Open Project Notes Folder In Dolphin
|
11.) Open Project Files Folder In Dolphin
|
||||||
12.) generate userpass file from your obsidian notes
|
12.) Open Project Notes Folder In Dolphin
|
||||||
13.) run pyro's initail enum script on a nessus csv for the current project
|
13.) generate userpass file from your obsidian notes
|
||||||
14.) Print Project Info For Report
|
14.) run pyro's initail enum script on a nessus csv for the current project
|
||||||
15.) Build host discovery cmd command from scope in notes
|
15.) Print Project Info For Report
|
||||||
16.) build portscan command from scope in notes
|
16.) Build host discovery cmd command from scope in notes
|
||||||
17.) Stop All Distroboxes
|
17.) build portscan command from scope in notes
|
||||||
18.) Quit Application
|
18.) Stop All Distroboxes
|
||||||
\n", active_project.customer, active_project.project_name);
|
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");
|
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(){
|
||||||
@@ -121,15 +145,18 @@ Current Project: {} {}
|
|||||||
"7" => project_controls::remove_project(&mut projects, &config_path),
|
"7" => project_controls::remove_project(&mut projects, &config_path),
|
||||||
"8" => box_controls::project_standalone_terminal(active_project.clone(), terminal.clone()),
|
"8" => box_controls::project_standalone_terminal(active_project.clone(), terminal.clone()),
|
||||||
"9" => box_controls::project_inline_terminal(active_project.clone()),
|
"9" => box_controls::project_inline_terminal(active_project.clone()),
|
||||||
"10" => info_controls::open_in_dolphin("files", active_project.clone()),
|
"10" => box_controls::make_box(&active_project, &tools_dir, &boxtemplate, false),
|
||||||
"11" => info_controls::open_in_dolphin("notes", active_project.clone()),
|
"11" => info_controls::open_in_dolphin("files", active_project.clone()),
|
||||||
"12" => info_controls::generate_userpass(&active_project),
|
"12" => info_controls::open_in_dolphin("notes", active_project.clone()),
|
||||||
"13" => info_controls::run_initial_enum(&active_project),
|
"13" => info_controls::generate_userpass(&active_project),
|
||||||
"14" =>info_controls::print_report_information(active_project.clone()),
|
"14" => info_controls::run_initial_enum(&active_project),
|
||||||
"15" => info_controls::build_cmd_for_host_discovery(&active_project),
|
"15" =>info_controls::print_report_information(active_project.clone()),
|
||||||
"16" => info_controls::build_cs_portscan_cmd(&active_project),
|
"16" => info_controls::build_cmd_for_host_discovery(&active_project),
|
||||||
"17" => box_controls::stop_all_boxes(&projects),
|
"17" => info_controls::build_cs_portscan_cmd(&active_project),
|
||||||
"18" => {project_controls::save_projects(&projects, &config_path);
|
"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();
|
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();
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use std::thread;
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use crate::Project;
|
use crate::Project;
|
||||||
|
use crate::box_controls::make_box;
|
||||||
|
|
||||||
pub fn switch_project(projects: &mut Vec<Project>){
|
pub fn switch_project(projects: &mut Vec<Project>){
|
||||||
for project in projects.clone(){
|
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));
|
thread::sleep(Duration::from_secs(2));
|
||||||
let box_name = format!("atarchbox_{}", customer_name);
|
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(),
|
let new_project = Project{customer: customer_name.trim_end().to_owned(),
|
||||||
project_name: project_name.trim_end().to_owned(),
|
project_name: project_name.trim_end().to_owned(),
|
||||||
notes_folder: new_note_dir,
|
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,
|
id: new_id,
|
||||||
boxname: box_name,
|
boxname: box_name,
|
||||||
};
|
};
|
||||||
|
make_box(&new_project, &tools_dir, &boxtemplate, true);
|
||||||
projects.push(new_project);
|
projects.push(new_project);
|
||||||
save_projects(projects, config_path);
|
save_projects(projects, config_path);
|
||||||
|
|
||||||
|
|||||||
@@ -247,6 +247,7 @@ pub fn start_pentest(config_path: &PathBuf) {
|
|||||||
let mut company_name = String::new();
|
let mut company_name = String::new();
|
||||||
let mut project_name = String::new();
|
let mut project_name = String::new();
|
||||||
let mut config_file_path_buf = config_path.clone();
|
let mut config_file_path_buf = config_path.clone();
|
||||||
|
config_file_path_buf.pop();
|
||||||
let mut passpray_path = config_file_path_buf.clone();
|
let mut passpray_path = config_file_path_buf.clone();
|
||||||
passpray_path.push("passwordspray.md");
|
passpray_path.push("passwordspray.md");
|
||||||
config_file_path_buf.push("new_projects.conf");
|
config_file_path_buf.push("new_projects.conf");
|
||||||
|
|||||||
BIN
resources/bell.mp3
Normal file
BIN
resources/bell.mp3
Normal file
Binary file not shown.
1
resources/credits.txt
Normal file
1
resources/credits.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
https://www.soundjay.com/misc/small-bell-ring-01a.mp3
|
||||||
Reference in New Issue
Block a user