File Disclosure

Common leaked classified documents
Github
git
svn
.DS_Store
.hg
.bzr
cvs
WEB-INF
Site backup, zip, sql, rar, swp, phpinfo
 
A, GitHub File Disclosure
 
Github is currently the world's most popular online collaboration site, a large number of programmers to share their code, and third-party software development on Github. At the same time, some programmers for various reasons do not delete important sensitive information shared code, and be used by hackers to attack systems.
 
The following diagram developers can easily lead to sensitive information uploaded

 

 

Two, .git file disclosure
 
init initialization code library time, will produce a hidden directory in the current directory .git running git, it is used to record changes recorded code, and so on. When the release code, .git This directory is not deleted, directly released. Using this file, it can be used to restore the source code.
 
1: Recovery
Tool Principle:
Resolve .git / index file, locate the project in all: (file name, file sha1)
Go .git / objects / folder to download the corresponding file
zlib extracting file, the source code written by the original directory structure
 
2: protective measures
① delete .git file
② by apache / nginx to deny access .git
 
Three, .svn file disclosure
 
svn creates a named .svn in the project root directory is hidden folder, contains all the information and code branch commit record.
 
1: Exploit way
① execute the following two commands to extract the source code
wget -r --no-parent --mirror http://www.example.com/.svn
cd www.example.com && svn revert --recursive .
②: the following script to perform the restore command to get the source code
下载地址:https://github.com/kost/dvcs-ripper的脚本
执行命令:rip-svn.pl -v -u http://yourdomain/.svn/
③通过Seay-Svn工具来提取源码
 
2:防护措施
①设置SVN密码,并将匿名访问用户的权限设置为none。
发布代码时使用svn export导出,而不要使用svn co检索,防止泄露目录结构。
③通过Apache、Nginx做限制访问。
Apache:
<Directory ~ "\.svn">
Order allow,deny
Deny from all
</Directory>
 
Nginx:
location ~ ^(.*)\/\.svn\/ {
return 404;
}
 
四、.DS_Store文件泄露
 
.DS_Store是Mac下Finder用来保存如何展示 文件/文件夹 的数据文件,每个文件夹下对应一个。
如果开发/设计人员将.DS_Store上传部署到线上环境,可能造成文件目录结构泄漏,特别是备份文件、源代码文件。
 
1:漏洞利用方式
①通过下面脚本对文件目录的扫描解析
 
2:防护措施
①通过命令删除.DS_Store文件
 
 
五、.hg文件泄露
 
Mercurial 是一个 版本控制系统. 开发者可以用它来管理源代码.hg在初始化代码库的时候,会在当前目录下面产生一个.hg的隐藏文件。
 
1:漏洞利用方式
①通过下面工具来执行命令获取信息
执行命令:rip-hg.pl -v -u http://www.example.com/.hg/
 
2:防护措施
①删除.hg文件
 
六、.bzr文件泄露
Bazaar-NG 是个分散式版本控制系统,旨在易于开发人员和最终用户的使用。分散式版本控制系统采用了 集市开发模型 ,可让人们通过互联网进行协作。如果使用 Bazaar-NG,您就可以向最喜欢的自由软件项目提交自己的分支,同时无需特殊权限。
 
1:漏洞利用方式
①通过下面工具来执行命令获取信息
执行命令:rip-hg.pl -v -u http://www.example.com/.hg/
 
2:防护措施
①删除.bzr文件
 
七、cvs文件泄露
 
TortoiseCVS 是一款项目管理工具,一般用在IT行业,有服务器版和客户端版,在客户机上装了CVS,能够从服务器上迁出数据 。是Windows平台上最最简单最最方便的CVS工具,TortoiseCVS的特点就是完全结合到资源管理器的鼠标右键菜单中进行操作,异常简单和方便。cvs的一个windows客户端程序,功能当然是实现cvs的一些操作。CVS是指并发版本系统(Concurrent Versions System)。
 
1:漏洞利用方式
①利用工具
执行命令:rip-cvs.pl -v -u http://www.example.com/CVS/
 
2:防护措施
①删除.cvs文件
 
八、WEB-INF/web.xml文件泄露
 
WEB-INF是Java的WEB应用的安全目录。如果想在页面中直接访问其中的文件,必须通过web.xml文件对要访问的文件进行相应映射才能访问
 
1:防护方式
①通过Apache、Nginx在配置文件做访问限制
禁止访问WEB-INF目录:location ~ ^/WEB-INF/* { deny all; }
 
九、网站备份、zip、sql、rar、swp
 
该漏洞主要是运维人员的安全意识不到位造成的。运维人员备份重要的文件命名时,以网站名称或者WWW开头命名,如www.zip,test.com.tgz,abc.com.rar,这种情况下很容易被黑客获取到该文件。以及在使用VI、VIM命令编辑文件时异常退出,在目录下生成的.swp隐藏文件,没有注意的情况下,也很容易被黑客获取一些信息。
 
防护措施
①加强自我安全意识,在命名一些备份文件中,尽量不要使用域名等进行命名。
②系统文件权限合理的分配

Guess you like

Origin www.cnblogs.com/douyi/p/11723468.html