Skip to content

Commit

Permalink
feat: ✨ Add browser stealer artefact
Browse files Browse the repository at this point in the history
  • Loading branch information
frack113 committed Jun 9, 2024
1 parent f0e11df commit 7607fec
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 2 deletions.
31 changes: 30 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[package]
name = "wag"
version = "1.0.0"
version = "1.1.0"
edition = "2021"
description = "Windows Artefact Generator"

Expand Down Expand Up @@ -41,3 +41,4 @@ rand = "0"
regex_generate = "0"
widestring = "1"
sysinfo = "0.30.5"
walkdir = "2.5.0"
4 changes: 4 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

use crate::commands::ads::ADS;
use crate::commands::browserstealer::BrowserStealer;
use crate::commands::file::FileCreate;
use crate::commands::mutex::Mutex;
use crate::commands::namepipe::NamePipe;
Expand All @@ -38,6 +39,7 @@ impl Arguments {
Some(Commands::Mutex(mutex)) => mutex.run(),
Some(Commands::BYOVD(byovd)) => byovd.run(),
Some(Commands::PPID(ppid)) => ppid.run(),
Some(Commands::BrowserStealer(mystealer)) => mystealer.run(),
None => {
return 2;
}
Expand All @@ -59,4 +61,6 @@ pub enum Commands {
BYOVD(BYOVD),
#[clap(arg_required_else_help = true)]
PPID(PPID),
#[clap(arg_required_else_help = false)]
BrowserStealer(BrowserStealer),
}
56 changes: 56 additions & 0 deletions src/commands/browserstealer.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// SPDX-FileCopyrightText: 2023 The WAG development team
//
// SPDX-License-Identifier: GPL-3.0-or-later

//
// Mimic stealer action on file
//
// Last update 20240609

use std::env;
use std::fs;
use walkdir::WalkDir;

// Some others
use crate::commands::tools::EXIST_ALL_GOOD;
use clap::ArgAction;
use clap::Parser;

#[derive(Parser)]
pub struct BrowserStealer {
#[clap(short = 'c', long, help = "Compress file into the default temp", action=ArgAction::SetFalse,required = false)]
compress: bool,
}

fn steal_file(name: walkdir::DirEntry, temp: &str) {
let infile: String = name.path().display().to_string();
let outfile: String =
temp.to_owned() + &String::from('\\') + name.file_name().to_str().unwrap();
fs::copy(infile, outfile).unwrap();
}

impl BrowserStealer {
/* Version 202406xx */
pub fn run(&self) -> i32 {
let sensitive_file = ["key4.db", "cookies.sqlite"];
println!("Mimic stealer file access ");
if self.compress {
println!("No compress for now :)");
}

let userprofile = env::var("USERPROFILE").unwrap();
println!("😈 looking in the folder {}", userprofile);

let tempfolder = env::var("TEMP").unwrap();

for entry in WalkDir::new(userprofile).into_iter().filter_map(|e| e.ok()) {
let filename: &str = entry.file_name().to_str().unwrap();
if sensitive_file.contains(&&filename) {
println!("😈 stealing the file {}", filename);
steal_file(entry, &tempfolder);
}
}

return EXIST_ALL_GOOD;
}
}
1 change: 1 addition & 0 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

pub mod ads;
pub mod browserstealer;
pub mod file;
pub mod mutex;
pub mod namepipe;
Expand Down

0 comments on commit 7607fec

Please sign in to comment.