added victim stuff, and modified the install script to properly install

This commit is contained in:
2026-08-14 16:35:06 -05:00
parent 2b3a787fb6
commit 9dd44796d6
4 changed files with 357 additions and 2493 deletions
+14 -3
View File
@@ -45,6 +45,9 @@ pub fn client_install() -> Result<(), Box<dyn Error>> {
module_path.push("custom");
create_dir_all(&module_path)?;
module_path.pop();
let mut victim_path = config_path.clone();
victim_path.push("victim");
create_dir_all(&victim_path)?;
let current_files_path = PathBuf::from(get_user_input(
"enter the path to store currently in progress project files (not notes), or none if you want to be propted everytime",
)?);
@@ -80,8 +83,11 @@ pub fn client_install() -> Result<(), Box<dyn Error>> {
client_config_file.write("servers: 127.0.0.1:31337\n".as_bytes())?;
let mut default_project_file = File::create(projects_path)?;
config_path.pop();
config_path.push("server.conf");
let mut server_config_file = File::create(&config_path)?;
let mut server_path = config_path.clone();
server_path.push("server");
create_dir_all(&server_path)?;
server_path.push("server.conf");
let mut server_config_file = File::create(&server_path)?;
server_config_file.write("address: 127.0.0.1:31337\n".as_bytes())?;
server_config_file.write("running: false\n".as_bytes())?;
default_project_file.write("org_name: default\n".as_bytes())?;
@@ -104,7 +110,7 @@ pub fn client_install() -> Result<(), Box<dyn Error>> {
client_config_file.write(format!("term_cmd: {}\n", term_cmd).as_bytes())?;
client_config_file.write(format!("tools: {}\n", tools_folder).as_bytes())?;
println!("\ndefault config files written!");
println!("downloading default notes and modules...");
println!("downloading note templates, victim templates, and modules...");
create_dir_all("./temp")?;
env::set_current_dir("./temp")?;
let git_clone_status = Command::new("git")
@@ -126,6 +132,11 @@ pub fn client_install() -> Result<(), Box<dyn Error>> {
let entry = entry?;
copy(entry.path(), default_module_path.clone(), &options)?;
}
println!("copying default victim templates...");
for entry in read_dir("./tetanus/victim_templates")? {
let entry = entry?;
copy(entry.path(), victim_path.clone(), &options)?;
}
env::set_current_dir("../")?;
remove_dir_all("./temp")?;
}