Posted in OpenAI

GitHub - jp101216/LiveResponse-NG: Live-response triage agent for Windows and Linux DFIR: ~120 ATT&CK-mapped…

jp101216 — Security Engineer | Offensive Security Research & Custom C2 Tooling

NIK C2: AN LLM INSIDE THE IMPLANT (PART 1 OF 2: WHAT IT IS AND HOW IT WORKS)

By jp101216, author of LiveResponse-NG (lrng) (https://github.com/jp101216/LiveResponse-NG)

TL;DR. On October 29, 2026, Cisco Talos disclosed NIK C2, a Go-based Windows RAT and C2 framework. Its implant has its own OpenAI Chat Completions client, so an operator can feed stolen data to an LLM from inside the compromised session. If the operator doesn't supply a key, the implant uses the victim's OPENAI_API_KEY. Under the AI feature it's a capable implant: over 50 commands covering credential theft, live keylogging, HVNC, reverse proxying, RDP operations, process hollowing, an AMSI bypass, a fodhelper UAC bypass, a "do not kill me" critical-process flag, back-dated files, an HTML screen locker, and bootkit staging. In this part I cover what the public reporting says, map it to ATT&CK, and list the IOCs. Part 2 shows how LiveResponse-NG detects each behavior, including the implants collector that shipped in v0.14 for this family, plus a triage workflow and hardening tips.

━━━━━━━━━━

WHY NIK C2 MATTERS

Most "AI malware" stories so far fall into two groups: code that a model helped write, or proofs of concept that ask a model what to do next. NIK C2 is different because the LLM is part of the operator's toolkit, called live from the victim's machine. Talos says the framework "reshapes adversary tradecraft by collapsing collection and exploitation into a single continuous session, effectively erasing the offline processing delays that historically granted defenders critical detection windows."

In practice, an intrusion used to go like this: steal data, exfiltrate it, have someone sort through it offline, then come back and act. Each of those gaps gave defenders a chance to notice. With NIK C2 the operator can dump credentials, stream keystrokes, and ask GPT-4 to summarize or act on what was collected, all in the same encrypted session, without leaving the host. Talos also saw the infrastructure live, so it assesses with moderate confidence that this is a working framework, not a proof of concept.

As a defender, the lesson I take from it is that signatures will lag a family that's under active development (Talos tracked at least three versions in a few days). Behavior is where to look, and an implant that does everything leaves a lot of behavior behind.

━━━━━━━━━━

WHAT NIK C2 IS

The implant

According to Talos, the implant is a 64-bit Windows remote access tool written in Go. All the samples they observed were built with Go 1.23.4. An embedded build path, /opt/nik_panel/data/build_52b79724a1fc4b8f/main.go, names the project "nik_panel" and shows the implant was cross-compiled for Windows on Linux. An eight-byte hex token matching the build ID suggests the operators track and version their builds.

On startup the implant checks its command-line arguments:

• watchdog starts a supervisor that relaunches the core process if it's terminated.

• copywatchdog tracks file-copy operations.

• No argument runs the primary agent.

In primary mode it takes a named mutex to stay single-instance, logs [NIK] Starting, generates a 32-byte session key, decodes its obfuscated C2 address, and sets its masquerade name to svchost.exe or simvol.exe. It writes its PID to the user's temp folder, copies itself to %AppData%\Roaming\Microsoft\Network with modified access controls, sets autostart registry entries, starts a local proxy server, and begins its C2 loops.

Version history

Talos built a timeline of at least three versions from first-seen dates in OSINT (as summarized by SOCtember):

• v1 — First seen: Aug 12, 2026; Notable additions: Keylogger, reverse proxy, screen capture, Discord token grabber

• v2 — First seen: Aug 14, 2026; Notable additions: HVNC, RDP session hijacking, AMSI and UAC bypasses, Telegram and Discord stealers

• v3 — First seen: Aug 17, 2026; Notable additions: OpenAI GPT-4 integration, audio/video capture, screen-locking ransomware, MBR backup

C2 architecture

NIK C2 uses two channels that run at the same time:

1. Primary: a WebSocket over TLS on port 443. The implant opens TCP with an 8-second timeout and adds :443 if no port is configured. It wraps the socket in TLS with a pinned certificate instead of trusting the system CA store, so a standard TLS-inspection proxy can't read the traffic. Immediately after the handshake it sends a registration message: hostname, LAN IP, username, user SID, the local reverse-proxy port, and upstream proxy settings read from the registry.

2. Fallback: HTTP polling about every 250 ms. Each poll POSTs a fresh state snapshot (hostname, watchdog status, local IP, username, timestamp, uptime) to /api/c2/update. Commands returned this way go through the same dispatcher. If a POST fails, the implant moves to the next server.

Resilience. C2 addresses come from three prioritized tiers: URLs updated at runtime, an embedded encrypted server list, and a hardcoded fallback address.

Crypto. Every message in both directions uses AES-256-GCM, with a key derived from a hardcoded seed that is stored obfuscated and decoded at startup. Each message gets a fresh 12-byte nonce. The nonce, ciphertext, and 16-byte tag are concatenated, Base64-encoded, and placed under an "e" key next to the plaintext agent ID (ag_ ). Talos published both the seed and the derived key (see IOCs), so if you have captured traffic you can decrypt it.

• /api/c2/update — Purpose (per Talos): Recon beacon / victim system info

• /api/c2/result — Purpose (per Talos): Command output exfiltration

• /api/c2/screen — Purpose (per Talos): Screenshot upload

• /api/c2/file_chunk — Purpose (per Talos): File exfiltration

• /api/c2/rproxy_up — Purpose (per Talos): Reverse-proxy upstream data

• /api/c2/ws — Purpose (per Talos): WebSocket operator command channel

Capabilities by tactic

Talos counted more than 52 commands. The dispatcher matches command strings byte by byte and runs each handler as its own goroutine, so several operations run in parallel. They fall into these groups:

• Stealing. Browser passwords, cookies, and autofill from Chrome, Edge, Brave, Opera, and Firefox. It decrypts the DPAPI-protected Local State key with CryptUnprotectData, or sends the raw databases to C2. It also takes Discord tokens, desktop wallets (Exodus, Electrum, Ledger Live, Bitcoin Core, Atomic, and others) and extension wallets (MetaMask, Coinbase Wallet, Phantom, Brave Wallet), and Wi-Fi keys via netsh wlan show profile. A regex sweep finds seed-phrase and private-key files and archives them into browserdata.zip.

• Surveillance. A keylogger that streams each keystroke live over the WebSocket, with a 10,000-entry buffer for dumps. Screen, camera, and microphone capture, plus clipboard interception and replacement.

• Discovery. systeminfo, last boot time, a SecurityCenter2 AV query, and a process list, each prefixed with chcp 65001 >nul 2>&1 &.

• Remote control and lateral movement. HVNC, an embedded SOCKS5/HTTP proxy, a reverse TCP tunnel over the C2 WebSocket, and RDP session operations and hijacking.

• Persistence. Run keys, masquerading, COM hijacking, and the self-healing watchdog.

• Evasion and impact. Covered in their own sections below.

MITRE ATT&CK mapping

This mapping is my own, based on the behaviors Talos describes. Talos did not publish ATT&CK IDs.

• Execution — Technique: T1059.001 PowerShell; NIK C2 behavior: AMSI-bypass script, MBR raw read, Confirm-SecureBootUEFI

• Execution — Technique: T1059.003 Windows Command Shell; NIK C2 behavior: chcp 65001 & … recon wrapper, lock_start.bat

• Execution — Technique: T1106 Native API; NIK C2 behavior: NtSetInformationProcess, CryptUnprotectData, ShowWindow

• Persistence — Technique: T1547.001 Registry Run Keys; NIK C2 behavior: Autostart entries; SystemLock Run key for the locker

• Persistence — Technique: T1546.015 COM Hijacking; NIK C2 behavior: Listed in Talos' persistence category

• Privilege Escalation — Technique: T1548.002 Bypass UAC; NIK C2 behavior: fodhelper via HKCU\Software\Classes\ms-settings\Shell\Open\command

• Defense Evasion — Technique: T1036.005 Match Legitimate Name or Location; NIK C2 behavior: csrss.exe copy in temp; svchost.exe / simvol.exe masquerade name

• Defense Evasion — Technique: T1070.006 Timestomp; NIK C2 behavior: Near-epoch (Nov 29, 1979) file timestamps; zeroed PE TimeDateStamp

• Defense Evasion — Technique: T1055.012 Process Hollowing; NIK C2 behavior: Listed in the evasion command set

• Defense Evasion — Technique: T1562.001 Impair Defenses; NIK C2 behavior: AMSI bypass via SMA.dll AmsiInitFailed stub; critical-process flag (lrng maps the latter to T1562)

• Defense Evasion — Technique: T1622 Debugger Evasion; NIK C2 behavior: IsDebuggerPresent, CheckRemoteDebuggerPresent → silent exit

• Defense Evasion — Technique: T1564.003 Hidden Window; NIK C2 behavior: Hidden console; HVNC hidden desktop

• Defense Evasion — Technique: T1218.005 Mshta; NIK C2 behavior: Lock screen launched via mshta.exe

• Defense Evasion — Technique: T1006 Direct Volume Access; NIK C2 behavior: \\.\PhysicalDrive0 read for MBR backup

• Credential Access — Technique: T1555.003 Credentials from Web Browsers; NIK C2 behavior: Login Data, key4.db/logins.json, DPAPI unwrap

• Credential Access — Technique: T1539 Steal Web Session Cookie; NIK C2 behavior: Cookies DB, Discord cookies

• Credential Access — Technique: T1555 Credentials from Password Stores; NIK C2 behavior: Wi-Fi keys via netsh … key=clear

• Credential Access — Technique: T1552.001 Credentials in Files; NIK C2 behavior: Seed/private-key filename regex sweep

• Credential Access / Collection — Technique: T1056.001 Keylogging; NIK C2 behavior: Live per-keystroke stream

• Discovery — Technique: T1082 / T1518.001 / T1057; NIK C2 behavior: systeminfo, AV product query, process list, boot/Secure Boot check

• Lateral Movement — Technique: T1021.001 RDP / T1563.002 RDP Hijacking; NIK C2 behavior: RDP operations module

• Collection — Technique: T1113 / T1125 / T1123 / T1115; NIK C2 behavior: Screen, camera, audio, clipboard

• Command and Control — Technique: T1071.001 Web Protocols; NIK C2 behavior: WebSocket/HTTPS on 443, /api/c2/*

• Command and Control — Technique: T1573.001 Symmetric Cryptography; NIK C2 behavior: AES-256-GCM, hardcoded seed

• Command and Control — Technique: T1008 Fallback Channels; NIK C2 behavior: HTTP polling fallback, three C2 tiers

• Command and Control — Technique: T1090 / T1572 Proxy / Protocol Tunneling; NIK C2 behavior: SOCKS5/HTTP proxy, reverse proxy over WebSocket

• Exfiltration — Technique: T1041 Exfiltration Over C2 Channel; NIK C2 behavior: /api/c2/result, /api/c2/file_chunk

• Impact — Technique: T1491.001 Internal Defacement (closest fit); NIK C2 behavior: HTML screen locker with ransom demand, no encryption

• Persistence (staging) — Technique: T1542.003 Bootkit (preparation only); NIK C2 behavior: bootkit.bin placeholder, UEFI/BIOS + Secure Boot survey

━━━━━━━━━━

DEEP DIVE: AI_GENERATE AND CHARGING THE VICTIM

This is the feature that got NIK C2 its headlines, and it's worth looking at closely because each step leaves something on the host.

The C2 sends an ai_generate command with three fields:

• prompt: the operator's text. If it's empty, the handler returns an error and makes no network call.

• api_key: the OpenAI key to use. If this is empty, the implant reads the OPENAI_API_KEY environment variable on the victim's host.

• model: if this is empty, the implant uses a five-character default from its data section, which decodes to gpt-4. The operator can name any model without rebuilding the implant.

The implant then builds a Chat Completions body: model, a two-message messages array, temperature, and max_tokens. The system message is a hardcoded 68-byte instruction that sets the model's role and response style. The user message carries the operator's prompt. The body is serialized to JSON and sent as an HTTP POST to https://api.openai.com/v1/chat/completions from the victim's IP address, with a 60-second synchronous timeout. On an HTTP 200, the implant walks choices[0].message.content and returns a result map with status: "generated", code (the model's text), model, and usage (token counts) over the WebSocket or the HTTP fallback.

Why the key fallback matters. Talos calls this a deliberate design choice, not a convenience. If a developer workstation or build box has OPENAI_API_KEY set, which is very common, then:

• OpenAI bills the victim's payment method for the operator's inference.

• OpenAI's access logs show the victim's key making the requests, from the victim's IP, so nothing in them points to the actor.

• The usage object lets the operator track how many tokens each request consumes, on the victim's account.

Talos says this lets operators generate context-aware lure material, run localized deception, turn collected data into operational intelligence, and craft targeted payloads directly on the compromised host.

What this means for defenders:

1. For most processes on most endpoints, a connection to api.openai.com from something that isn't a browser, an IDE, or a sanctioned AI client is a strong anomaly. LameHug showed this pattern earlier, and NIK C2 confirms it.

2. A key in the user or system environment is a credential exposed to anything running as that user. Treat it like a cloud access key.

3. Unexpected usage on your OpenAI organization (new spend, unusual models, off-hours bursts) can be an intrusion signal. Check provider-side usage logs during IR.

━━━━━━━━━━

EVASION AND ANTI-FORENSICS

According to Talos, NIK C2 applies several evasion measures as soon as it starts:

• Hidden console via ShowWindow.

• Masquerading. It copies or renames itself to csrss.exe in the Windows temp directory and sets its masquerade name to svchost.exe or simvol.exe.

• Recent Documents disabled with a registry write.

• Critical process. It calls NtSetInformationProcess with ProcessBreakOnTermination (0x1D), so killing it from Task Manager or taskkill blue-screens the host. This is a real IR hazard: a responder's first instinct can crash the machine and destroy volatile evidence.

• Anti-debug. IsDebuggerPresent and CheckRemoteDebuggerPresent trigger a silent os.Exit(0) with no crash record.

• UAC bypass on demand. It writes its own path to HKCU\Software\Classes\ms-settings\Shell\Open\command, triggers auto-elevating fodhelper.exe, and deletes the key within about two seconds. A registry snapshot taken later shows nothing.

• AMSI bypass. An embedded PowerShell script patches memory in System.Management.Automation.dll (not amsi.dll), overwriting the AmsiInitFailed path with a six-byte stub (MOV EAX, E_INVALIDARG; RET). AMSI then reports initialization failure, and content inspection is off for the rest of that PowerShell session. The bypass script itself is what lrng reliably catches, through PowerShell script-block logging (4104).

• Process hollowing, listed in the evasion command set.

• Timestamp hygiene. Zeroed PE TimeDateStamp fields and file-system timestamps of Nov 29, 1979 on every sample. That hides the build date, and it also leaves an anomaly that's easy to spot.

• Certificate-pinned TLS, which defeats middlebox inspection.

━━━━━━━━━━

IMPACT: THE SCREEN LOCKER AND BOOTKIT STAGING

"Ransomware" without encryption

The ransomware module runs in stages:

1. MBR backup. PowerShell reads directly from \\.\PhysicalDrive0 and writes the first sector to mbr_backup.bin in the Windows temp directory.

2. Lock screen. The implant builds a self-contained HTML page at runtime from a hardcoded template, filled in with operator-supplied BTC and USDT wallet addresses, prices, a contact email, a timer, and custom text. It writes the page to lock_screen.html in the system temp directory.

3. Launcher. It writes lock_start.bat, which runs mshta.exe on the HTML file in an infinite loop with a 5-second timeout, so closing the window just brings it back.

4. Persistence. It runs reg add to create a Run key named SystemLock under the current user's autostart path, pointing to cmd /c on the batch file. A background goroutine also relaunches the locker if it dies.

5. It confirms the deployment to C2 with the HTML path and timer value.

No files are encrypted, so there are no encryption markers or mass file-modification timestamps to find. Talos notes this makes it much faster to deploy than file-encrypting ransomware. For the victim the effect is the same: they can't use the machine and there's a ransom demand on screen.

Bootkit preparation

The bootkit module surveys the boot environment and stages a file:

• It runs bcdedit /enum with the console hidden and looks for EFI, Windows Boot Manager, Windows Legacy OS Loader (classified as UEFI) or ntldr (BIOS).

• It runs PowerShell Confirm-SecureBootUEFI and records True, False, or unknown.

• It writes a 16-byte bootkit.bin to the system temp directory containing the ASCII string NIK_BOOTKIT_PREP. This is a staging marker, not a real bootkit. It confirms the path is writable and reserves a location that a later file-upload command can overwrite with an actual payload.

Talos describes no working bootkit. Treat this as staging, and a reason to make sure Secure Boot is on everywhere.

━━━━━━━━━━

INDICATORS OF COMPROMISE (DEFANGED)

From Talos' IOC file (https://github.com/Cisco-Talos/IOCs/blob/main/2026/10/nik-c2-new-ai-enabled-framework.txt) and blog post.

SHA-256

ae38f1181c9dd0db7224d6023e335eb2cdabb0f441906d14ffba8602b7abca3c

6583eb22ca554e749b647d68ae76f7279a8dc538196ebde1412669357a027de5

30817712277bba54e4cb8640f4005aad35f5172f88cf046aea545d029e12ccba

1fee4cd8d3560e6c60ba50451860adf6e705f26fd3fe1c1ccc058f4e8b13073a

bf83345ca66bdc4bd45ade608a06361d18927dd80351e9a1d8cbe8eda5d78402

99573a79f393299049216237d0d23761d67f6a8507a7a0cfe17cb30837f68f00

5d25efba2119f52d08214a590fedb45a5c9fe5e2850fd87e7bca24c92745e6d1

2a01056369cc691f5bed6bd2654930a81d1bc240a568a0d5b209aceef3b5c9c9

Network

total-sitevv[.]lol

87.120.196[.]120

2.26.51[.]12

hxxps://2.26.51[.]12:4443/api/c2/update

URI paths: /api/c2/update /api/c2/result /api/c2/screen

/api/c2/file_chunk /api/c2/rproxy_up /api/c2/ws

TLS cert CN: nik-panel

TLS cert serial: 7d16381a9de823943b5a0987dbd0f26edf22052b

JARM: 28d28d28d00000000042d42d0000001f361a1bf80ed39a1e352adeb016a07b

Host

Build path: /opt/nik_panel/data/build_52b79724a1fc4b8f/main.go

Log string: [NIK] Starting

Agent ID fmt: ag_

Install dir: %AppData%\Roaming\Microsoft\Network\

Masquerade: csrss.exe (in %TEMP%), svchost.exe, simvol.exe

Temp files: bootkit.bin ("NIK_BOOTKIT_PREP"), lock_screen.html,

lock_start.bat, mbr_backup.bin, browserdata.zip

Run key: SystemLock (cmd /c …\lock_start.bat)

UAC key: HKCU\Software\Classes\ms-settings\Shell\Open\command (deleted ~2 s later)

Timestamps: PE TimeDateStamp = 0; file times Nov 29, 1979

Toolchain: Go 1.23.4

AES seed: d791dd0ff3228ed29a8d7333d4567be829159c5632ea347780992006f91c5295

AES key: 4887AFC0A574E9419A9695EF083460F58E4EF9A1C40793523CE112251273BDF9

Signatures. ClamAV Win.Trojan.GoDiscorder-10060526-0. Broadcom/Symantec lists file-based Backdoor.Trojan and WS.Malware.1 plus several SONAR and ML heuristics (see their bulletin).

━━━━━━━━━━

NIK C2: AN LLM INSIDE THE IMPLANT (PART 2 OF 2: DETECTING IT WITH LIVERESPONSE-NG)

By jp101216, author of LiveResponse-NG (lrng) (https://github.com/jp101216/LiveResponse-NG)

Quick recap of Part 1. NIK C2, disclosed by Cisco Talos on October 29, 2026, is a Go implant with over 50 commands and a built-in OpenAI client that can bill the victim's own OPENAI_API_KEY. It marks itself as a critical process, back-dates its files to 1979, copies itself to AppData\Roaming\Microsoft\Network, uses a fodhelper UAC bypass that deletes its key about two seconds later, bypasses AMSI from PowerShell, and can drop an mshta screen locker and stage a bootkit. This part covers how to catch all of that.

━━━━━━━━━━

HOW LIVERESPONSE-NG DETECTS NIK C2

Some background on the tool. lrng is a single static live-response binary (Go, with a Rust sidecar for parsing hostile input). It collects behavior, not hashes, and every finding has a rule id, a severity (notable → suspect → critical), a confidence (0–100), an ATT&CK technique, and a sentence describing what was seen. Its README explains the reasoning: AI-assisted malware "leans on code that's generated and mutated per-build, which defeats signatures", so live response should focus on behavior. NIK C2 is a good test of that, because almost every capability above leaves a mechanical trace.

1. Family detection: the implants collector (new in v0.14)

I wrote this collector specifically for NIK C2. It finds known implant families "by what they are rather than how they behave." It's part of the default Windows run.

• Where it looks. Programs running from outside the Windows and Program Files folders, plus programs in the locations NIK C2 copies itself to: each user's AppData\Roaming\Microsoft\Network and temp folder. For NIK C2 it only reads Go programs, up to 64 MB each and 1 GB total, and searches them for the family's own strings.

• Staged files. It lists the users' and Windows' temp folders and reads the first kilobyte of any file named like NIK C2's staged files: the bootkit placeholder, the lock screen's page and batch file, and a copy of the MBR.

• Self-safety. The marker strings are stored encoded in lrng's own source, so lrng is never mistaken for the implant. (lrng also never judges itself or its sidecar.)

• malware.nik_c2 — Severity: critical; Fires on: A program containing NIK C2's strings, running from outside Windows/Program Files or sitting where it copies itself. The finding notes the process is marked critical and says not to kill it. (T1071.001)

• malware.nik_c2_artifact — Severity: critical / suspect; Fires on: Critical: the bootkit placeholder, or the lock screen's page and batch file, in a temp folder. Suspect: other pairs of its staged files, or a copy of the MBR.

2. Behavioral detections, mapped to NIK C2

These rules don't depend on the family's strings, so they still work if the operators rebuild or obfuscate the implant.

• ProcessBreakOnTermination critical flag — lrng rule(s): defense.critical_process (critical); Collector / source: processes (IsProcessCritical); Notes: Fires on a process outside Windows' own core set marked critical. The finding warns that ending it crashes the host. T1562

• 1979 file times — lrng rule(s): defense.timestomp (suspect); Collector / source: processes, autoruns, services; Notes: An image dated before 1980, "which no file system or archive a program arrives through records." T1070.006

• HVNC — lrng rule(s): defense.hidden_desktop; Collector / source: processes (desktop name from the process environment); Notes: A process started on its own desktop: critical for explorer, suspect for browsers and shells. Browser-sandbox and Windows Search desktops are excluded. T1564.003

• csrss.exe in %TEMP% — lrng rule(s): process.masquerade_path; Collector / source: process tree; Notes: A system binary name outside its Windows directory.

• fodhelper UAC bypass, key deleted in ~2 s — lrng rule(s): privesc.uac_bypass_key (critical); Collector / source: autoruns (live hive) and eventlog (Sysmon 12/13); Notes: The live check catches a key that's still there. Sysmon's registry events catch it "even for a key deleted seconds later." T1548.002

• Lock screen via mshta — lrng rule(s): exec.mshta_local_file; Collector / source: command lines (processes, autoruns, 4688, task actions); Notes: mshta running an HTA from a temp or download folder. The README cites NIK C2's lock screen as an example. T1218.005

• MBR read from \\.\PhysicalDrive0 — lrng rule(s): defense.raw_disk_access; Collector / source: command lines / 4104 script blocks / 4688; Notes: A script opening \\.\PhysicalDrive. T1006. mbr_backup.bin also raises malware.nik_c2_artifact

• chcp 65001 & systeminfo … — lrng rule(s): exec.c2_shell_recon (notable); Collector / source: command lines; Notes: "The wrapper Go and Python implants put around each shell command." T1059.003

• SecurityCenter2 AntiVirusProduct query — lrng rule(s): discovery.av_product (notable); Collector / source: command lines; Notes: T1518.001

• Wi-Fi key dump — lrng rule(s): cred.wifi_keys; Collector / source: command lines (live or 4688); Notes: netsh wlan show profile … key=clear. T1555

• OpenAI callout from the implant — lrng rule(s): ai.llm_callout, ai.llm_callout_unusual_path, ai.llm_callout_unattributed, ai.llm_dns_cache; Collector / source: network (AI module A), dnscache; Notes: See below

• Embedded chat-API scaffolding / keys — lrng rule(s): api.endpoint, model.identifier, api.*, prompt.system_role, secret.openai_key; Collector / source: sidecar (AI module B), files or memory; Notes: See below

• Process hollowing — lrng rule(s): memory.image_header_mismatch, memory.pe_in_private, memory.process_tampering; Collector / source: memory (opt-in), Sysmon 25; Notes: Header mismatch = "the mapped image was replaced: hollowing and its relatives" (T1055.012). Sysmon 25 gives the history

• AMSI bypass (patch in System.Management.Automation.dll) — lrng rule(s): eventlog.powershell_suspicious_block; possibly memory.image_inline_patch / memory.image_code_modified; Collector / source: eventlog (4104), memory; Notes: 4104 captures the embedded bypass script. The memory check may or may not see the change, because Talos describes a patched field (data) and image integrity compares code sections. Not yet tested against a live sample.

• Run-key persistence (SystemLock, implant autostart) — lrng rule(s): persistence.autorun_unusual_path and related autostart rules; Collector / source: autoruns; Notes: Each entry includes the key's last-write time, the expanded command, and the image hash

• Outbound C2 from a user-writable path — lrng rule(s): network.unusual_path_outbound; Collector / source: network; Notes: The live WebSocket on 443, attributed to its PID

AI module A: the callout from a process with no reason to make it

At start-up, module A resolves the API hostnames of about 30 commercial LLM providers, OpenAI included, and checks every TCP connection against them. With dnscache selected it also correlates by hostname. For NIK C2:

• The implant is a random Go binary, not on the allowlist, so a live ai_generate connection is ai.llm_callout at suspect. If the operator's work goes through a script host or LOLBin, it's critical.

• If the implant is sitting under an allowlisted name in a user-writable path, it's ai.llm_callout_unusual_path.

• A connection that has closed but is still in TIME_WAIT with PID 0 shows up as ai.llm_callout_unattributed.

• The DNS cache holding api.openai.com gives ai.llm_dns_cache.

Module A is point-in-time, and ai_generate is a synchronous call with a 60-second timeout — so add dnscache to the run. The DNS cache remembers longer than the connection table, and lrng snapshots it before module A does its own lookups so the evidence isn't polluted. Public LLM APIs sit behind shared CDNs, which is why the callout is graded as a finding to investigate rather than a silent block. Combined with the rest of the host picture — a pre-1980-dated, critical-flagged Go binary in AppData\Roaming\Microsoft\Network that also talks to OpenAI — that cluster is what lrng is designed to surface, and it's hard to explain innocently.

AI module B: prompt artifacts in the binary and in memory

Module B is a binary-safe scanner (ASCII and UTF-16LE) for chat-API JSON shape, system-role scaffolding, sampling parameters, model identifiers, provider endpoints, and API keys. Keys are always redacted in the report. Against NIK C2 it has clear targets: Talos documents the api.openai.com/v1/chat/completions endpoint, the five-character default that decodes to gpt-4, temperature/max_tokens constants, and a hardcoded 68-byte system prompt. Run it on the dropped binary with -prompt-scan for the on-disk strings; with the memory collector, the serialized request body and any OPENAI_API_KEY the implant resolved may be present in the process heap. Go builds the request from a map at runtime, so the complete "role":"system" JSON shape may only exist in memory, not on disk.

Memory: hollowing and the AMSI bypass

The opt-in memory collector compares the code each process mapped from an image file with that file on disk, after applying relocations. A hollowed process shows up as memory.image_header_mismatch or as a PE in private memory (memory.pe_in_private). Sysmon event 25 adds memory.process_tampering from the event log.

AMSI, as Talos describes it. NIK C2 does not patch amsi.dll. It runs an embedded PowerShell script that overwrites the AmsiInitFailed field in System.Management.Automation.dll with a six-byte stub (MOV EAX, E_INVALIDARG; RET), so AMSI reports initialization failure for the rest of that session. The dependable lrng detection is the script itself: with script-block logging on, it lands in event 4104 and raises eventlog.powershell_suspicious_block. The memory collector's image-integrity check compares each module's executable code sections with the file on disk. Because Talos describes this as a patched field rather than rewritten native code, that check may surface it as memory.image_inline_patch or memory.image_code_modified on System.Management.Automation.dll, but I haven't confirmed that against a live sample. Treat a memory hit as a bonus, and make 4104 logging your primary control.

━━━━━━━━━━

A SAMPLE TRIAGE WORKFLOW

All commands are run from an elevated prompt, with lrng-sidecar.exe next to lrng.exe, using only documented flags. Write the output off-host.

Step 1: Default triage, with the DNS cache, timeline, and IOCs, in one viewer file.

Default collectors (includes processes, autoruns, eventlog, network, implants) + DNS cache

.\lrng.exe -collectors default,dnscache -timeline -iocs -format html -out E:\case42\HOST01.html

Selecting dnscache snapshots the resolver cache before module A resolves anything (meta.taken_before_module_a_lookups). If the cache is evidence and you don't want lrng touching it, use -no-dns instead (module A then has nothing to match, and the report says so).

Step 2: Read the findings before you act. Open the .html in any browser, or drop a .json onto viewer/lrng-viewer.html. The viewer is offline, and its CSP stops it from loading or sending anything. Findings are listed most severe first and can be filtered by severity, collector, tactic, and text. Each one opens to the record behind it, and there's an ATT&CK tactic strip in kill-chain order. summary.top_findings points back to results[result].records[record].

On a NIK C2 host I'd expect a cluster like this: malware.nik_c2 (critical) on a Go binary under AppData\Roaming\Microsoft\Network or a csrss.exe in %TEMP%; defense.critical_process on the same PID, with the warning not to end it; defense.timestomp on its image; process.masquerade_path; and, depending on what the operator did, privesc.uac_bypass_key from Sysmon, exec.c2_shell_recon, cred.wifi_keys, ai.llm_callout*, malware.nik_c2_artifact, and eventlog.powershell_suspicious_block from the AMSI-bypass script if script-block logging was on. The process-tree view shows the watchdog relationship, and the timeline puts the Run-key last-write times next to the event-log hits.

⚠️ Do not kill the process. defense.critical_process is there to prevent a reflexive taskkill that would bugcheck the host and wipe its memory. Contain the host at the network layer, collect memory and evidence first, and plan remediation as a controlled reboot/offline clean-up.

Step 3: Memory sweep of the implant and anything it hollowed.

Image integrity + heuristics + module B on specific PIDs (no YARA rules needed)

Include the implant PID and any powershell.exe / pwsh.exe that ran around the same time

.\lrng.exe -collectors memory -mem-pids 4242,5120 -out E:\case42\HOST01-mem.json

Quicker integrity-only sweep across all processes

.\lrng.exe -collectors memory -mem-no-prompts -out E:\case42\HOST01-integrity.json

Add your own YARA rules (e.g. on the Talos build path / log strings)

.\lrng.exe -mem-scan 4242 -yara .\rules

On a host where the AMSI bypass ran, it's also worth checking the integrity findings for System.Management.Automation.dll, though whether they show the patched field is untested. Hollowed processes still show as memory.image_header_mismatch / memory.pe_in_private. Memory scanning opens other processes with PROCESS_VM_READ, which EDR products watch for. Tell your SOC before you sweep. LSASS is skipped unless you pass -mem-include-lsass.

Step 4: Scan the dropped binary for prompt artifacts.

.\lrng.exe -prompt-scan C:\Users\ \AppData\Roaming\Microsoft\Network\ .exe

Step 5: Offline event-log triage (from a shadow copy or an image). This is where you recover the fodhelper key that was deleted within two seconds, as long as Sysmon logged registry events 12/13.

.\lrng.exe -evtx E:\case42\winevt\Logs -sigma builtin -timeline -iocs -out E:\case42\HOST01-logs.json

Step 6: Fleet sweep for the family.

.\lrng.exe -collectors implants,processes,autoruns -fail-on critical -quiet -out \\share\sweep\%COMPUTERNAME%.json

The exit status is 3 when a finding meets the -fail-on threshold, which makes it easy to script a sweep. Every report is written with a .sha256 file and records the SHA-256 of the lrng binary that produced it. Put both in your case notes.

Know lrng's own footprint. The implants collector reads whole Go program files (bounded as described above). Module A's DNS lookups land in the host's cache (unless you use -no-dns). Running lrng creates Prefetch entries. All of this is documented in the README's "Forensic footprint" section.

━━━━━━━━━━

HARDENING AND DETECTION RECOMMENDATIONS

• Log what the implant cleans up. Deploy Sysmon with registry events 12/13 on HKCU\Software\Classes\ms-settings and the other UAC-bypass keys, plus events 3, 22, 8, and 25. Turn on 4688 with command lines and PowerShell script-block logging (4104). The chcp 65001 wrapper, netsh … key=clear, the \\.\PhysicalDrive0 read, and the PowerShell that patches System.Management.Automation.dll all end up there.

• Treat AI keys as cloud credentials. Don't keep long-lived OPENAI_API_KEY values in endpoint environments. Use scoped project keys with spending limits, check provider-side usage during IR scoping, and at the egress proxy only allow LLM API destinations from processes that need them.

• Close the easy paths. Restrict mshta.exe with WDAC/AppLocker. Remove local admin, since the fodhelper bypass needs an admin user at medium integrity. Enforce Secure Boot. Hunt for executables in %AppData%\Roaming\Microsoft\Network.

• Network. Block the IOCs, and hunt for the JARM and the nik-panel certificate CN. A ~250 ms POST cadence to one host stands out in proxy and flow logs. Certificate pinning means TLS inspection won't help, so rely on endpoint telemetry.

• Playbook. Check the critical flag before killing anything. Treat a screen locker that encrypted no files as a full compromise. Rotate browser passwords, cookies, Discord tokens, Wi-Fi PSKs, wallets, and AI provider keys.

━━━━━━━━━━

CLOSING THOUGHTS

The AI feature gets the attention, but what helps defenders is everything around it. NIK C2 marks itself critical, back-dates its files to 1979, copies itself to a predictable folder, wraps its shell commands in chcp 65001, plants a UAC-bypass key, patches AMSI inside System.Management.Automation.dll, and calls OpenAI from a process that has no reason to. None of those signals depends on a hash. If you run lrng against a lab detonation and find a gap or a false positive, please open an issue on the repo.

━━━━━━━━━━

REFERENCES

• Cisco Talos, Chetan Raghuprasad, "NIK C2: The new AI-enabled command-and-control framework," Oct 29, 2026: https://blog.talosintelligence.com/nik-c2-new-ai-enabled-framework/

• Cisco Talos IOCs: https://github.com/Cisco-Talos/IOCs/blob/main/2026/10/nik-c2-new-ai-enabled-framework.txt

• Infosecurity Magazine, Alessandro Mascellino, "NIK C2 Malware Can Use Victims' OpenAI Keys for AI Queries": https://www.infosecurity-magazine.com/news/nik-c2-malware-victims-openai-keys/

• SOCtember, Priya Shah, "Cisco Talos Says NIK C2 Is an AI-Enabled C2 Framework…": https://www.soctember.com/threat-intel/talos-nik-c2-ai-enabled-framework-openai-api-keylogger-screenlock

• Broadcom / Symantec Protection Bulletin, "New AI-enabled framework - NIK C2": https://www.broadcom.com/support/security-center/protection-bulletin/new-ai-enabled-framework-nik-c2

• LiveResponse-NG (lrng): https://github.com/jp101216/LiveResponse-NG

• MITRE ATT&CK: https://attack.mitre.org/

GitHub - jp101216/LiveResponse-NG: Live-response triage agent for Windows and Linux DFIR: ~120 ATT&CK-mapped…

3 reactions · 0 comments

Read and join the discussion on Cyberr