1. Executive Summary
In short
On 13 November 2026, Odin by Brandefense analyzed Workbench A, a 532-entry adversary staging directory on TCP port 8000 of a Hong Kong server totaling 3.01 megabytes. The workspace pairs CMS configuration injection and rollback scripts with 155 polymorphic PHP shells, 29 taglib stream-wrapper modules, and PHP sandbox escape checks. Mount CMS code paths read-only, monitor taglib writes, and deploy structural YARA rules.
Legacy PHP content management systems often store site settings in editable database rows and compile template libraries inside web-accessible folders. An administrative session cookie lets an attacker inject PHP code into a setting, trigger a library file write, and restore the setting moments later. Routine admin-panel reviews then see clean settings while the dropped PHP library stays on disk.
On 13 November 2026, Odin by Brandefense studied Workbench A on TCP 8000 of a Hong Kong commercial cloud server. Across every artifact group, Workbench A is assessed consistently as an adversary staging workbench. Deduplicated indexing captured all 532 root entries, spanning 373 sized script files totaling 3,005,041 bytes (3.01 megabytes) and 159 unsized entries, with all 373 sized files stored in full.
Workbench A holds session cookies and Python scripts referencing 18 external target prefixes. Odin by Brandefense therefore publishes zero IPv4 addresses, zero per-build tokens, and zero target names. Only the attacker's own PHP tools are published, as 170 SHA-256 digests in the Indicators tab.
First, generated PHP factory files make up 282 of the 532 entries and 87.3 percent of sized bytes.
All 282 _payload_* files are sized and stored (2,624,055 bytes). They include 155 polymorphic XOR-gzip PHP shells, 82 33-byte version-echo scripts, 29 err*.lib.php modules (24 AES at 3,202 B), 5 self-unlinking wipers, and 11 PHP variants.
Second, all 155 polymorphic PHP shells randomize hashes and names while keeping one structural skeleton.
Ranging from 6,310 to 16,093 bytes (151 builds at ~16 KB), each build changes its filename, function names, and single-byte XOR seed. Every build still keeps 16-byte zero-padded key setup, pack("H*") hex blobs, destructor unpacking, and temp .dat or stream-wrapper execution without literal eval().
Third, Python campaign scripts pair CMS sys_info taglib injection with immediate setting and JavaScript restoration.
Stored injectors among the 86 sized Python scripts route signed WcmUserID__ckMd5 cookies through a local SOCKS5 proxy. The 95 unsized Python entries are known only by name. Injectors save the original sys_info value, stage a /include/taglib/ file write, and restore the original setting and modified JavaScript files.
Fourth, twelve escape checks and five self-deleting wipers test PHP restrictions and remove test files.
Diagnostic PHP modules inspect disable_functions, open_basedir, mail(), mb_send_mail(), and error_log mode-3 file writes. Five 92–97-byte wipers (471 B) unlink test files and call @unlink(__FILE__), though all 532 entries remain staged preparation rather than verified target impact.
Three Decisions for Enterprise Security Leaders
- Mount CMS code and taglib folders read-only and block direct external HTTP library requests. Give web workers read-only access to
/include/,/include/taglib/, and/templets/, and returnHTTP 403on external requests to*.lib.php. - Pair hash matching with structural YARA scanning and temporary
.datfile telemetry. Match webroots against the 170 published tool hashes, then scan for 16-byte key-padding andCacheStreamstream-wrapper skeletons. Alert on dot-prefixed.datfiles created in/tmporTemp. - Harden
php.iniruntime policies and rotate CMS cookie-signing keys. Disableputenv,mail,mb_send_mail,imap_open,imap_mail,pcntl_exec, anddlon web nodes, setffi.enable=false, lockopen_basedir, stream file audit logs off-host, and rotate CMS cookie salts.
The Study in Numbers
| Metric | Verified Scope |
|---|---|
| 532 | Deduplicated root entries on Workbench A recorded on 13 November 2026 (373 sized + 159 unsized). |
| 3.01 MB | Total sized volume (3,005,041 bytes across 373 stored PHP and Python script files on TCP 8000). |
| 282 | Generated _payload_* PHP factory files (2,624,055 bytes, 87.3% of sized workspace bytes). |
| 155 + 29 | Polymorphic XOR-gzip PHP shells (155 builds) paired with 29 err*.lib.php modules (24 AES at 3,202 B). |
| 181 | Root Python scripts (117 target-prefixed scripts = 379,841 bytes plus 64 unsized CMS playbooks). |
| 170 | SHA-256 digests of attacker tools in the Indicators tab (196 stored files; IP and 177 target-linked or generic file hashes withheld). |
| 26 + 12 | Config/JS restore and @unlink(__FILE__) items (26) paired with 12 disable_functions escape items. |
2. Workbench Architecture, 532-Entry Reconciliation, and Recording Scope
Workbench A sat on a Hong Kong commercial cloud server (address withheld) assessed consistently as an adversary staging workbench. On 13 November 2026, Odin by Brandefense recorded an open HTTP directory on TCP 8000 holding 324 PHP files, 181 Python scripts, and 27 staging notes and test files.
Platform owners use external attack surface management to spot exposed legacy CMS admin panels and open staging ports across external networks. Detection engineers also apply cyber threat intelligence to turn invariant PHP loader mechanics into host and network rules. Unlike stolen cloud keys seen in an earlier Odin study on WordPress persistence, Workbench A stages CMS sys_info injection paired with immediate config rollback. Figure 1 maps the four staged workspace tracks.

