敏感文件搜集
在打比赛或者测试时,会遇到任意文件读取或者目录穿越之类的漏洞,可以读取一些敏感文件来更进一步,下面整理了一些敏感文件的路径,希望各位表哥给出补充
apache
apache和nginx的安装路径都不是固定的,下面给出的是常见的路径
1 | /etc/apache/httpd.conf |
after apache2.4
1 | /etc/apache2/sites-available/000-default.conf 有web文件根目录 |
nginx
1 | /etc/nginx/nginx.conf |
linux
etc
1 | /etc/hosts.deny 定义禁止访问本机的主机 |
proc
1 | /proc/mounts 文件系统列表 |
需要root权限
1 | /root/.ssh/authorized_keys |
Windows
1 | c:\boot.ini |
apache httpd.conf or apache2.conf ?
我自己在ubuntu上并没有找到httpd.conf
这个文件,而是apache2.conf
为什么呢?在StackOverflow上找到了答案:
The Apache Software Foundation publishes many bits of software, one of which is a web server named httpd. The httpd project sources include among other things an httpd.conf sample configuration file, which is installed by default in
/usr/local/etc/httpd
or/etc/httpd
. You will find httpd named as such on most systems.However, long ago and far away, someone in the Debian GNU/Linux distribution decided to change the name of the software within that distribution from httpd to apache2. Thus on a Debian system you will find a configuration file named apache2.conf in a directory named
/etc/apache2
. I don’t know who did this or why, but it’s a perennial source of confusion on par with calling Windows “Microsoft” or ESXi “VMware”. Distributions based on Debian, such as Ubuntu, inherit this strangeness. Even stranger, they then include a file/etc/apache2/httpd.conf
which is Included fromapache2.conf
into which users can place custom configuration.So the answer is, if you’re on a Debian-based system, you bend your brain into doing things the way Debian wants you to do it. Otherwise you generally do things the normal way as the upstream httpd project does it.
The
/etc/apache2/httpd.conf
is empty in Ubuntu, because the Apache configuration resides in/etc/apache2/apache2.conf
!“httpd.conf is for user options.” No it isn’t, it’s there for historic reasons.
Using Apache server, all user options should go into a new
*.conf-file
inside/etc/apache2/conf.d/
. This method should be “update-safe”, ashttpd.conf
orapache2.conf
may get overwritten on the next server update.Inside
/etc/apache2/apache2.conf
, you will find the following line, which includes those files:
1
2
3 ># Include generic snippets of statements
>Include conf.d/
>
As of Apache 2.4+ the user configuration directory is
/etc/apache2/conf-available/
. Usea2enconf FILENAME_WITHOUT_SUFFIX
to enable the new configuration file or manually create a symlink in/etc/apache2/conf-enabled/
. Be aware that as of Apache 2.4 the configuration files must have the suffix.conf
(e.g.conf-available/my-settings.conf
);