b374k 3.2.3 is the gold standard of compact webshells — a polished, Indonesian-scene codebase with gzip+base64 embedded resources and a modular single-page application architecture.

Capabilities

Full-featured file manager, command execution, database browser, process viewer, and network tools — all packed into 225 KB. The payload is self-contained: no external resource loads, no CDN dependencies, everything embedded.

Anti-Bot Evasion

The dominant design feature is User-Agent masquerading. The shell inspects the incoming request’s User-Agent string and returns a convincing HTTP 404 page to any request matching common automated tools — curl, wget, python, spider, and similar scanner signatures. Only requests with a browser-class User-Agent receive the real control panel. This makes b374k invisible to most automated webshell scanners and incident response scripts that use command-line HTTP clients.

The default password b374k is stored as a sha1(md5()) hash in the source — recoverable by anyone with read access to the PHP file on disk.

W0rm Supply-Chain Backdoor

Redistributed copies carry a W0rm prepend injection that fires before any authentication check. The backdoor provides unauthenticated remote code execution, mail-based exfiltration, and arbitrary file upload to any visitor who knows the trigger — no password required. The anti-bot evasion that protects the shell from defenders also masks the supply-chain backdoor from cursory inspection: the operator’s own security-through-obscurity works against them.

Vulnerabilities

#ClassImpactStatus
1W0rm prepend — unauthenticated RCE + exfil at global scopePre-auth RCELive-proven
2Auth hash (sha1(md5())) exposed in plaintext sourceCredential exposureConfirmed

Detection Surface

File-system indicators

IndicatorTypeDetail
Single PHP file ≈ 225 KBSizeSelf-contained SPA — unusually large for a single PHP script
$GLOBALS['resources']VariableResource embedding for CSS/JS/images (unique to b374k)
sha1(md5($password))Auth hashDefault hash: 7d8aeb6aa919f46e398885e338abbcdba143eb93
$packetHost, $packetPortVariablesNetwork module (unique to b374k)
block_bot()FunctionAnti-bot 404 evasion
@system($code) + @shell_exec($code) + @passthru($code) + @proc_open($code + @popen($codeExec chain5-method execution using $code variable
errors_log in webrootMarker fileW0rm drops this on first execution (W0rm variant only)

HTTP access-log indicators

Log patternWhat it means
GET /path/shell.php?cmd=<command>W0rm backdoor — unauthenticated OS command execution
GET /path/shell.php?xsec=blockerW0rm file upload trigger — drops arbitrary files to webroot
HTTP 404 response with body > 10 KBAnti-bot evasion — real 404 pages are < 500 bytes
POST to single PHP file with response > 100 KBSPA architecture — all shell actions are AJAX to one endpoint
Multiple POST requests to same PHP file within secondsSPA file browse / command exec / DB queries

YARA rules

rule webshell_b374k {
    meta:
        description = "b374k webshell v3.x (source or packed)"
        author      = "OHIIHO Threat Research"
        reference   = "https://research.ohiiho.com/arsenal/b374k/"
        status      = "validated"

    strings:
        $title     = "b374k" ascii nocase
        $packer    = "gzinflate(base64_decode(" ascii
        $auth      = "sha1(md5($" ascii
        $res       = "$GLOBALS['resources']" ascii
        $ua_check  = "HTTP_USER_AGENT" ascii
        $ua_bot1   = "\"curl\"" ascii
        $ua_bot2   = "\"wget\"" ascii
        $ua_bot3   = "\"python\"" ascii
        $ua_bot4   = "\"spider\"" ascii
        $proc_open = "proc_open($code" ascii
        $fsock     = "fsockopen($packetHost" ascii

    condition:
        filesize < 300KB and $title
        and ($packer
             or $res or $proc_open or $fsock
             or ($ua_check and 2 of ($ua_bot*))
             or $auth)
}

W0rm-infected variants are also caught by the generic W0rm supply-chain rule — see the W0rm supply-chain detection applicable to all infected tools.

MITRE ATT&CK

TechniqueContext
T1505.003Web Shell
T1059.004Command and Scripting Interpreter: Unix Shell
T1041Exfiltration Over C2 Channel (W0rm mail exfil)
T1036Masquerading (anti-bot 404 evasion)

OHIIHO Threat Research.