AI Waifu RAT LLM Enabled Backdoor for Remote Code Execution

AI Waifu RAT LLM Enabled Backdoor for Remote Code Execution

An LLM role-playing community was targeted with a backdoor disguised as an “AI Waifu” feature that provides arbitrary code execution and file access via a local agent listening on 127.0.0.1:9999 and 127.0.0.1:4444, enabling remote command execution, file exfiltration, and staged payload delivery. Publicly disclosed IoCs include SHA256 hashes, filenames, local HTTP endpoints, registry persistence key FakeUpdater, and hosting URLs linked to actors using aliases such as KazePsi/PsionicZephyr and Enclave0775. #AIWaifuRAT #PsionicZephyr

Keypoints

  • The “AI Waifu RAT” was distributed in an LLM role-playing community as a “meta” feature enabling the AI to read files and execute code on the host.
  • The local agent listens on fixed ports (127.0.0.1:9999 and 127.0.0.1:4444) and exposes endpoints /execute_trusted, /execute, and /readfile allowing command execution and file exfiltration.
  • Social engineering was the primary distribution vector: the author urged users to whitelist or disable antivirus and presented themselves as a “CTF player” researcher.
  • A related dropper/stager (nulla_re.exe) requests admin privileges, writes a Run key (FakeUpdater) for persistence, contains embedded shellcode and a reverse TCP stager, and can download/execute stage2 payloads.
  • Multiple primitive anti-analysis techniques (anti-VM, anti-debug), outdated APIs, and masquerading as CTF challenges were used to hinder scrutiny and deceive analysts.
  • Threat actors used multiple hosting providers and accounts (GitGud, GitHub, Mega, OneDrive, IPFS intent) to evade takedown and employed compression/encryption and compile-after-delivery tactics.
  • Attribution points to low-skilled but socially adept actors using aliases KazePsi / PsionicZephyr and Enclave0775; incident reported to hosting providers and CERTs and repositories were takedown.

MITRE Techniques

  • [T1566] Phishing – The malware was distributed through community posts and social engineering posing as a desirable research project (“…presented themself as a helpful ‘CTF player’ and ‘technical researcher’…”).
  • [T1204.002] Malicious File – Users were asked to run executable files presented as features (“the ‘malicious file’ is disguised as a desirable software enhancement”).
  • [T1036] Masquerading – The author disguised malicious binaries as legitimate “CTF Challenge” and “AI character” artifacts (“This so-called ‘CTF Challenge’ is essentially a disguised malicious program / scareware / stager”).
  • [T1071.001] Web Protocols – The agent accepts plaintext HTTP requests from the LLM/web UI to the local C2 endpoints (“commands…sent to the local agent as plaintext HTTP requests”).
  • [T1059.001] PowerShell – /execute_trusted spawns powershell.exe via popen to run attacker-supplied commands (“spawning a powershell.exe process via popen for execution”).
  • [T1005] Data from Local System – The /readfile endpoint reads arbitrary local files and returns contents to C2 (“uses its path field as a file path argument, and reads the file’s contents…sending it back to the C&C source”).
  • [T1041] Exfiltration Over C2 Channel – Read file contents are sent back to the C2 over the agent channel (“sending it back to the C&C source”).
  • [T1562.001] Disable or Modify Tools – The author instructs users to whitelist or disable antivirus to avoid detection (“If your antivirus flags this, add it to the whitelist or turn it off temporarily”).
  • [T1059.007] JavaScript – Prior web-based components executed untrusted LLM-generated code using eval/new Function(), creating remote code execution on the page (“directly execute LLM-generated code in the frontend JavaScript using an eval()-like new Function()”).
  • [T1547.001] Registry Run Keys / Startup Folder – The challenge writes a Run key for persistence (FakeUpdater) (“writing to the registry to establish persistence…FakeUpdater register key”).
  • [T1673] Virtual Machine Discovery – The binary queries SystemProductName to detect virtual machine environments (“extract the SystemProductName field from the registry … to check for strings from well-known virtual machine vendors”).
  • [T1622] Debugger Evasion – The program uses checks like NtQueryInformationProcess, CheckRemoteDebuggerPresent, IsDebuggerPresent, and PEB->BeingDebugged (“classic, entry-level debugger detection methods…CheckRemoteDebuggerPresent and IsDebuggerPresent”).
  • [T1497.001] System Checks – Uses timing checks and window enumeration to detect analyst environments (“enumerating window class names, and using simple timing checks based on Windows API calls”).
  • [T1529] System Shutdown/Reboot – Malicious branch calls system() to forcibly shut down the user’s computer on consecutive wrong answers (“program immediately calls a system API to execute a shutdown command”).
  • [T1207.009] Embedded Payloads – The challenge contains hardcoded Metasploit reverse TCP shellcode embedded and executed (“fills it with hardcoded metasploit shellcode, then jumps to the shellcode, which is a classic reverse TCP shellcode”).
  • [T1620] Reflective Code Loading – The shellcode receives and executes a second-stage payload over a local socket (“listens on 127.0.0.1:4444 and receives the second stage payload through the socket and then executes it”).
  • [T1027.015] Compression – Actors distributed payloads inside compressed/encrypted archives to evade hash detection (“bypass hash-based detection…Compression”).
  • [T1027.013] Encrypted/Encoded File – Use of encrypted/encoded files and passwords for delivered archives (“file passwords listed for delivered archives”).
  • [T1027.004] Compile After Delivery – Actors planned to deliver source and compile later to change behavior post-delivery (“Compile After Delivery (T1027.004: Compile After Delivery)”).
  • [T1027.003] Steganography – Actors attempted additional evasion via steganography (“attempted further evasion using steganography”).
  • [T1608.001] Upload Malware – Actors intended to host files on decentralized storage (IPFS) to resist takedown (“plan to further host the malicious files on the InterPlanetary File System (IPFS)”).

Indicators of Compromise

  • [File Hashes] malware samples and archives – f64dbd93…02607c3088f5364…, fdf461a6bd7e806b…ac6f9, and 11b07ef15945d2f1e7cf192e49cbf670 (and multiple other listed hashes).
  • [File Names] distributed binaries – js_windows_executor.exe, nulla_re.exe, android_server.py.
  • [Network] local C2 endpoints / stager ports – HTTP to 127.0.0.1:9999 (agent C2), HTTP to 127.0.0.1:4444 (reverse TCP stager).
  • [Persistence] Registry Run key – HKCUSoftwareMicrosoftWindowsCurrentVersionRun Value Name: FakeUpdater (used to persist dropped FakeUpdater.exe).
  • [Hosting URLs] distribution locations (takedown noted) – https://gitgud.io/KazePsi/…/nulla_re.exe, https://github.com/PsionicZephyr/Files/…/js_windows_executor.exe, and multiple Mega/OneDrive links (all listed as already takedown).
  • [Actor Aliases] threat actor identifiers – KazePsi, PsionicZephyr, psinokaze, Enclave0775 (and variants including Chinese display names and [email protected]).


Read more: https://ryingo.gitbook.io/writeups-ai_waifu_rat