Complete 532-Entry Reconciliation Across Workspace Strata and File Kinds
Workbench A's live directory listing reported 532 files, matching our deduplicated count of 532 entries in (root). Those 532 entries split into 373 sized files totaling 3,005,041 bytes (3.01 MB) and 159 unsized entries. All 373 sized files were stored in full and inspected statically.
Generated _payload_* PHP files (ZONE-01, 282 files) hold 53.0% of entries and 87.3% of bytes (2,624,055 B). Target-prefixed Python scripts (ZONE-02, 117 entries across 18 withheld target prefixes) hold 86 sized files (379,841 B) and 31 unsized entries. Standalone PHP shells and notes (ZONE-03, 69 entries) and unprefixed Python playbooks (ZONE-04, 64 unsized entries) complete the root tree.
| Workspace stratum | Scope | Entries | Share (%) | Sized | Unsized | Sized bytes | Operational role |
|---|---|---|---|---|---|---|---|
ZONE-01: _payload_* PHP Factory | (root) | 282 | 53.0% | 282 | 0 | 2,624,055 | 155 _gz_ shells, 82 33-B PHPVER= scripts, 29 err*.lib.php (24 AES), 5 wipers (471 B), and 11 PHP variants. |
ZONE-02: Target-Prefixed .py Scripts | (root) | 117 | 22.0% | 86 | 31 | 379,841 | 117 Python scripts across 18 withheld target prefixes (86 stored) covering recon, upload, sys_info write, and config/JS restore. |
ZONE-03: Standalone PHP & Notes | (root) | 69 | 13.0% | 5 | 64 | 1,145 | 42 PHP files (aa_php52*, aa_php53*, bypass_try.php, diag_df.php), 17 text/HTML/JSON notes, 7 images, 2 other, 1 .bin. |
ZONE-04: Unprefixed .py Playbooks | (root) | 64 | 12.0% | 0 | 64 | 0 | 22 DedeCMS template/taglib/SWFUpload playbooks (copy_err_taglib.py, dede_tpl_playbook.py) + 42 session scripts. |
| Total | (root) | 532 | 100.0% | 373 | 159 | 3,005,041 | Exact parity (3.01 MB; all 373 sized files stored). |
A second breakdown reconciles the same 532 entries (373 sized, 159 unsized, 3,005,041 bytes) by file kind. Scripts (505 entries: 324 .php and 181 .py) make up 94.9% of entries and 100.0% of sized bytes. All 27 text, image, alias, and binary items were unsized on the directory index.
Artifact class (kind) | Entries | Share (%) | Sized | Unsized | Sized bytes | Verified contents |
|---|---|---|---|---|---|---|
PHP & Python scripts (script) | 505 | 94.9% | 373 | 132 | 3,005,041 | 324 .php files (287 sized = 2,625,200 B; 37 unsized) and 181 .py scripts (86 sized = 379,841 B; 95 unsized). |
Notes & session lists (text) | 17 | 3.2% | 0 | 17 | 0 | 15 .txt notes (godzilla_shells.txt, aa_php52_win_mcrypt.README.txt), 1 .html, and 1 .json. |
Upload test images (image) | 7 | 1.3% | 0 | 7 | 0 | 4 .png files, 2 .jpg files (harmless_probe.php.jpg), and 1 .gif file. |
Alias & extensionless (other) | 2 | 0.4% | 0 | 2 | 0 | 1 .php@ alias (aa_php52_ready.php@) and 1 extensionless entry (/dede). |
Binary entries (exe) | 1 | 0.2% | 0 | 1 | 0 | 1 unsized binary entry (/journalds.bin). |
| Total | 532 | 100.0% | 373 | 159 | 3,005,041 | Exact byte parity (3.01 MB; shares rounded to 0.1%). |
Figure 4 renders all 532 root entries as an exact 28 × 19 wafer matrix separating the 373 solid stored files from the 159 hollow unsized entries.

