@@ -11,7 +11,7 @@ use std::process;
1111use std:: process:: exit;
1212
1313
14- fn setup_folders ( config_path : & PathBuf ) -> ( String , String , String , String , String ) {
14+ fn setup_folders ( config_path : & PathBuf ) -> ( String , String , String , String , String , String , String , String , String ) {
1515 let mut delete_for_cleanup = config_path. clone ( ) ;
1616 delete_for_cleanup. pop ( ) ;
1717 let mut failed = false ;
@@ -20,6 +20,10 @@ fn setup_folders(config_path: &PathBuf) -> (String, String, String, String, Stri
2020 let mut upcomming_files_folder = String :: new ( ) ;
2121 let mut upcomming_notes_folder = String :: new ( ) ;
2222 let mut tools_folder = String :: new ( ) ;
23+ let mut cracking_rig = String :: new ( ) ;
24+ let mut cracking_user = String :: new ( ) ;
25+ let mut rockyou = String :: new ( ) ;
26+ let mut rule = String :: new ( ) ;
2327 while new_files_folder. is_empty ( ) || new_notes_folder. is_empty ( ) || tools_folder. is_empty ( ) {
2428 if new_files_folder. is_empty ( ) {
2529 println ! ( "path to save active project files?" ) ;
@@ -56,12 +60,62 @@ fn setup_folders(config_path: &PathBuf) -> (String, String, String, String, Stri
5660 Err ( _e) => println ! ( "we need input here dummy... We will reprompt on the next loop..." )
5761 }
5862 }
63+ if cracking_rig. is_empty ( ) {
64+ let mut have_rig = String :: new ( ) ;
65+ println ! ( "do you have a separate computer that you can ssh into to crack passwords on?" ) ;
66+ match stdin ( ) . read_line ( & mut have_rig) {
67+ Ok ( _r) => ( ) ,
68+ Err ( _e) => println ! ( "we need input here dummy, try again..." )
69+ }
70+ have_rig = have_rig. to_lowercase ( ) ;
71+ if have_rig. contains ( "y" ) {
72+ println ! ( "excellent! Whats the IP or hostname?" ) ;
73+ loop {
74+ match stdin ( ) . read_line ( & mut cracking_rig) {
75+ Ok ( _r) => break ,
76+ Err ( _e) => println ! ( "we need input here dummy, try again..." )
77+ }
78+ }
79+ println ! ( "user to ssh as for the cracking rig?" ) ;
80+ loop {
81+ match stdin ( ) . read_line ( & mut cracking_user) {
82+ Ok ( _r) => break ,
83+ Err ( _e) => println ! ( "we need input here dummy, try again..." )
84+ }
85+ }
86+ println ! ( "Path to rockyou.txt on the cracking rig?" ) ;
87+ loop {
88+ match stdin ( ) . read_line ( & mut rockyou) {
89+ Ok ( _r) => break ,
90+ Err ( _e) => println ! ( "we need input here dummyu try again..." )
91+ }
92+ }
93+ println ! ( "Path to one rule to rule them all on the cracking rig?" ) ;
94+ loop {
95+ match stdin ( ) . read_line ( & mut rule) {
96+ Ok ( _r) => break ,
97+ Err ( _e) => println ! ( "we need input here dummyu try again..." )
98+ }
99+ }
100+ }
101+ else if have_rig. contains ( "n" ) {
102+ println ! ( "ooof ok freeloader" ) ;
103+ cracking_rig = "n" . to_owned ( ) ;
104+ }
105+ }
59106 }
107+ new_files_folder = new_files_folder. trim_end ( ) . to_owned ( ) ;
108+ new_notes_folder = new_notes_folder. trim_end ( ) . to_owned ( ) ;
109+ upcomming_files_folder = upcomming_files_folder. trim_end ( ) . to_owned ( ) ;
110+ upcomming_notes_folder = upcomming_notes_folder. trim_end ( ) . to_owned ( ) ;
111+ tools_folder = tools_folder. trim_end ( ) . to_owned ( ) ;
112+ cracking_rig = cracking_rig. trim_end ( ) . to_owned ( ) ;
113+ cracking_user = cracking_user. trim_end ( ) . to_owned ( ) ;
60114 let new_files_path = PathBuf :: from ( & new_files_folder) ;
61115 let new_notes_path = PathBuf :: from ( & new_notes_folder) ;
62116 let upcomming_files_path = PathBuf :: from ( & upcomming_files_folder) ;
63117 let upcomming_notes_path = PathBuf :: from ( & upcomming_notes_folder) ;
64- let tools_path = PathBuf :: from ( & tools_folder) ;
118+ let tools_path = PathBuf :: from ( & tools_folder. trim_end ( ) ) ;
65119 if new_files_path. exists ( ) == false {
66120 println ! ( "active project file folder does not exist, creating..." ) ;
67121 match fs:: create_dir_all ( & new_files_folder) {
@@ -106,7 +160,7 @@ fn setup_folders(config_path: &PathBuf) -> (String, String, String, String, Stri
106160 }
107161 exit ( 1 ) ;
108162 }
109- return ( new_files_folder, new_notes_folder, tools_folder, upcomming_files_folder, upcomming_notes_folder) ;
163+ return ( new_files_folder, new_notes_folder, tools_folder, upcomming_files_folder, upcomming_notes_folder, cracking_rig , cracking_user , rockyou , rule ) ;
110164}
111165
112166
@@ -156,7 +210,7 @@ pub fn install(config_path: &PathBuf){
156210 else {
157211 _terminal_command = _terminal_commands[ terminal_response. trim_end ( ) ] . to_owned ( ) ;
158212 }
159- let ( files_response, notes_response, tools_response, project_folder_path, project_note_path) = setup_folders ( & config_path) ;
213+ let ( files_response, notes_response, tools_response, project_folder_path, project_note_path, cracking_rig , cracking_user , rockyou , rule ) = setup_folders ( & config_path) ;
160214 print ! ( "
161215This tool is mainly to handle distrobox creation and usage.
162216It's expecting you to have a distrobox that you will use as a template.
@@ -175,7 +229,7 @@ Do you have a distrobox set up to function as your template for all new projects
175229 let _list = process:: Command :: new ( "distrobox" ) . arg ( "list" ) . arg ( "--root" ) . status ( ) ;
176230 println ! ( "distrobox template name?" ) ;
177231 std:: io:: stdin ( ) . read_line ( & mut template_name) . unwrap ( ) ;
178- let config_string = format ! ( "Project_files:{}\n Project_notes:{}\n tools_folder:{}\n box_template:{}\n terminal:{}" , files_response. trim_end( ) , notes_response. trim_end( ) , tools_response. trim_end( ) , template_name. trim_end( ) , _terminal_command. trim_end( ) ) ;
232+ let config_string = format ! ( "Project_files:{}\n Project_notes:{}\n tools_folder:{}\n box_template:{}\n terminal:{}\n cracking_rig:{}@{} \n rockyou_location:{} \n rule_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( ) ) ;
179233 config_file. write_all ( config_string. as_bytes ( ) ) . expect ( "error writing to config file" ) ;
180234 let default_projectline = format ! ( "default:default:{}:{}:yes:{}" , & notes_response. trim_end( ) , & files_response. trim_end( ) , & template_name. trim_end( ) ) ;
181235 projects_conf_file. write_all ( default_projectline. as_bytes ( ) ) . expect ( "error writing default project line" ) ;
@@ -195,10 +249,6 @@ Do you have a distrobox set up to function as your template for all new projects
195249 install_path. push ( "new_projects.conf" ) ;
196250 password_spray_template_path. push ( "passwordspray.md" ) ;
197251 let password_spray_template_path = install_path. clone ( ) ;
198- let mut conf_file = fs:: File :: create ( install_path) . expect ( "error creating config file" ) ;
199- write ! ( conf_file, "project_folder_path:{}
200- project_notes_path:{}
201- " , project_folder_path. trim_end( ) , project_note_path. trim_end( ) ) . expect ( "error writing config file" ) ;
202252 let mut passpray_file = fs:: File :: create ( password_spray_template_path) . expect ( "error creating passwordspray file" ) ;
203253 write ! ( passpray_file, "
204254- [ ] useraspass
0 commit comments