7 Commits
2.1.1 ... 2.1.4

Author SHA1 Message Date
pyro57000
882afe0f67 added logic to save already sprayed passwords
based on passwordspray markdown file.
2025-01-16 13:43:08 -06:00
pyro57000
1f47ff8229 just cleaned up a mutable 2025-01-15 15:58:11 -06:00
pyro57000
f40c0e31c1 added logic to save and come back to a password
spray.
2025-01-15 13:56:09 -06:00
pyro57000
bf95a375fb added logic to do msolspray as well!
this isn't tested very well, but give it a shot!
2025-01-15 13:28:12 -06:00
pyro57000
00e19bc1b4 added logic to display correct command for
user as pass sprays.
2025-01-15 12:07:41 -06:00
pyro57000
fd64caefc1 forgot to add execute-assembly to one line 2025-01-09 14:13:44 -06:00
pyro57000
e8b557bb4e edited install function to actually work right
the bell file was trying to be written
too soon, this has been fixed.
2025-01-09 14:08:46 -06:00
2 changed files with 174 additions and 22 deletions

View File

@@ -5,6 +5,7 @@ use std::io::Read;
use std::io::Write;
use std::path::PathBuf;
use std::process;
use std::result;
use std::thread;
use std::time::Duration;
use std::io::stdin;
@@ -201,14 +202,10 @@ fn find_file(dir: &PathBuf, file_name: &str) -> Option<String>{
return None;
}
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 exemethod = String::new();
let mut bell_path = config_path.clone();
bell_path.pop();
bell_path.push("bell.mp3");
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!("
@@ -221,6 +218,123 @@ pub fn password_spray_help(project: &Project, season: String, lseason: String, y
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
}
@@ -243,12 +357,12 @@ pub fn password_spray_help(project: &Project, season: String, lseason: String, y
Err(_e) => println!("we need you to put in the minutes for the obervation window please!")
}
}
let mut wait_dur = Duration::from_secs(wait_time);
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);
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;
@@ -257,6 +371,7 @@ pub fn password_spray_help(project: &Project, season: String, lseason: String, y
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{
@@ -281,23 +396,60 @@ pub fn password_spray_help(project: &Project, season: String, lseason: String, y
}
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 exemethod.as_str(){
"1\n" => outline = format!("{} 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;}
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();
println!("\n{}\n", outline.replace("||PASSWORD||", password));
println!("press enter to start timer");
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();

View File

@@ -122,6 +122,9 @@ pub fn install(config_path: &PathBuf){
config_folder_path.pop();
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();
projects_conf_path.push("projects.conf");
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();
@@ -129,9 +132,6 @@ pub fn install(config_path: &PathBuf){
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 del_on_fail = config_folder_path.clone();
projects_conf_path.push("projects.conf");
fs::create_dir_all(&config_folder_path).expect("error creating config dir");
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");
projects_conf_file.write_all(b"customer:name:notes:files:active:box_name\n").expect("error writing default project info");