Single Recording Date Versus Iterative Script Revisions
Odin by Brandefense recorded Workbench A on 13 November 2026. Numbered Python revisions and 282 _payload_* builds reflect iterative tool preparation on Workbench A rather than runtime duration. Without target-side logs, none of the 532 entries confirm execution on any external CMS server.
3. Staged CMS sys_info Injection, Taglib Persistence, and Config Rollback
Legacy DedeCMS and regional web content managers (WCM) store site settings in a database table edited through the admin sys_info page and load tag helpers from /include/taglib/. Figure 3 shows an analytical model of the four-step Write-and-Restore workflow reconstructed from Workbench A's scripts. Every arrow is dashed to show staged preparation rather than verified target execution.

Four-Step Write-and-Restore Mechanics (CL-02, CL-03, and CL-05)
Clusters CL-02 (64 entries = 144,240 B), CL-03 (26 entries = 38,109 B), and CL-05 (90 entries = 9,172 B) form the core workflow. Together they show how staged scripts hide persistence behind clean settings (T1190, T1505.003, T1070.004; [REF-06], [REF-08], [REF-09]):
- SOCKS5 session and
WcmUserID__ckMd5cookie replay (T1090;[REF-10]). Python injectors routerequestscalls throughsocks5h://127.0.0.1:10808and passWcmUserID,WcmUserID__ckMd5,WcmLoginTime, andWcmLoginTime__ckMd5cookies. Each script first saves the baselineORIGsetting value so it can restore that exact string later. - Single-field
sys_infowrite into/include/taglib/*.lib.php. Seven sizedsys_infoinjectors (30,120 B; names withheld) and 27 unsized DedeCMS playbooks (copy_err_taglib.py,dede_getshell_playbook.py,dede_tpl_playbook.py) stage configuration writes designed to drop anerr.lib.phpmodule inside/include/taglib/. - Version-echo verification (
CL-05, 90 entries = 9,172 B). Eighty-two 33-byte_payload_*_phpver_echo_*.phpfiles (2,706 B) echoPHPVER=andPHP_VERSIONalongside 8 small echo and.php.jpgfiles (_probe_echo.phpat 31 B andharmless_probe.php.jpg). CheckingPHPVER=tells the operator whether a target runsPHP 5.2, 5.3, or 7/8. - Immediate
sys_info, JavaScript, and file rollback (CL-03, 26 entries = 38,109 B). After writing the taglib file, the 9 stored restore scripts (37,638 B) resetsys_infotoORIGand repair modified.jsorindexfiles. Another 11 restore items are known only by name. Five 92–97-byte_cleanup_*.lib.phpwipers (471 B) also unlink test files and call@unlink(__FILE__).
| Subgroup | Entries (sized / unsized) | Sized bytes | Structural role on Workbench A |
|---|---|---|---|
CL-02: err*.lib.php modules | 30 (30 / 0) | 114,120 | 29 err*.lib.php modules (24 AES-128-ECB CacheStream builds at 3,202 B + 5 variants = 112,785 B) plus explore2.lib.php (1,335 B). |
CL-02: sys_info & taglib .py | 34 (7 / 27) | 30,120 | 7 sized sys_info/cfg_write .py scripts (30,120 B; names withheld) + 27 unsized DedeCMS taglib items (copy_err_taglib.py). |
CL-03: Self-unlinking wipers | 6 (5 / 1) | 471 | 5 92–97-byte _cleanup_*.lib.php modules (471 B; @unlink target + @unlink(__FILE__)) + 1 unsized cleanup_probe.php. |
CL-03: Config & JS restore .py | 20 (9 / 11) | 37,638 | 9 sized *_js_restore.py, *_clean_fix.py, and *_cleanup_surface.py scripts (37,638 B) + 11 unsized restore items (reup_index.py). |
CL-05: PHPVER= echo checks | 90 (87 / 3) | 9,172 | 82 33-byte PHPVER= scripts (2,706 B) + 5 sized echo PHP files (6,466 B) + 3 unsized echo/jpg items. |
Multi-Target CMS Recon and Upload Scripts (CL-06, 161 Entries = 303,143 B)
Cluster CL-06 combines 67 sized Python scripts (303,143 B) with 94 unsized Python, text, HTML, image, and binary items. It spans 18 withheld target prefixes (1 to 27 scripts per prefix) plus reusable SWFUpload, UEditor, and WAF checks. Target names and cookies are withheld, and external execution remains unverified.
4. Polymorphic PHP Factory, Custom Stream Wrappers, and disable_functions Escape
Static web-shell scanners typically look for known file hashes or literal eval() and assert() calls (T1027; [REF-07]). Workbench A counters both checks through 155 polymorphic XOR-gzip implants (CL-01) and 29 err*.lib.php modules (CL-02, led by 24 cookie-keyed AES stream-wrapper builds). Figure 2 contrasts the randomized evasion surface against the invariant skeleton across the 184 _gz_ and err*.lib.php builds.

155 Polymorphic XOR-Gzip Implants and Legacy PHP 5.2/5.3 Shells (CL-01, 179 Entries = 2,495,247 B)
Cluster CL-01 holds 83.0% of workspace bytes, led by 155 _payload_*_gz_*.php files (6,310–16,093 B; 151 builds at ~16 KB and ~232 lines each). It adds 3 standalone _payload_* builds (up to 19,554 B), 20 unsized aa_php52*/aa_php53* shells, and godzilla_shells.txt. Static inspection confirms four shared design traits:
- Per-build randomization. Every
_gz_build changes its filename, 16-byte key helper (ak_<6char>), unpacker (sb_<6char>), single-byte XOR seed ($x), class names (CacheStream_<6char>,ServiceProvider_<6char>), and cookie/POST gate names ($_COOKIE[$ck],$_POST[$pk]). - Destructor unpacking and 16-byte key padding. Normal GET requests do nothing. When both cookie and POST keys arrive,
__construct()opensob_start()and__destruct()unpacks the stage usingstr_pad($key, 16, chr(0))andpack("H*"). - Temp
.datinclusion with split-stringstream_wrapper_registerfallback. Instead ofeval(),__destruct()stages a hidden file insys_get_temp_dir()(/.<5char><md5>.dat), runs@include($tf), and calls@unlink($tf). If temp writes fail, it joins"stream_wr"."apper_"."regist"."er", registersCacheStream_<6char>([REF-01],[REF-05]), and runs@include('<8char>://1')from class memory. - 56-byte masking and
PHP 5.2/5.3 shims. Responses of exactly 56 bytes (strlen($content) === 56) are replaced with' '. Stored variants such asindex.lib.phpstrip version gates and backportPHP_VERSION_IDandhash_equalsfor legacy servers. The 20aa_php52*/aa_php53*files are unsized and known only by name.
Cookie-Keyed AES-128-ECB Taglib Stream Wrappers (24 of 29 CL-02 err*.lib.php Builds) and CL-04 Escape Checks
Twenty-four 3,202-byte err*.lib.php modules (57 lines; alongside 5 XOR/stream variants at 3,430–15,947 B) decrypt hex chunks via @gzinflate(@openssl_decrypt(pack("H*",$h), 'AES-128-ECB', $pC, OPENSSL_RAW_DATA)), using the live cookie $pC as the AES key. The 24 modules are byte-identical copies. Each module then registers CacheStream_<6char>, runs @include('<scheme>://1') in memory, clears static state, and unregisters the scheme.
Cluster CL-04 (12 entries: 7 sized .php [6,190 B] + 3 sized .py [8,940 B] = 15,130 B, plus 2 unsized bypass_try.php and diag_df.php) tests php.ini restrictions ([REF-02]). Module diag_df.lib.php (722 B) dumps disable_functions, open_basedir, sapi, and 23 callable functions, while bypass_try.lib.php (2,664 B) tests mail.force_extra_parameters, mail()/mb_send_mail() ([REF-04]), and error_log mode-3 file appends ([REF-03]).
Figure 5 maps all six mutually exclusive clusters to layered network, file, process, and php.ini controls. Together they hold 179 + 161 + 90 + 64 + 26 + 12 = 532 entries (3,005,041 B).

