**Published:** December 29, 2025
December 6, 2025. System load average: 74. Normal is about 2.
Two crypto miners were eating my server alive, disguised as system daemons (`systemd-devd`, `softirq`, `kthreaddo`). They'd been running for 31 hours before I even noticed.
CVE-2025-66478. Remote Code Execution in Next.js Server Components. My application was running outdated dependencies, and attackers found it.
I could have been embarrassed. I could have quietly patched and moved on. But that's not how we get better.
This wasn't even my first breach. A few months back, I'd forgotten a test MySQL database with default credentials running. Same thing: crypto miners. But I caught that one quickly, handled it in under two hours.
This one was different. This one ran for **31 hours** before detection. That's what happens when you have security without monitoring.
Honest truth? **Getting hacked was the best thing that could have happened to my infrastructure.**
**CVE-2025-66478** is a critical Remote Code Execution vulnerability in Next.js Server Components, affecting versions 15.0.0 through 16.0.6 and React 19.0.0 through 19.2.0.
**The numbers:** - **CVSS Score:** 9.8 (Critical) - **Attack Vector:** Network-accessible, no authentication required - **Affected Infrastructure:** Next.js 15.3.2 with React 19.1.0 - **Patches Available:** Next.js 15.3.6+, React 19.1.2+ - **My Patch Status:** Not applied
That last point? That's the entire story. Patches existed. I knew they existed. I just hadn't gotten around to applying them manually.
**What made this work:**
The vulnerability allows attackers to execute arbitrary code through specially crafted HTTP requests to Server Components. No brute force. No stolen credentials. Just cleverly crafted requests that the framework trusts implicitly.
My infrastructure had been running since November 27, 2024. Vulnerable the entire time. Attackers sent their exploit on December 5, 2025 around 23:00 UTC. First miner spawned (PID 1033921). Second miner deployed December 6 at 03:22 UTC. System load went through the roof.
I noticed during routine system checks on December 6 at 10:42 UTC. Full containment achieved by 11:30 UTC.
**Detection to containment: 48 minutes.** **Undetected operation: 31 hours.**
That ratio tells you everything about why monitoring matters.
**November 27, 2024:** Vulnerable application deployed to production. Next.js 15.3.2, React 19.1.0. Both vulnerable. I'm busy building features, not checking CVE feeds.
**December 5, 2025 (~23:00 UTC):** Attackers send specially crafted HTTP requests exploiting CVE-2025-66478. Code execution achieved within Docker container context. First crypto miner process spawns (PID 1033921).
**The payload delivery:**
Using established RCE, attackers download mining software from their C2 server: - **C2 IP:** 217.60.249.228:8000 - **Hosting:** CloudBackbone (AS56971) -- known bulletproof hosting - **Malicious URL:** `http://217.60.249.228:8000/stx.sh` - **Method:** `wget` from within container, executed via `/tmp/`
**Social engineering at the process level:**
The malware disguised itself as legitimate system processes: - `/tmp/fghgf` -> `systemd-devd` - Additional miners: `softirq`, `kthreaddo`
This delayed detection during casual checks. I'd SSH in, run `top`, see "system" processes, and not think twice.
**December 6, 2025 (03:22 UTC):** Second miner deployed. System load goes from normal (~2) to critical (74+). Each miner consuming 200%+ CPU, ~2.4GB RAM (14.7% each).
**December 6, 2025 (10:42 UTC):** I notice. System load at 74.04 during routine check. Process tree analysis reveals miners spawned from `next-server` containers. Immediately obvious: web application compromise, not system-level breach.
**December 6, 2025 (11:30 UTC):** Full containment achieved.
**The response:** 1. **Process termination:** `kill -9` and `pkill` on all identified malicious processes 2. **Container isolation:** Compromised Docker containers stopped immediately 3. **Network blocking:** C2 infrastructure blocked via `iptables` + DNS blackholing 4. **Investigation:** No persistence mechanisms found (no cron, no systemd timers) 5. **Verification:** Process tree analysis confirmed origin, container logs showed exploit
**What defense-in-depth actually looked like:**
My application layer failed. Next.js was compromised. But: - **Network segmentation** prevented database compromise and lateral movement - **Container isolation** stopped privilege escalation beyond application layer - **SSH hardening** (key-based auth) blocked attempts to get root - **No data breach** despite 31 hours of access
One layer failed. Three others held. That's not luck. That's architecture.
If you're dealing with CVE-2025-66478 or similar RCE vulnerabilities, here's what I found:
**Process-level IOCs:** - Process names: `/tmp/fghgf`, `systemd-devd`, `softirq`, `kthreaddo` - Process location: Executables running from `/tmp/` directory (huge red flag) - CPU utilization: Sustained 200%+ usage per instance - Memory consumption: ~2.4GB (14.7%) per miner - Parent process: Spawned from `next-server` container processes
**Network IOCs:** - **C2 IP:** 217.60.249.228 - **C2 Port:** 8000 - **Hosting Provider:** CloudBackbone (AS56971) - known bulletproof hosting - **Malicious URL:** `http://217.60.249.228:8000/stx.sh` - Pattern: `wget` followed immediately by bash execution
**Behavioral IOCs:** - System load spike from normal (~2) to critical (74+) - Unexpected child processes from web server containers - Multiple `wget` attempts to same external IP - Processes consuming resources but doing no legitimate work
**The real lesson:**
Behavioral anomalies appeared instantly. Signature-based detection? Would've caught nothing. This was a zero-day when it hit me.
Trust your baseline. If system load is normally 2 and suddenly it's 74, you don't need fancy AI to know something's wrong. You just need to be looking.
**Security controls that failed:**
Let's be honest about what didn't work: - **Vulnerability management:** No automated dependency scanning. No security advisory monitoring. - **Patch management:** Patches available but not applied. 10-day gap between disclosure and exploitation. - **Runtime monitoring:** No automated alerting for abnormal resource consumption. - **Container security:** No scanning of container images or runtime protection.
My application layer was completely compromised. If that had been my only layer, I'd be telling a much worse story.
**Security controls that worked:**
Here's what kept this from becoming catastrophic:
**Network segmentation:** Internal network isolation meant attackers got the web application but couldn't pivot to databases or other infrastructure. The blast radius was contained.
**Container isolation:** Docker containerization limited access to application layer only. Attackers had RCE within the container but couldn't escalate to host system.
**SSH hardening:** Key-based authentication prevented privilege escalation beyond container boundaries. They had code execution but not root.
**Rapid response:** 48-minute detection-to-containment window. Not because I had fancy tools, but because I happened to check system load. Pure luck on timing, but fast execution once I noticed.
**The architecture choices I made years ago:**
When I set up this infrastructure 2 years earlier, I made decisions that seemed like overkill at the time: - Docker containers for everything (not just deployment convenience) - Internal network segmentation (even for a single VPS) - SSH key-only authentication (no passwords accepted) - Separate application and database networks
None of these stopped the initial breach. All of them prevented it from spreading.
**That's defense-in-depth.** Not preventing every attack, but making sure that when one layer fails, others hold.
I could have quietly patched and moved on. Instead, I rebuilt everything.
Using **CyberSage** -- my 3rd year Project 300 framework built on Claude Code -- I deployed an entire security stack that would make most startups jealous. All open source. All automated. All controlled from my phone.
Running on my 17 euro/month Hostinger VPS (2 vCPU, 8GB RAM, alongside 5 websites and 4 production applications):
**The security layer:**
- **Auditd:** Kernel-level syscall monitoring. Tracks process execution, file access, network connections. Would've caught those miners in minutes. - **AppArmor:** Mandatory Access Control restricting container capabilities. Prevents escapes, blocks sensitive host file access. - **Seccomp Profile:** Whitelists allowed syscalls per container. Blocks dangerous calls like `mount` and `ptrace`. - **ModSecurity WAF:** OWASP Core Rule Set protecting all endpoints. Would've stopped CVE-2025-66478 before it reached the container. - **Trivy:** Container image scanning every 2 days. Critical CVEs trigger instant Telegram alerts at 3:30 AM. - **ClamAV:** Weekly malware scans every Sunday at 4 AM. Silent on clean, loud on threats.
**The monitoring layer:**
Real-time visibility into everything:
- **Prometheus + Grafana:** Metrics every 15 seconds. I see CPU spikes the moment they happen, not 31 hours later. - **Loki + Promtail:** Log aggregation from everything. Complete audit trail. - **Alertmanager:** Routes everything to Telegram. Critical = instant. Warning = grouped. - **Uptime Kuma:** External monitoring. I know my infrastructure is down before users tell me.
**The automation layer (the real magic):**
- **Watchtower:** Auto-updates container images. The vulnerability that got me? Won't happen again. - **GitHub Actions:** Every `git push` triggers automated builds. Code goes to GitHub Container Registry. Heavy lifting on GitHub's infrastructure. - **Secret Scanner:** Prevents committing API keys, passwords, tokens. Blocks deployment if I mess up. - **Telegram Command Bot:** Deploy from my phone. Send `/deploy emmizone` and seconds later my website is live. Upload files by sharing them -- they appear in `/root/uploads` automatically.
**A day in my new dev life:**
7:00 AM - Telegram buzzes with daily server report. CPU, RAM, disk, containers, security status. Everything healthy.
10:00 AM - Working on portfolio locally. Make changes: ```bash git add . git commit -m "Update homepage hero" git push origin main ```
That's it. That's all I do.
10:02 AM - GitHub Actions builds Docker image, pushes to registry, Telegram notifies: "Build Successful. Send /deploy to deploy now."
10:15 AM - Walking to class. Open Telegram, type `/deploy emmizone`. Seconds later: "emmizone deployed successfully!"
**Total time from git push to production: under 3 minutes.** Never touched a terminal.
**What would've caught this:**
If I'd had this stack on December 5th:
1. **Trivy** would've caught the vulnerable Next.js version during image scan 2. **Watchtower** would've updated to patched version automatically 3. **Auditd** would've caught the initial RCE attempt via syscall monitoring 4. **ModSecurity** would've blocked the malicious HTTP request 5. **Alertmanager** would've sent instant Telegram alert on abnormal process spawn 6. **Grafana** would've shown system load spike in real-time
Instead of 31 hours undetected, I would've known in under 5 minutes.
**Lesson 1: You can't monitor what you can't measure**
Before the breach, I had security but zero visibility. Firewall rules, SSH keys, container isolation -- fundamentals that worked for 2 years.
But no metrics. No logs. No alerts. I'd SSH in occasionally, run `top`, hope everything looked okay.
When the first breach happened (that MySQL database), I caught it while working on the project. When the second breach happened, it ran for 31 hours.
Now I have complete visibility. Metrics every 15 seconds. Logs from everything. Alerts to my phone. The infrastructure doesn't just exist -- it tells me when something's wrong.
**Lesson 2: Manual processes don't scale**
The breach happened because Next.js wasn't patched. I knew patches existed. I just hadn't gotten around to updating manually.
Watchtower now updates containers automatically. GitHub Actions builds images automatically. Security scans run automatically. The things that require discipline? I automated them.
**Lesson 3: Prevention without detection is just hope**
I had prevention. Firewall configured. SSH hardened. Containers isolated. These controls stopped lateral movement during both breaches -- attackers never got root, never touched databases.
But prevention without detection is incomplete. You need to know **when** something gets through, not just hope it holds forever.
The first breach lasted 2 hours before I stumbled on it. The second lasted 31 hours. Same security posture, but no monitoring to catch what slipped through.
Now I have both. Prevention stops most attacks. Monitoring catches what gets through. That's defense-in-depth.
**Lesson 4: Speed matters more than perfection**
48-minute detection-to-containment window wasn't because I had perfect tools. It was because once I noticed, I moved fast: - Identified processes -> `kill -9` - Traced to containers -> `docker stop` - Blocked C2 infrastructure -> `iptables` + DNS blackhole - Verified no persistence -> Done
No committee meetings. No approval processes. No second-guessing. See the problem, fix the problem, document after.
**Lesson 5: Gratitude for the wake-up call**
I'd been underestimating attackers. I had basic security -- it worked for 2 years -- but I was treating monitoring and automation as "nice to have" instead of essential.
This breach gave me the motivation to finally architect something strong. Something with real automation.
**What I gained:** - **Time back:** Automated the tedious stuff. No more manual SSH, manual deploys, manual monitoring. - **Better infrastructure:** Not just secure, but manageable. Simpler and stronger. - **Real monitoring:** From "hope nothing breaks" to "know exactly when something breaks and why." - **Portfolio material:** Incident response, infrastructure as code, security automation, CI/CD -- all production-validated. - **Peace of mind:** Focus on building instead of babysitting servers.
Before this breach: 2 years of basic security that mostly worked.
After this breach: enterprise-grade infrastructure that lets me move faster while being more secure.
**Gratitude is the best attitude -- even when your server becomes a crypto mine.**
**If you run your own infrastructure:**
**Immediate actions:** - Implement automated dependency scanning (Snyk, Dependabot, OWASP Dependency-Check) - Deploy container security scanning in CI/CD pipeline (Trivy, Clair, Anchore) - Configure baseline resource monitoring with automated alerting (Prometheus, Grafana) - Establish security patch SLAs (Critical: 72 hours, High: 7 days, Medium: 30 days)
**Medium-term improvements:** - Deploy Web Application Firewall with OWASP Core Rule Set - Implement runtime container protection (Falco, Sysdig, Aqua Security) - Establish log aggregation and SIEM capabilities (ELK Stack, Splunk) - Harden container configurations (least privilege, read-only filesystems, capability dropping)
**The real cost:**
Cost of the breach: - ~31 hours of compute resources stolen - Several hours of incident response - One very stressful morning
Cost of prevention: - 48 hours to rebuild everything - 17 euro/month Hostinger VPS - All open-source tools (free)
**It's always cheaper to prevent than respond.**
**If you're a cybersecurity student:**
Document everything. Share your failures. Build in public. The journey from breach to defense-in-depth is the kind of portfolio work that gets people hired.
Every incident is a chance to learn, improve, and help others avoid the same mistakes. Don't wait for the breach to build proper security. The tools are out there. They're open source. They're powerful.
For complete technical analysis and detailed transformation documentation:
Security Incident Report - CVE analysis, attack chain reconstruction, IOCs, and defense-in-depth assessment
Post-Incident Transformation Report - Complete infrastructure rebuild documentation, automation workflows, and lessons learned
This infrastructure isn't finished. It's version 1.0.
Already planning: - Better log correlation between metrics and events - More granular alerting rules (less noise, more signal) - Integration with security intelligence feeds - Automated backup testing (backups you haven't tested are just hopes)
**The future: voice-controlled infrastructure**
I'm building something that would've sounded like science fiction a year ago.
**Voice-controlled server management through AI agents.**
Instead of SSH-ing when a container goes down, I'll just send a voice message to Telegram: *"Hey, the emmi.zone container is down, can you restart it?"*
The workflow: 1. Voice message -> Telegram 2. AI agent interprets request 3. Agent SSH's into VPS 4. CyberSage executes command 5. Confirmation back to Telegram
From voice message to resolved issue in seconds. No terminal. No SSH keys. No remembering Docker commands at 3 AM.
**That's the vision.** Infrastructure so intelligent it understands natural language. So automated you forget it exists. So reliable you focus on building, not maintaining.
This incident reinforced something I believe deeply: **security isn't a checklist, it's a living system.**
Every control interacts with every other control. Your monitoring is only as good as your metrics. Your metrics are only as good as your alerts. Your alerts only matter if you act on them quickly.
It's all connected. Strength comes from relationships between components, not individual tools.
This is where neurodivergent pattern recognition becomes a superpower. When you see systems as interconnected webs rather than linear processes, you spot weak points others miss. You also spot the strong points -- where multiple defenses overlap to create resilience.
Security work is fundamentally optimistic. We build defenses believing they'll matter. We practice scenarios hoping we'll never need them. We hunt for threats expecting to find and stop them.
And when things go sideways? We learn, adapt, and come back stronger.
CVE-2025-66478 could have been catastrophic. Instead, it became a catalyst. Better detection, faster response, automated security, deeper understanding.
That's not luck. That's what happens when you're grateful for the lessons -- even the hard ones.
**Still learning. Always improving. The faster we move, the clearer we see.**
What patterns are hiding in your logs right now?
---