1.目录遍历
![](https://img-blog.csdnimg.cn/img_convert/c7addb6b50b03eacd6b2930e5c8952ed.png)
点击找flag,进入后发现是目录遍历
![](https://img-blog.csdnimg.cn/img_convert/20c6779a57414ebaccb88632110f2a21.png)
flag
![](https://img-blog.csdnimg.cn/img_convert/c5e356011a9fea1cbb393c3292e6ff5a.png)
2.phpinfo
![](https://img-blog.csdnimg.cn/img_convert/2d20c37adbd6320dc40f33c9dd2e71b5.png)
点击查看,搜索ctfhub{
![](https://img-blog.csdnimg.cn/img_convert/876066d66875795d9c1261f67ee829d2.png)
3.备份下载
-1 网站源码
![](https://img-blog.csdnimg.cn/img_convert/8c4edd2b0566ae0840bbe44bd564d301.png)
一个一个试,最后试出试www.zip,解压出三个文件,发现关键文件flag_197692240.txt
![](https://img-blog.csdnimg.cn/img_convert/84acf51dc2f699ebb800cb76a8667bdc.png)
访问这个文件,得到flag
![](https://img-blog.csdnimg.cn/img_convert/658943d69fd77bbb16b7ba06de56dc02.png)
-2 bak文件
![](https://img-blog.csdnimg.cn/img_convert/04535d60fa0d32f81d885576a50b6737.png)
下载index.php.bak文件,使用notepad++打开文件,发现flag
![](https://img-blog.csdnimg.cn/img_convert/fd35b82e20f63739bc5f9c36a9d47afb.png)
-3 vim
![](https://img-blog.csdnimg.cn/img_convert/0136c1e8a3c2f06c57d35d7d35b1614f.png)
vim备份文件后缀名.文件名.swp格式,本题下载.index.php.swp
之后使用notepad++打开,得到flag
![](https://img-blog.csdnimg.cn/img_convert/fb510c4b18687ba24a31d1439aadaa0f.png)
-4.DS_Store
![](https://img-blog.csdnimg.cn/img_convert/76547b0201358a0851d3c9f478de847d.png)
这题用到一个脚本,可以进行分析当前的目录结构 ds_store_exp,发现关键文件
![](https://img-blog.csdnimg.cn/img_convert/65edf032bda32a68cb9a16c91a304be4.png)
访问文件,得到flag
![](https://img-blog.csdnimg.cn/img_convert/406494488a4da4cc6bb1ad6addd85707.png)
4.git泄露
git是分布式版本控制系统,由于开发人员配置不当导致.git文件泄露,攻击者可以通过.git文件去获取开发人员通过git提交过的所有源码,进而导致服务器被攻击或沦陷
-1log
![](https://img-blog.csdnimg.cn/img_convert/940754117e9ad6011e242f09cd09eeac.png)
工具:GitHack
https://github.com/BugScanTeam/GitHack
通过工具下载对应,.git文件
python GitHack.py http://challenge-c0d81c35f04e6dda.sandbox.ctfhub.com:10800/.git
![](https://img-blog.csdnimg.cn/img_convert/05c3b6d7185ef218f2c6ac28f37cc172.png)
进入生成的目录,查看目录的修改信息
git log #查看master一个分支的修改信息
git rerlog#可以看到一些分支的一些信息,如果有其他分支,secret
需要手动下载secret分支的信息,保存到./git/heads/secret,wget http://127.0.0.1/.git/refs/heads/secret
在复用工具恢复secret的信息,
复用工具需要修改githacker.py源码获取其他分支的信息,在通过下面的几个步骤获取flag,因为flag可能在其他分支里
源码修改:
if__name__:"__main__":
#main()
baseurl=complete_url('http://127.0.0.1/.git')
temppath=replace_bad_chars(get_prefix(baseurl))
fixmissing(baseurl,temppath)
![](https://img-blog.csdnimg.cn/img_convert/e425869640928fb11c835477da30648b.png)
获取flag
git HEAD 27ba #hash前4位
![](https://img-blog.csdnimg.cn/img_convert/cbeeb4e4f2c85d660b76891b7228d7b4.png)
-2stash
使用工具和下载源码,进入相关目录
git stash list
![](https://img-blog.csdnimg.cn/img_convert/f79b52cd84b3941d6ef26c242475076c.png)
git stash pop
![](https://img-blog.csdnimg.cn/img_convert/6121bc8395a21155e60cae04fb9c7a17.png)
-3index
直接使用工具下载,查看文件即可
![](https://img-blog.csdnimg.cn/img_convert/404f9fa41cb38be81c299d0b656686dc.png)
5.svn泄露
工具:dvcs-ripper
GitHub - kost/dvcs-ripper: Rip web accessible (distributed) version control systems: SVN/GIT/HG...
注意官方文档只能在ubuntu和debain系统中使用
出现的问题:如果使用工具报错
![](https://img-blog.csdnimg.cn/img_convert/97058b8c96d769857fc904ccfbb58a84.png)
需要安装
apt-get install perl libio-socket-ssl-perl libdbd-sqlite3-perl libclass-dbi-perl libio-all-lwp-perl
安装时又报错
![](https://img-blog.csdnimg.cn/img_convert/4372a17ed551b250253f8d9b1e04aceb.png)
可以执行以下命令:
apt install binutils
#在重新安装
apt-get install perl libio-socket-ssl-perl libdbd-sqlite3-perl libclass-dbi-perl libio-all-lwp-perl
使用工具下载svn,是-u参数,不要使用官方-u -v的参数
![](https://img-blog.csdnimg.cn/img_convert/45663f48d08cdc20f42eab71dd910ebf.png)
进入目录,.svn是隐藏目录
![](https://img-blog.csdnimg.cn/img_convert/5910d6918af1ae5dd6ecce2411016364.png)
进入到printine目录,进入到bf目录,查看文件内容,没找到flag
![](https://img-blog.csdnimg.cn/img_convert/24d22d512fa6f74d821f3e88623adff5.png)
进入cf目录,查看内容
![](https://img-blog.csdnimg.cn/img_convert/8a2c67632eeec6961c8671b22b465eb8.png)
6.hg泄露
还是使用上面的工具
dvws-ripper
下载hg源码,一个一个目录进,查看flag
![](https://img-blog.csdnimg.cn/img_convert/c7a626b538450caace4ced713532c406.png)
直接在url中访问txt文件即可
![](https://img-blog.csdnimg.cn/img_convert/512c3dc9bd24e16c488832b7a15f5e66.png)
参考文章:
(12条消息) E: 错误,pkgProblemResolver::Resolve 发生故障,这可能是有软件包被要求保持现状的缘故。_小小学习家的博客-CSDN博客
《从0到1CTFer成长之路》