5. Enterprise CMS, PHP Runtime, and File-Integrity Exposure Analysis
Web platform and SOC teams should check five defensive surfaces mapped to Workbench A's staged artifacts:
| Exposure layer | Observed Workbench A evidence | Control to verify | Risk if unguarded |
|---|---|---|---|
1. CMS admin cookies & sys_info | Stored .py injectors (86 sized of 181) replaying WcmUserID__ckMd5 cookies over SOCKS5. | Require MFA/IP allowlists on admin paths and rotate cfg_cookie_encode salts. | Replayed __ckMd5 cookies allow authenticated sys_info edits (T1190; [REF-09]). |
2. Writable /include/taglib/ paths | 29 err*.lib.php (24 AES at 3,202 B) + copy_err_taglib.py + 26 CL-03 restore/wiper items. | Mount /include/ and /templets/ read-only and block direct HTTP POST to *.lib.php. | Rollback leaves sys_info clean while .lib.php backdoors persist (T1505.003; [REF-06]). |
| 3. Polymorphic PHP & stream wrappers | 155 _gz_ shells (~16 KB) using 16-B str_pad, temp /.dat drops & split wrapper strings. | Match the 170 published tool hashes, scan with structural YARA rules, and monitor /tmp/.*.dat file events ([REF-01], [REF-05]). | Per-build XOR keys and eval-free streams evade hash and regex scans (T1027; [REF-07]). |
4. Partial php.ini restrictions | 12 CL-04 items (diag_df.lib.php, bypass_try.lib.php) testing mail and error_log mode 3. | Block putenv, mail, mb_send_mail, imap_open, imap_mail, pcntl_exec, dl, set ffi.enable=false, & set open_basedir ([REF-02]–[REF-04], [REF-11]). | Blocking only system/exec leaves mail LD_PRELOAD and error_log file writes open. |
5. Web egress & @unlink wiping | 282 _payload_* files on TCP 8000 + 5 92–97-B _cleanup_*.lib.php self-unlinking wipers. | Block direct outbound HTTP from web nodes and stream file audit logs off-host ([REF-08]). | Workers fetch staged .php files while @unlink(__FILE__) erases short-lived checks. |
6. Alternative Hypotheses and Analytical Boundaries
| Hypothesis | Evidence for | Evidence against / analytical limit | Assessment |
|---|---|---|---|
H1: Staged Write-and-Restore scripts achieved persistent access on the 18 target groups | Scripts hold WcmUserID__ckMd5 cookies, ORIG strings, and iterative revisions (1–27 per prefix). | Workbench A holds staged operator files only, with no target-side logs confirming external execution or restoration. | Unverified. Treat all 532 entries as staged preparation with zero compromise claims. |
| H2: Benign developer backup or authorized security testing workspace | Contains non-destructive 33-byte PHPVER= echo checks (CL-05) and PHP 5.2 notes. | Stages 155 polymorphic shells, 24 cookie-keyed AES CacheStream implants (29 err*.lib.php), config/JS rollback scripts, and @unlink(__FILE__) wipers across 18 targets. | Contradicted. Covert taglib implants and anti-forensic rollback confirm an adversary workbench. |
| H3: Multi-tenant mirror combining unrelated operator kits | Spans 18 target prefixes alongside generic DedeCMS playbooks and PHP 5.2–8 variants. | Shared _<prefix>_*.py naming, the same socks5h://127.0.0.1:10808 setting, and one CacheStream_<6char> / ServiceProvider_<6char> class template tie the clusters together. | Contradicted. Shared conventions point to one cohesive operator workbench. |
| H4: Single-operator CMS intrusion workbench pairing polymorphic PHP with config rollback | All 6 clusters (532 entries) align around PHPVER= checks, sys_info taglib writes, stream-wrapper implants, escape checks, and rollback. | Workbench A was recorded on one date (13 November 2026) and lacks a second confirmed C2 port on the same IP. | Supported. Assess Workbench A as an adversary staging host while withholding its IP and hashes. |
7. Validated Detection Engineering
Monograph 74 withholds Workbench A's IPv4 address, per-build tokens, target names, and the hashes of 177 target-linked or generic files. Defenders should therefore pair the 170 published tool hashes with HTTP protocol, web-worker file-event, process, and structural YARA rules.
Static syntax checks passed in the Odin Suricata linter (0 problems across 6 rules), alongside offline validation of Sentinel KQL, 3 Sigma rules, and 4 filesize-bounded YARA rules. Because live suricata -T, Kusto.Language, pySigma, and YARA engines were not run against production sensor traffic in this build environment, test each rule in staging first.
7.1 Network Detection: Suricata 7.x Ruleset (sid:9574001–9574006)
Inbound rule sid:9574001 ($EXTERNAL_NET -> $HOME_NET, to_server) alerts on HTTP POST requests to sys_info URIs carrying include/taglib/ and .lib.php in the request body. Rule sid:9574002 alerts on inbound POST requests carrying WcmUserID__ckMd5= and WcmLoginTime__ckMd5= cookies, and sid:9574003 alerts on direct external POST requests to /include/taglib/*.lib.php. Normal admin sessions also send these cookies, so treat sid:9574002 as a hunting signal and review hits from unexpected source networks.
Response rules sid:9574004 and sid:9574005 ($HOME_NET -> $EXTERNAL_NET, to_client) match HTTP 200 bodies returning PHPVER= or disable_functions=, open_basedir=, and sapi=. Outbound rule sid:9574006 ($HOME_NET -> $EXTERNAL_NET, to_server) alerts on HTTP GET requests for /_payload_ .php files. None of these alert rules block traffic inline, and all six require cleartext HTTP or TLS-terminating proxy visibility.
# Odin by Brandefense - Monograph 74 Suricata 7.x Ruleset
# Static syntax checked with Odin Suricata linter (0 problems); test with suricata -T before deployment.
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"ODIN-R74 Inbound CMS sys_info Config Write Referencing Taglib Path"; flow:established,to_server; http.method; content:"POST"; bsize:4; http.uri; content:"sys_info"; nocase; http.request_body; content:"include/taglib/"; nocase; fast_pattern; content:".lib.php"; nocase; classtype:web-application-attack; sid:9574001; rev:1;)
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"ODIN-R74 Inbound WCM Signed Admin Cookie on HTTP POST"; flow:established,to_server; http.method; content:"POST"; bsize:4; http.cookie; content:"WcmUserID__ckMd5="; fast_pattern; content:"WcmLoginTime__ckMd5="; classtype:web-application-attack; sid:9574002; rev:1;)
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"ODIN-R74 Inbound Direct HTTP POST to CMS Taglib Library"; flow:established,to_server; http.method; content:"POST"; bsize:4; http.uri; content:"/include/taglib/"; nocase; fast_pattern; content:".lib.php"; nocase; classtype:web-application-attack; sid:9574003; rev:1;)
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"ODIN-R74 Outbound PHPVER Version Echo Marker in HTTP 200 Response"; flow:established,to_client; http.stat_code; content:"200"; bsize:3; file.data; content:"PHPVER="; fast_pattern; classtype:web-application-attack; sid:9574004; rev:1;)
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"ODIN-R74 Outbound PHP disable_functions and open_basedir Diagnostic Response"; flow:established,to_client; http.stat_code; content:"200"; bsize:3; file.data; content:"disable_functions="; fast_pattern; content:"open_basedir="; distance:0; within:512; content:"sapi="; distance:0; within:256; classtype:web-application-attack; sid:9574005; rev:1;)
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"ODIN-R74 Outbound HTTP GET for Staged _payload_ PHP Artifact"; flow:established,to_server; http.method; content:"GET"; bsize:3; http.uri; content:"/_payload_"; fast_pattern; content:".php"; distance:0; classtype:trojan-activity; sid:9574006; rev:1;)7.2 Endpoint & File-Integrity Hunting: Microsoft Sentinel KQL
This 7-day Sentinel KQL query correlates DeviceFileEvents and DeviceProcessEvents for Linux/Windows web workers (php, php-fpm and php-cgi including versioned builds such as php-fpm8.2, plus apache2, httpd, nginx, and w3wp.exe). Part one surfaces .lib.php writes under include/taglib and dot-prefixed .dat creation or deletion inside /tmp or Temp. Part two catches web workers spawning shells or sendmail and commands referencing include/taglib/ or workbench playbooks. Replace the placeholder FQDNs in ApprovedCmsDeployAndMailHosts before scheduling.
// Odin by Brandefense - Monograph 74
// Hunts CMS include/taglib/*.lib.php file writes, ephemeral hidden .dat PHP staging files, and PHP worker shell/mail child processes.
let Lookback = 7d;
let ApprovedCmsDeployAndMailHosts = dynamic(["cms-deploy-01.corp.example", "mail-relay-01.corp.example"]);
let WebWorkerRegex = @"(?i)^(php(-fpm|-cgi)?[0-9.]*(.exe)?|apache2|httpd|nginx|w3wp.exe)$";
let PhpTaglibAndEphemeralDatFileEvents =
DeviceFileEvents
| where Timestamp >= ago(Lookback)
| where not(DeviceName in~ (ApprovedCmsDeployAndMailHosts))
| where InitiatingProcessFileName matches regex WebWorkerRegex
| where (
((FolderPath contains "/include/taglib" or FolderPath contains "\include\taglib") and FileName endswith ".lib.php")
or (ActionType in ("FileCreated", "FileDeleted") and FileName startswith "." and FileName endswith ".dat" and (FolderPath contains "/tmp" or FolderPath contains "\Temp"))
)
| project Timestamp, DeviceName, AccountName = InitiatingProcessAccountName, SignalType = "PhpTaglibOrHiddenDatFileEvent", Detail = strcat(InitiatingProcessFileName, " [", ActionType, "] -> ", FolderPath, "/", FileName);
let PhpWorkerEscapeAndStagingProcesses =
DeviceProcessEvents
| where Timestamp >= ago(Lookback)
| where not(DeviceName in~ (ApprovedCmsDeployAndMailHosts))
| where (
(InitiatingProcessFileName matches regex WebWorkerRegex and FileName in~ ("sh", "bash", "dash", "sendmail", "cmd.exe", "powershell.exe"))
or (ProcessCommandLine contains "include/taglib/" and ProcessCommandLine contains ".lib.php")
or ProcessCommandLine has_any ("copy_err_taglib.py", "dede_getshell_playbook.py", "dede_tpl_playbook.py")
or ProcessCommandLine contains "_payload_"
)
| project Timestamp, DeviceName, AccountName, SignalType = "PhpWorkerChildOrTaglibStagingProcess", Detail = strcat(InitiatingProcessFileName, " -> ", FileName, ": ", ProcessCommandLine);
union PhpTaglibAndEphemeralDatFileEvents, PhpWorkerEscapeAndStagingProcesses
| summarize FirstSeen = min(Timestamp), LastSeen = max(Timestamp), EventCount = count(), Signals = make_set(SignalType, 6), SampleDetails = make_set(Detail, 5) by DeviceName, AccountName
| order by LastSeen desc7.3 Portable Sigma and Bounded YARA Rules
sigma_web_cms_taglib_write_and_php_temp_dat.yml(3 rules): Rule 1 (file_event) detects PHP or web workers writing.lib.phpfiles under/include/taglib/orincludetagliboutsidecms-deploy-01[.]corp[.]example. Rule 2 (file_event) detects PHP or web workers writing hidden.datfiles under/tmp/.,/var/tmp/., orTemp.outsidecms-deploy-01[.]corp[.]example. Rule 3 (process_creation) detects PHP or web workers spawning/sh,/bash,/dash,/sendmail,/sendmail.postfix,cmd.exe, orpowershell.exeoutsidemail-relay-01[.]corp[.]example.odin_polymorphic_php_and_stream_wrapper_kits.yar(4 rules): Rule 1 (< 64KB) matchesstr_pad($key, 16, chr(0)),pack("H*", ",ob_get_clean(), and split"stream_wr"."apper_"or.dat';acrossCL-01shells. Rule 2 (< 32KB) matchesfunction stream_open(,openssl_decrypt(pack("H*",'AES-128-ECB',stream_wrapper_register(, andfunction __destruct()acrossCL-02err*.lib.phpmodules. Rule 3 (< 32KB) matchesdisable_functions,error_log,mb_send_mail, andopen_basedirormail.force_extra_parametersacrossCL-04files. Rule 4 (< 64KB) matches Pythonsys_info+include/taglib//.lib.php+WcmUserID__ckMd5orsocks5h://127.0.0.1:injectors.
8. Indicators and Behavioral Hunt Markers
The Indicators tab holds 0 IPv4 addresses and 170 SHA-256 digests of attacker tools. They cover 196 stored files: 155 polymorphic _gz_ builds, 29 err*.lib.php modules, 5 cleanup wipers, and 7 standalone tools. The 24 AES taglib modules are byte-identical and share one digest, and 3 other taglib variants are copies of shell builds.
Hashes of 177 other stored files stay withheld: 86 target-prefixed Python scripts, 82 identical 33-byte echo files, and 9 small target-named, database-test, or echo probes. The IPv4 address stays withheld because Workbench A lacks a second independent C2 listener signal and held session cookies and target scripts. All 18 target prefixes and randomized build IDs are withheld. Table 4 adds 9 behavioral, HTTP protocol, and PHP structural markers (R74-HM-01 to R74-HM-09) that stay text-and-rule based.
| ID | Category | Pattern / protocol or host structure | Layer | Defensive action |
|---|---|---|---|---|
R74-HM-01 | CMS config write | POST to sys_info with include/taglib/ and .lib.php | HTTP 80/443 | Lock sys_info admin access, mount include/taglib/ read-only, alert via sid:9574001. |
R74-HM-02 | Signed WCM cookie | WcmUserID__ckMd5= and WcmLoginTime__ckMd5= on POST | HTTP 80/443 | Rotate cfg_cookie_encode salt, enforce admin MFA/IP allowlists, alert via sid:9574002. |
R74-HM-03 | Direct taglib POST | External POST /include/taglib/*.lib.php with cookie + POST gate | HTTP 80/443 | Deny external HTTP requests to /include/ and alert via sid:9574003. |
R74-HM-04 | Polymorphic _gz_ PHP | str_pad($key, 16, chr(0)) + pack("H*") + /.dat or split wrapper | PHP / temp FS | Scan with YARA Rule 1 and monitor /tmp/.*.dat via KQL and Sigma Rule 2 ([REF-01], [REF-07]). |
R74-HM-05 | CacheStream taglib | function stream_open( + AES-128-ECB openssl_decrypt + __destruct | include/taglib/ | Enforce FIM on include/taglib/*.lib.php and scan with YARA Rule 2 ([REF-01], [REF-06]). |
R74-HM-06 | Self-unlink & .dat wipe | PHP worker creating and unlinking *.lib.php or /tmp/.*.dat | Host FS | Stream file-create and file-delete audit logs off-host ([REF-08]) and hunt via KQL / Sigma Rules 1–2. |
R74-HM-07 | Diagnostic echo | HTTP 200 body containing PHPVER= or disable_functions= + open_basedir= | HTTP 80/443 | Alert via sid:9574004–9574005 and scan with YARA Rule 3. |
R74-HM-08 | Sandbox escape | PHP worker spawning sendmail, sh, bash, cmd.exe, or error_log mode 3 | PHP runtime | Harden php.ini disable_functions & open_basedir ([REF-02]–[REF-04]), Sigma Rule 3. |
R74-HM-09 | Staging pull GET | Outbound HTTP GET /_payload_*.php from web server | HTTP 8000 | Block direct outbound HTTP egress from web servers and alert via sid:9574006. |
9. Hardening Priorities for CMS Platforms and PHP Fleets
- Mount CMS code and
/include/taglib/paths read-only (0–48 Hours). Give web workers read-only permissions on/include/,/include/taglib/, and/templets/, and block direct external HTTP requests to/include/or*.lib.phpwithHTTP 403([REF-06],[REF-09]). - Rotate CMS cookie-signing salts and gate admin endpoints (
0–72 Hours). Rotatecfg_cookie_encodekeys to invalidate capturedWcmUserID__ckMd5cookies (sid:9574002), place CMS admin routes behind VPN or MFA, and audit database change logs rather than staticsys_infosettings alone. - Deploy structural YARA scans and off-host file-deletion telemetry (
Days 1–7). Match webroots against the 170 published tool hashes and scan them withodin_polymorphic_php_and_stream_wrapper_kits.yar([REF-01],[REF-05],[REF-07]). Forwardauditdor SysmonFileCreateandFileDeleteevents off-host so@unlink(__FILE__)wipers and temp/.datstages leave durable records ([REF-08]). - Close
php.inidisable_functions,open_basedir, anderror_loggaps (Days 7–14). RetirePHP 5.2–5.6 runtimes, enforce per-siteopen_basedir([REF-02]), lockerror_logto an immutable log path ([REF-03]), setffi.enable=false([REF-11]), and includeputenv,mail,mb_send_mail,imap_open,imap_mail,pcntl_exec,dlalongsideexec,shell_exec,system,passthru,proc_open,popenindisable_functions([REF-04]). - Block direct outbound HTTP egress from web tiers (
Days 14–30). Deny unproxied outbound HTTP connections from web workers onTCP 80, 443, and 8000 (sid:9574006).
10. Scope, Limits, and Sources
Odin by Brandefense analyzed Workbench A, an unauthenticated TCP 8000 directory on a Hong Kong cloud server recorded on 13 November 2026. Deduplicated indexing captured all 532 root entries: 373 sized and stored script files totaling 3,005,041 bytes (3.01 MB) and 159 unsized entries.
All 532 entries represent staged preparation on Workbench A and do not confirm code execution or config restoration on any external host. Workbench A's IP, the hashes of 177 target-linked or generic files, per-build tokens, cookies, and 18 target prefixes are withheld. The Indicators tab publishes 170 attacker-tool SHA-256 digests.
[REF-01]The PHP Group, *PHP Manual: stream_wrapper_register* (verified on 29 November 2026).[REF-02]The PHP Group, *PHP Manual: Core php.ini Directives (disable_functions and open_basedir)* (verified on 29 November 2026).[REF-03]The PHP Group, *PHP Manual: error_log Message Type 3 File Append* (verified on 29 November 2026).[REF-04]The PHP Group, *PHP Manual: mail and Sendmail Parameters* (verified on 29 November 2026).[REF-05]OWASP Foundation, *Web Security Testing Guide: Local File Inclusion and PHP Wrapper Abuse* (verified on 29 November 2026).[REF-06]MITRE ATT&CK, *Server Software Component: Web Shell (T1505.003)* (verified on 29 November 2026).[REF-07]MITRE ATT&CK, *Obfuscated Files or Information (T1027)* (verified on 29 November 2026).[REF-08]MITRE ATT&CK, *Indicator Removal: File Deletion (T1070.004)* (verified on 29 November 2026).[REF-09]MITRE ATT&CK, *Exploit Public-Facing Application (T1190)* (verified on 29 November 2026).[REF-10]MITRE ATT&CK, *Proxy (T1090)* (verified on 29 November 2026).[REF-11]The PHP Group, *PHP Manual: FFI Runtime Configuration (ffi.enable)* (verified on 29 November 2026).
Frequently asked questions
How Were the 532 Root Entries on Workbench A Organized Across PHP and Python Layers?
Workbench A was recorded on 13 November 2026 on TCP 8000. Its directory listing reported 532 root files, matching our deduplicated count of 532 entries across 373 sized and stored script files (3,005,041 bytes, 3.01 MB) and 159 unsized entries.
How Do Config-Restore Scripts Pair With Eval-Free Polymorphic PHP Implants?
Four staged technical patterns span Workbench A, and every cluster reflects operator preparation rather than confirmed external compromise: Figure 3 models how staged sys_info injection and immediate setting rollback leave the sys_info settings clean while /include/taglib/err.lib.php remains staged on disk.
What Should CMS Platform, PHP Runtime, and Detection Teams Do First?
Blue teams can close each of these staged paths with three concrete actions: