From 2dc256f62101ac03b098164da3ed62ecf2b0753b Mon Sep 17 00:00:00 2001 From: Matt Ehrnschwender Date: Sat, 10 Feb 2024 15:30:26 -0500 Subject: [PATCH] More additions, need to fix CI and do Windows things --- Payload_Type/thanatos/agent/Cargo.lock | 2 + Payload_Type/thanatos/agent/Cargo.toml | 1 + .../thanatos/agent/cryptolib/Cargo.toml | 1 + .../agent/cryptolib/src/hash/internal.rs | 6 ++ .../thanatos/agent/cryptolib/src/hash/mod.rs | 12 +-- .../agent/cryptolib/src/hash/system/linux.rs | 6 ++ .../agent/cryptolib/src/hash/system/mod.rs | 12 +-- .../agent/ffiwrappers/src/linux/mod.rs | 4 +- .../ffiwrappers/src/windows/bcrypt/mod.rs | 2 +- .../agent/ffiwrappers/src/windows/domain.rs | 76 ++++++++++++++++ .../agent/ffiwrappers/src/windows/mod.rs | 3 + .../thanatos/agent/thanatos_core/Cargo.toml | 4 + .../agent/thanatos_core/src/guardrails.rs | 30 ++++--- .../thanatos/agent/thanatos_core/src/lib.rs | 18 ++-- .../thanatos_core/src/native/linux/domain.rs | 87 ------------------- .../thanatos_core/src/native/linux/mod.rs | 1 - .../thanatos_core/src/native/linux/system.rs | 86 ++++++++++++++++-- .../thanatos_core/src/native/windows/mod.rs | 4 +- .../src/native/windows/system.rs | 6 -- .../agent/thanatos_http/binary/src/main.rs | 1 + .../agent/thanatos_http/cdylib/src/lib.rs | 2 + 21 files changed, 220 insertions(+), 144 deletions(-) create mode 100644 Payload_Type/thanatos/agent/ffiwrappers/src/windows/domain.rs delete mode 100644 Payload_Type/thanatos/agent/thanatos_core/src/native/linux/domain.rs delete mode 100644 Payload_Type/thanatos/agent/thanatos_core/src/native/windows/system.rs diff --git a/Payload_Type/thanatos/agent/Cargo.lock b/Payload_Type/thanatos/agent/Cargo.lock index 36dbc94..fcffe11 100644 --- a/Payload_Type/thanatos/agent/Cargo.lock +++ b/Payload_Type/thanatos/agent/Cargo.lock @@ -85,6 +85,7 @@ dependencies = [ name = "cryptolib" version = "0.2.0" dependencies = [ + "cfg-if", "ffiwrappers", "hex-literal", "openssl", @@ -396,6 +397,7 @@ name = "thanatos_core" version = "0.2.0" dependencies = [ "base64", + "cfg-if", "config", "cryptolib", "dbus", diff --git a/Payload_Type/thanatos/agent/Cargo.toml b/Payload_Type/thanatos/agent/Cargo.toml index f2c10ee..35b8bd8 100644 --- a/Payload_Type/thanatos/agent/Cargo.toml +++ b/Payload_Type/thanatos/agent/Cargo.toml @@ -31,6 +31,7 @@ version = "0.2.0" ##### WORKSPACE DEPENDENCIES ##### [workspace.dependencies] base64 = "0.21.5" +cfg-if = "1" hex-literal = "0.4.1" rmp = "0.8.12" rmp-serde = "1.1.2" diff --git a/Payload_Type/thanatos/agent/cryptolib/Cargo.toml b/Payload_Type/thanatos/agent/cryptolib/Cargo.toml index b00b6f2..082afdf 100644 --- a/Payload_Type/thanatos/agent/cryptolib/Cargo.toml +++ b/Payload_Type/thanatos/agent/cryptolib/Cargo.toml @@ -9,6 +9,7 @@ version.workspace = true [dependencies] hex-literal.workspace = true +cfg-if.workspace = true [dependencies.sha2] workspace = true diff --git a/Payload_Type/thanatos/agent/cryptolib/src/hash/internal.rs b/Payload_Type/thanatos/agent/cryptolib/src/hash/internal.rs index d5966c5..394b461 100644 --- a/Payload_Type/thanatos/agent/cryptolib/src/hash/internal.rs +++ b/Payload_Type/thanatos/agent/cryptolib/src/hash/internal.rs @@ -17,6 +17,12 @@ impl Sha256 { } } +impl Default for Sha256 { + fn default() -> Self { + Self::new() + } +} + #[cfg(test)] mod tests { use super::Sha256; diff --git a/Payload_Type/thanatos/agent/cryptolib/src/hash/mod.rs b/Payload_Type/thanatos/agent/cryptolib/src/hash/mod.rs index 357779d..2321a2e 100644 --- a/Payload_Type/thanatos/agent/cryptolib/src/hash/mod.rs +++ b/Payload_Type/thanatos/agent/cryptolib/src/hash/mod.rs @@ -1,11 +1,5 @@ #[cfg(feature = "internal")] -mod internal; +pub mod internal; -#[cfg(feature = "internal")] -pub use internal::*; - -//#[cfg(feature = "system")] -mod system; - -//#[cfg(feature = "system")] -pub use system::*; +#[cfg(feature = "system")] +pub mod system; diff --git a/Payload_Type/thanatos/agent/cryptolib/src/hash/system/linux.rs b/Payload_Type/thanatos/agent/cryptolib/src/hash/system/linux.rs index 8e28acf..aec44e8 100644 --- a/Payload_Type/thanatos/agent/cryptolib/src/hash/system/linux.rs +++ b/Payload_Type/thanatos/agent/cryptolib/src/hash/system/linux.rs @@ -15,6 +15,12 @@ impl Sha256 { } } +impl Default for Sha256 { + fn default() -> Self { + Self::new() + } +} + #[cfg(test)] mod tests { use super::Sha256; diff --git a/Payload_Type/thanatos/agent/cryptolib/src/hash/system/mod.rs b/Payload_Type/thanatos/agent/cryptolib/src/hash/system/mod.rs index 0c39569..436cf50 100644 --- a/Payload_Type/thanatos/agent/cryptolib/src/hash/system/mod.rs +++ b/Payload_Type/thanatos/agent/cryptolib/src/hash/system/mod.rs @@ -1,11 +1,11 @@ -//#[cfg(target_os = "linux")] -//mod linux; +#[cfg(target_os = "linux")] +mod linux; -//#[cfg(target_os = "linux")] -//pub use linux::Sha256; +#[cfg(target_os = "linux")] +pub use linux::Sha256; -//#[cfg(target_os = "windows")] +#[cfg(target_os = "windows")] mod windows; -//#[cfg(target_os = "windows")] +#[cfg(target_os = "windows")] pub use windows::Sha256; diff --git a/Payload_Type/thanatos/agent/ffiwrappers/src/linux/mod.rs b/Payload_Type/thanatos/agent/ffiwrappers/src/linux/mod.rs index 0389652..dec8c10 100644 --- a/Payload_Type/thanatos/agent/ffiwrappers/src/linux/mod.rs +++ b/Payload_Type/thanatos/agent/ffiwrappers/src/linux/mod.rs @@ -8,7 +8,5 @@ pub use username::username; pub fn libc_errno() -> i32 { // SAFETY: `__errno_location` is a pointer to libc's errno value. This pointer // is guaranteed to be aligned and non-NULL - let ec = unsafe { *libc::__errno_location() }; - - ec + unsafe { *libc::__errno_location() } } diff --git a/Payload_Type/thanatos/agent/ffiwrappers/src/windows/bcrypt/mod.rs b/Payload_Type/thanatos/agent/ffiwrappers/src/windows/bcrypt/mod.rs index eb92c86..49fbeef 100644 --- a/Payload_Type/thanatos/agent/ffiwrappers/src/windows/bcrypt/mod.rs +++ b/Payload_Type/thanatos/agent/ffiwrappers/src/windows/bcrypt/mod.rs @@ -2,7 +2,7 @@ mod alghandle; pub use alghandle::{BCryptAlgHandle, BCryptProvider}; mod hash; -pub use hash::*; +pub use hash::BCryptHashHandle; pub mod algorithms; diff --git a/Payload_Type/thanatos/agent/ffiwrappers/src/windows/domain.rs b/Payload_Type/thanatos/agent/ffiwrappers/src/windows/domain.rs new file mode 100644 index 0000000..fb41c2a --- /dev/null +++ b/Payload_Type/thanatos/agent/ffiwrappers/src/windows/domain.rs @@ -0,0 +1,76 @@ +use errors::ThanatosError; + +use windows::{ + core::PSTR, + Win32::{ + Foundation::ERROR_MORE_DATA, + System::SystemInformation::{ComputerNameDnsDomain, GetComputerNameExA}, + }, +}; + +/// Get the domain name of the system +pub fn domain() -> Result { + let mut domainname_length = 0u32; + + // Get the length of the computer's domain name. + // + // SAFETY: This will return an error from Windows which needs to be checked. + // If this is "successful", then the Windows error should contain 'ERROR_MORE_DATA'. + // This is the error code returned when the buffer is not large enough. + match unsafe { + GetComputerNameExA( + ComputerNameDnsDomain, + PSTR(std::ptr::null_mut()), + &mut domainname_length, + ) + } { + // Check if 'ERROR_MORE_DATA' was returned + Err(e) if e.code() == windows::core::Error::from(ERROR_MORE_DATA).code() => (), + + // Check if any other error was returned + Err(e) => return Err(ThanatosError::from_windows(e)), + + // This function should never return successfully since the length is 0 + _ => unreachable!(), + }; + + // Create a buffer for storing the domain name + // + // The length can safely be casted to a usize using as since the maximum length + // of a Windows domain name is 255 characters. + // ref: https://learn.microsoft.com/en-US/troubleshoot/windows-server/identity/naming-conventions-for-computer-domain-site-ou#dns-domain-names + let mut domainname_buffer = vec![0u8; domainname_length as usize]; + + // Get the computer's domain name. + // + // SAFETY: A buffer needs to be allocated for holding the domain name. The + // length of the domain was found above. The domain name length must match the + // length of the allocated buffer! An error needs to be checked in case the function fails + unsafe { + GetComputerNameExA( + ComputerNameDnsDomain, + PSTR(domainname_buffer.as_mut_ptr()), + &mut domainname_length, + ) + } + .map_err(ThanatosError::from_windows)?; + + // Cast the domain name length. + // The domain name length value now contains the length of the system's domain name + // without the NULL terminator. + // ref: https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getcomputernameexa + let domainname_length = domainname_length as usize; + + // Convert the domain name buffer to a string + let s = String::from_utf8_lossy(&domainname_buffer[..domainname_length]); + Ok(s.into_owned()) +} + +#[cfg(test)] +mod tests { + #[test] + fn domainname() { + let domain = super::domain().unwrap(); + dbg!(domain); + } +} diff --git a/Payload_Type/thanatos/agent/ffiwrappers/src/windows/mod.rs b/Payload_Type/thanatos/agent/ffiwrappers/src/windows/mod.rs index 1662158..43808d3 100644 --- a/Payload_Type/thanatos/agent/ffiwrappers/src/windows/mod.rs +++ b/Payload_Type/thanatos/agent/ffiwrappers/src/windows/mod.rs @@ -4,4 +4,7 @@ pub use hostname::hostname; mod username; pub use username::username; +mod domain; +pub use domain::domain; + pub mod bcrypt; diff --git a/Payload_Type/thanatos/agent/thanatos_core/Cargo.toml b/Payload_Type/thanatos/agent/thanatos_core/Cargo.toml index 385d24b..1d64de4 100644 --- a/Payload_Type/thanatos/agent/thanatos_core/Cargo.toml +++ b/Payload_Type/thanatos/agent/thanatos_core/Cargo.toml @@ -9,6 +9,7 @@ version.workspace = true [dependencies] base64.workspace = true +cfg-if.workspace = true rmp.workspace = true rmp-serde.workspace = true serde.workspace = true @@ -35,3 +36,6 @@ path = "../utils" [target.'cfg(target_os = "linux")'.dependencies] dbus.workspace = true + +[features] +crypto-system = ["cryptolib/system"] diff --git a/Payload_Type/thanatos/agent/thanatos_core/src/guardrails.rs b/Payload_Type/thanatos/agent/thanatos_core/src/guardrails.rs index 924175f..ae05606 100644 --- a/Payload_Type/thanatos/agent/thanatos_core/src/guardrails.rs +++ b/Payload_Type/thanatos/agent/thanatos_core/src/guardrails.rs @@ -4,8 +4,16 @@ use crate::native::linux::system; #[cfg(target_os = "windows")] use crate::native::windows::system; +cfg_if::cfg_if! { + if #[cfg(feature = "crypto-system")] { + use cryptolib::hash::system::Sha256; + } else { + use cryptolib::hash::internal::Sha256; + } +} + #[cfg(target_os = "linux")] -pub fn check_domain(domains: &Vec<[u8; 32]>) -> bool { +pub fn check_domain(domains: &[[u8; 32]]) -> bool { let check_domains = match system::domains() { Ok(check_domains) => check_domains, Err(_) => return false, @@ -17,16 +25,16 @@ pub fn check_domain(domains: &Vec<[u8; 32]>) -> bool { } #[cfg(target_os = "windows")] -pub fn check_domain(domains: &Vec<[u8; 32]>) -> bool { +pub fn check_domain(domains: &[[u8; 32]]) -> bool { let domain = match system::domain() { Ok(domain) => domain, Err(_) => return false, }; - check_hashlist_with(domains, domain) + check_hashlist_with(domains, &domain) } -pub fn check_hostname(hostnames: &Vec<[u8; 32]>) -> bool { +pub fn check_hostname(hostnames: &[[u8; 32]]) -> bool { let hostname = match system::hostname() { Ok(hostname) => hostname, Err(_) => return false, @@ -35,7 +43,7 @@ pub fn check_hostname(hostnames: &Vec<[u8; 32]>) -> bool { check_hashlist_with(hostnames, &hostname) } -pub fn check_username(usernames: &Vec<[u8; 32]>) -> bool { +pub fn check_username(usernames: &[[u8; 32]]) -> bool { let username = match system::username() { Ok(username) => username, Err(_) => return false, @@ -44,10 +52,10 @@ pub fn check_username(usernames: &Vec<[u8; 32]>) -> bool { check_hashlist_with(usernames, &username) } -fn check_hashlist_with(hlist: &Vec<[u8; 32]>, value: &str) -> bool { +fn check_hashlist_with(hlist: &[[u8; 32]], value: &str) -> bool { let value = value.to_lowercase(); - let mut h = cryptolib::hash::Sha256::new(); + let mut h = Sha256::new(); h.update(value.as_bytes()); let result = h.finalize(); hlist.iter().any(|v| v == &result) @@ -64,7 +72,7 @@ mod tests { "6b0a38edbe6d724b1679bf3ba6ed862975b2403019c7a95f8257d4e840d60df1" )]; - assert!(check_hashlist_with(&hlist_with_value, &input_value)); + assert!(check_hashlist_with(&hlist_with_value, input_value)); } #[test] @@ -75,7 +83,7 @@ mod tests { "795b6904e54f82411df4b0e27a373a55eea3f9d66dac5a9bce1dd92f7b401da5" )]; - assert!(!check_hashlist_with(&hlist_without_value, &input_value)); + assert!(!check_hashlist_with(&hlist_without_value, input_value)); } #[test] @@ -86,7 +94,7 @@ mod tests { "6b0a38edbe6d724b1679bf3ba6ed862975b2403019c7a95f8257d4e840d60df1" )]; - assert!(check_hashlist_with(&hlist, &input_value)); + assert!(check_hashlist_with(&hlist, input_value)); } #[test] @@ -101,6 +109,6 @@ mod tests { #[test] fn empty_domain_list() { - assert_eq!(check_hashlist_with(&Vec::new(), "foo"), false); + assert!(!check_hashlist_with(&Vec::new(), "foo")); } } diff --git a/Payload_Type/thanatos/agent/thanatos_core/src/lib.rs b/Payload_Type/thanatos/agent/thanatos_core/src/lib.rs index 4a98848..28f23e5 100644 --- a/Payload_Type/thanatos/agent/thanatos_core/src/lib.rs +++ b/Payload_Type/thanatos/agent/thanatos_core/src/lib.rs @@ -11,24 +11,18 @@ where F: Fn(&'a ConfigVars<'b>), { let domains = config.domains(); - if !domains.is_empty() { - if !guardrails::check_domain(domains) { - return; - } + if !domains.is_empty() && !guardrails::check_domain(domains) { + return; } let hostnames = config.hostnames(); - if !hostnames.is_empty() { - if !guardrails::check_hostname(hostnames) { - return; - } + if !hostnames.is_empty() && !guardrails::check_hostname(hostnames) { + return; } let usernames = config.usernames(); - if !usernames.is_empty() { - if !guardrails::check_username(usernames) { - return; - } + if !usernames.is_empty() && !guardrails::check_username(usernames) { + return; } f(config) diff --git a/Payload_Type/thanatos/agent/thanatos_core/src/native/linux/domain.rs b/Payload_Type/thanatos/agent/thanatos_core/src/native/linux/domain.rs deleted file mode 100644 index e0c29de..0000000 --- a/Payload_Type/thanatos/agent/thanatos_core/src/native/linux/domain.rs +++ /dev/null @@ -1,87 +0,0 @@ -use dbus::blocking::{stdintf::org_freedesktop_dbus::Properties, BlockingSender}; -use errors::ThanatosError; - -const DBUS_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(5); - -/// Gets the system's joined domains -pub fn domains() -> Result, ThanatosError> { - let conn = dbus::blocking::Connection::new_system().map_err(ThanatosError::DbusError)?; - - if check_domain_joined(&conn)? == false { - return Err(ThanatosError::NotDomainJoined); - } - - let realm_paths = get_realm_paths(&conn)?; - - Ok(realm_paths - .into_iter() - .map_while(|realm_path| { - let proxy = dbus::blocking::Proxy::new( - "org.freedesktop.realmd", - realm_path, - DBUS_TIMEOUT, - &conn, - ); - - let configured: String = proxy - .get("org.freedesktop.realmd.Realm", "Configured") - .ok()?; - - (!configured.is_empty()) - .then(|| proxy.get("org.freedesktop.realmd.Realm", "Name").ok()) - .flatten() - }) - .collect::>()) -} - -fn get_realm_paths( - conn: &dbus::blocking::Connection, -) -> Result, ThanatosError> { - let proxy = dbus::blocking::Proxy::new( - "org.freedesktop.realmd", - "/org/freedesktop/realmd", - DBUS_TIMEOUT, - conn, - ); - - proxy - .get("org.freedesktop.realmd.Provider", "Realms") - .map_err(ThanatosError::DbusError) -} - -fn check_domain_joined(conn: &dbus::blocking::Connection) -> Result { - let msg = dbus::message::Message::new_method_call( - "org.freedesktop.DBus", - "/org/freedesktop/DBus", - "org.freedesktop.DBus", - "ListActivatableNames", - ) - .unwrap(); - - let reply = conn - .send_with_reply_and_block(msg, DBUS_TIMEOUT) - .map_err(ThanatosError::DbusError)?; - - let services: Vec = reply.get1().unwrap(); - - Ok(services - .iter() - .find(|&svc| svc == "org.freedesktop.realmd") - .is_some()) -} - -#[cfg(test)] -mod tests { - use errors::ThanatosError; - - #[test] - fn domain_test() { - let domains = super::domains(); - - match domains { - Ok(_) => (), - Err(ThanatosError::NotDomainJoined) => (), - e => panic!("{:?}", e), - } - } -} diff --git a/Payload_Type/thanatos/agent/thanatos_core/src/native/linux/mod.rs b/Payload_Type/thanatos/agent/thanatos_core/src/native/linux/mod.rs index 31ce9a7..ac77f63 100644 --- a/Payload_Type/thanatos/agent/thanatos_core/src/native/linux/mod.rs +++ b/Payload_Type/thanatos/agent/thanatos_core/src/native/linux/mod.rs @@ -1,2 +1 @@ -mod domain; pub mod system; diff --git a/Payload_Type/thanatos/agent/thanatos_core/src/native/linux/system.rs b/Payload_Type/thanatos/agent/thanatos_core/src/native/linux/system.rs index 9c4510d..b0439c1 100644 --- a/Payload_Type/thanatos/agent/thanatos_core/src/native/linux/system.rs +++ b/Payload_Type/thanatos/agent/thanatos_core/src/native/linux/system.rs @@ -1,13 +1,85 @@ +use dbus::blocking::{stdintf::org_freedesktop_dbus::Properties, BlockingSender}; use errors::ThanatosError; +pub use ffiwrappers::linux::{hostname, username}; -/// Gets the system's hostname -pub fn hostname() -> Result { - ffiwrappers::linux::hostname() +const DBUS_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(5); + +/// Gets the system's joined domains +pub fn domains() -> Result, ThanatosError> { + let conn = dbus::blocking::Connection::new_system().map_err(ThanatosError::DbusError)?; + + if !check_domain_joined(&conn)? { + return Err(ThanatosError::NotDomainJoined); + } + + let realm_paths = get_realm_paths(&conn)?; + + Ok(realm_paths + .into_iter() + .map_while(|realm_path| { + let proxy = dbus::blocking::Proxy::new( + "org.freedesktop.realmd", + realm_path, + DBUS_TIMEOUT, + &conn, + ); + + let configured: String = proxy + .get("org.freedesktop.realmd.Realm", "Configured") + .ok()?; + + (!configured.is_empty()) + .then(|| proxy.get("org.freedesktop.realmd.Realm", "Name").ok()) + .flatten() + }) + .collect::>()) } -/// Gets the system's username -pub fn username() -> Result { - ffiwrappers::linux::username() +fn get_realm_paths( + conn: &dbus::blocking::Connection, +) -> Result, ThanatosError> { + let proxy = dbus::blocking::Proxy::new( + "org.freedesktop.realmd", + "/org/freedesktop/realmd", + DBUS_TIMEOUT, + conn, + ); + + proxy + .get("org.freedesktop.realmd.Provider", "Realms") + .map_err(ThanatosError::DbusError) } -pub use super::domain::domains; +fn check_domain_joined(conn: &dbus::blocking::Connection) -> Result { + let msg = dbus::message::Message::new_method_call( + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus", + "ListActivatableNames", + ) + .unwrap(); + + let reply = conn + .send_with_reply_and_block(msg, DBUS_TIMEOUT) + .map_err(ThanatosError::DbusError)?; + + let services: Vec = reply.get1().unwrap(); + + Ok(services.iter().any(|svc| svc == "org.freedesktop.realmd")) +} + +#[cfg(test)] +mod tests { + use errors::ThanatosError; + + #[test] + fn domain_test() { + let domains = super::domains(); + + match domains { + Ok(_) => (), + Err(ThanatosError::NotDomainJoined) => (), + e => panic!("{:?}", e), + } + } +} diff --git a/Payload_Type/thanatos/agent/thanatos_core/src/native/windows/mod.rs b/Payload_Type/thanatos/agent/thanatos_core/src/native/windows/mod.rs index ac77f63..33ae00d 100644 --- a/Payload_Type/thanatos/agent/thanatos_core/src/native/windows/mod.rs +++ b/Payload_Type/thanatos/agent/thanatos_core/src/native/windows/mod.rs @@ -1 +1,3 @@ -pub mod system; +pub mod system { + pub use ffiwrappers::windows::{domain, hostname, username}; +} diff --git a/Payload_Type/thanatos/agent/thanatos_core/src/native/windows/system.rs b/Payload_Type/thanatos/agent/thanatos_core/src/native/windows/system.rs deleted file mode 100644 index 6990921..0000000 --- a/Payload_Type/thanatos/agent/thanatos_core/src/native/windows/system.rs +++ /dev/null @@ -1,6 +0,0 @@ -use errors::ThanatosError; - -/// Gets the system's hostname -pub fn hostname() -> Result { - ffiwrappers::windows::hostname() -} diff --git a/Payload_Type/thanatos/agent/thanatos_http/binary/src/main.rs b/Payload_Type/thanatos/agent/thanatos_http/binary/src/main.rs index 2c980e4..4339b87 100644 --- a/Payload_Type/thanatos/agent/thanatos_http/binary/src/main.rs +++ b/Payload_Type/thanatos/agent/thanatos_http/binary/src/main.rs @@ -1,3 +1,4 @@ +#![cfg(not(test))] #![cfg_attr( all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows" diff --git a/Payload_Type/thanatos/agent/thanatos_http/cdylib/src/lib.rs b/Payload_Type/thanatos/agent/thanatos_http/cdylib/src/lib.rs index 5139c52..c302449 100644 --- a/Payload_Type/thanatos/agent/thanatos_http/cdylib/src/lib.rs +++ b/Payload_Type/thanatos/agent/thanatos_http/cdylib/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg(not(test))] + const CONFIG: &[u8] = include_bytes!(env!("CONFIG")); pub fn foo() {