Benign lua Download

auth 0.0.3-1

“A library to get cookies from firefox or chrome.”

References a browser Safe Storage queryGitHub Actions workflow definition path
SHA-25614c51047c161fa2c6bfcf3e61aa76f47df3f072dd60335ca0bcc42a90b63a8cf

Evidence

imports aes::Aes128 lines 1–27
1use aes::Aes128;
2use aes_gcm::{
3 aead::{Aead, KeyInit},
4 Aes128Gcm,
5};
6use base64::{engine::general_purpose, Engine as _};
7use block_modes::block_padding::Pkcs7;
8use block_modes::{BlockMode, Cbc};
9use dirs;
10use hmac::Hmac;
11use mlua::{Error as LuaError, Lua, Result as LuaResult};
12use pbkdf2::{pbkdf2, pbkdf2_hmac};
13use rusqlite::Connection;
14use serde_json::Value;
15use sha1::Sha1;
16use std::fs;
17use std::path::PathBuf;
18use std::{error::Error, fmt, process::Command};
19pub mod encrypt;
20
21const SALT: &[u8] = b"saltysalt";
22type Aes128Cbc = Cbc<Aes128, Pkcs7>;
23
⋯4 lines
Chromium Safe Storage keychain service name lines 86–99
86:16… eError::JsonErr(err.to_string())
87 }
88}
89
90/// Get the Chrome password from macOS Keychain (legacy versions)
91fn get_chrome_password_macos() -> Result<String, ChromeCookieError> {
92 let out = Command::new("security")
93 .args(&["find-generic-password", "-w", "-s", "Chrome Safe Storage"])
94 .output()?;
95 Ok(String::from_utf8(out.stdout)?.trim().to_string())
⋯4 lines
Chrome Linux config directory path lines 99–114
99:54… meCookieError> {
100 use serde_json::Value;
101 use std::env;
102 use std::fs;
103
104 let home_dir = env::var("HOME").map_err(|_| ChromeCookieError::JsonErr("No HOME env".into()))?;
105 let local_state_path = format!("{}/.config/google-chrome/Local State", home_dir);
106 let data = fs::read_to_string(local_state_path)?;
107 let v: Value = serde_json::from_str(&data)?;
108 let key = v["os_crypt"]["encrypted_key"]
109 .as_str()
110 .ok_or_else(|| ChromeCookieError::JsonErr("No encrypted_key found".into()))?;
⋯4 lines
Chrome macOS Application Support path lines 132–136
132:5… t mut ls = PathBuf::from(dirs::home_dir().unwrap());
133 ls.push("Library/Application Support/Google/Chrome/Local State");
134 let txt = fs::read_to_string(ls)?;
135 let json: Value = serde_json::from_str(&txt)
136 .map_err(|_| ChromeCookieError::Decr …
Rust decodes an iterator item lines 139–144
139 .ok_or_else(|| ChromeCookieError::DecryptionFailed("missing os_crypt.encrypted_key".into()))?;
140 let mut blob = general_purpose::STANDARD
141 .decode(b64)
142 .map_err(|_| ChromeCookieError::DecryptionFailed("Base64 decode error".into()))?;
143 if blob.starts_with(b"DPAPI") {
144 blo …

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.