-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ Add browser stealer artefact
- Loading branch information
Showing
5 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters