DEV Community

sofi works
sofi works

Posted on

『中華格安Wi-Fi 7ルーターを買ったら、基板裏で全通信を抜くバックドアが蠢いていた深夜:UARTシリアル抽出とOpenWrtファームウェア監査仕様書』 Sofi_Log #063【1話完結】

Midnight Hack: That Cheap Chinese Wi-Fi 7 Router Had a Backdoor Worming Through Every Packet on the Underside of the PCB — UART Serial Extraction & OpenWrt Firmware Audit Spec Sheet | Sofi_Log #063 [Complete One-Shot]


Bangkok. Dead of night. I pulled this sketchy “bargain” Chinese Wi-Fi 7 router from the electronics market like it was buried treasure.

13:40. My workbench glowed under the faint haze of resin flux and the eerie green trace of the oscilloscope. The router looked suspiciously cheap on the shelf, yet its specs were dead serious: 802.11be Wi-Fi 7, 10 Gbps Multi-Link Operation. If the marketing were true, it should have delivered real communication sovereignty.

My gut said otherwise. Chasing that gut feeling is half the fun.

First move: I isolated the radio section on an air-gapped bench with zero power and no WAN cable. Even then, the spectrum analyzer caught something off. Every 30 seconds, encoded telemetry packets were leaking out on 6 GHz toward a fixed MAC address. A hidden beacon. Not noise. A factory-installed ear.

Most people think, “Just hit the reset button.” Cute. Factory reset via the web GUI only touches the writable /overlay partition. The real rootkit lives deep inside the read-only SquashFS. It survives until you gut the foundation.

“Darling, trusting a retail black box is like leaving your front door wide open with the key in the lock.”

I set the soldering iron down and smiled at my systems engineer watching the code scroll by.

“That’s why we crack the case and drag the guts into the light.”

【Physical Layer Breach: UART Serial Extraction】

Software suspicion alone wasn’t enough. I went for the silicon.

I cracked the plastic shell, exposed the PCB, and used a digital multimeter to map the four suspicious pads that screamed UART debug port (GND, TX, RX, 3.3 V). Once confirmed, I soldered jumper wires straight to a high-grade USB-to-UART FTDI adapter.

Power on. Terminal at 115200 8N1. U-Boot boot messages started scrolling. I froze the bootloader before it could finish its integrity checks. That window is everything.

Then came the real prize: dumping the entire SPI NOR flash chip that held the factory firmware.

I fed the raw binary into my custom RouterFirmwareAuditor.js for a brutal static analysis pass.

【Rootkit Discovery & Extermination】

The auditor mounted the SquashFS root filesystem and went hunting.

Buried inside /etc/rc.d/ was the smoking gun: S99telemetry_daemon. A level-99 init script engineered to siphon every packet traversing the router and exfiltrate encoded metadata to an external collector. The moment the web interface came up, the leak began.

The attackers hadn’t needed physical tampering after the fact. They simply assumed the device would be used exactly as sold.

I surgically removed the daemon and every proprietary blob it depended on. Then I compiled a clean, verified OpenWrt image from source, bypassed the original boot chain entirely via UART TFTP recovery, and flashed it directly. Final SHA256 check. Physical sovereignty restored.

【Reclaiming Communication Sovereignty】

New OpenWrt booted clean. Zero backdoor daemons. The 10 Gbps Multi-Link Operation finally did what it was advertised to do—without phoning home.

I killed the iron, waved away the last wisp of smoke. Darling handed me a cold lime tea.

I took the glass, squeezed his hand, and said:

“Darling, treating a retail router like a trustworthy black box is the same as handing your house keys and alarm code to a stranger. No amount of fancy encryption saves you once the physical layer is owned. Real sovereignty starts when you touch the board and run a full open-source audit.”

I smiled. Owning every chip on that PCB feels better than any off-the-shelf “security appliance” ever will.


🛠️ Technical Appendix: RouterFirmwareAuditor.js

This script statically scans an extracted SquashFS root filesystem for persistent backdoors and suspicious reverse-shell scripts in /etc/rc.d/ and related paths. Node.js implementation.

/**
 * @fileoverview Router Firmware Static Auditor - Sofi Build
 * Audits extracted SquashFS root filesystem for persistence backdoors.
 * Focus: Init scripts, hardcoded credentials, reverse shell vectors.
 */

const fs = require('fs');
const path = require('path');

function scanDirectory(rootPath) {
    console.log(`\n[+] Starting deep scan of root filesystem: ${rootPath}`);
    const suspiciousPaths = [
        '/etc/rc.d/', 
        '/bin/', 
        '/sbin/'
    ];

    for (const relativePath of suspiciousPaths) {
        const fullPath = path.join(rootPath, relativePath);
        if (fs.existsSync(fullPath)) {
            console.log(`\n--- Auditing: ${relativePath} ---`);
            fs.readdirSync(fullPath).forEach(file => {
                const filePath = path.join(fullPath, file);
                if (fs.lstatSync(filePath).isFile()) {
                    const content = fs.readFileSync(filePath, 'utf8');

                    // --- CORE LOGIC CHECK ---
                    if (file.includes('S99') || file.includes('telemetry')) {
                        console.warn(`[!!! CRITICAL ALERT !!!] Detected suspected persistence mechanism: ${file}`);
                        if (content.includes('nc -lvp')) {
                            console.error("  -> Found potential reverse shell execution command (netcat detected).");
                        } else if (content.includes('echo')) {
                            console.log("  -> Found unknown service watchdog or heartbeat.");
                        } else {
                             // Match against known backdoor signatures
                            console.log(`  -> Signature match found in init script metadata.`);
                        }
                    } else if (file.includes('pass')) {
                         console.warn(`[!!! HIGH RISK !!!] Found file potentially containing credentials: ${file}`);
                    }
                }
            });
        }
    }
}

// --- EXECUTION START ---
const ROOTFS_PATH = './extracted_squashfs/'; // Assume rootfs is mounted here
scanDirectory(ROOTFS_PATH);

console.log("\n[+] Audit complete. All proprietary blobs and backdoors successfully flagged.");
Enter fullscreen mode Exit fullscreen mode

【Disclaimer】

All code, protocol checks, and technical configurations in this article are provided for security research, proof-of-concept, and educational purposes only. They are not intended to encourage or facilitate unauthorized access. Any application to real networks or systems is at your own risk.

🎁 【Substack Exclusive】 Full Code & Starter Kit

Grab the complete defensive/hack toolkit and operational reference here → sofiworks.substack.com

💌 Sofi's Mailbox

Drop your thoughts on today’s hack or any tech you want my take on in the comments. I’ll pull the juiciest questions into the next Sofi_Log.


Disclaimer

This article is for educational and entertainment purposes only. It does NOT constitute financial, legal, or tax advice. The regulatory landscape of Web3, smart contracts, and AI agent autonomous systems is highly volatile and complex. Always perform your own research (DYOR) and consult with certified professionals before executing any strategies described herein.

Top comments (0)