Forced Browsing
Forced browsing is a technique in which we test URLs crafted from a list of common files/folders and we try to find something juicy.
- π§ Configuration files (ex: .config)
- π Old files (ex: index.php.old)
- π΅ Backup files (ex: xxx.bak, backup.xxx, xxx~)
- π Admin/CMS panels (ex: WordPress admin login page)
- π° Private files (ex: documents...)
Refer to wordlists#forced browsing for wordlists. β οΈ Start with small wordlists, then move to bigger one. They don't have the same entries.
Additional Notes
Version Control Files Disclosure
Sometimes, version control files such as .git for GIT may be exposed. They can be used to find the current and the previous versions of the code. For instance, after downloading a .git
:
$ cd .git
$ git diff # it says the code is missing
$ git restore * # restore current version
$ git log -p -- config.php # look at config.php history
$ git show commit_id
A few automated tools: GitHacker (1.4k β, 2023 πͺ¦) GitTools (3.8k β, 2022 πͺ¦, π»), GitHack (3.1k β, 2022 πͺ¦) and git-dumper (1.8k β).
$ DEST="$HOME/tools/gitdumper"
$ git clone -b "master" https://github.com/arthaud/git-dumper $DEST
$ git-dumper URL/.git/ dump
π .git
may be blocked (403) but .git/index
, .git/HEAD
, etc. may not.
β οΈ We are downloading potentially harmful files. This is dangerous as it may lead to RCE. Manually check the git configuration files before running any git
commands!
Composer Vendor Folder Exposure
Composer is a package manager for PHP. From composer.json
, it creates a vendor
folder with the PHP packages.
This folder should not be available for remote users.
CGI Scripts
Common Gateway Interface (CGI) Applications are rarely used as they are dangerous. They were often used to connect multiple applications. CGI scripts can be written in many languages. They have a few advantages and many major disadvantages. To look for them:
$ ffuf -w /usr/share/seclists/Discovery/Web-Content/common.txt -u URL/cgi/FUZZ -e .bat,.cmd
$ ffuf -w /usr/share/seclists/Discovery/Web-Content/common.txt -u URL/cgi-bin/FUZZ -e .cgi,.pl,.c,.sh,.py
π Apache Tomcat returns 404 for /cgi
even when it exists.
β οΈ Bash [<4.3]
has a vulnerability called shellshock, that can also be exploited with metasploit (apache_mod_cgi_bash_env_exec
):
$ curl -H 'User-Agent: () { :; }; <write code here>' 'URL/cgi-bin/some_script'
π» To-do π»
Stuff that I found, but never read/used yet.
- AJax Rendered Page, automation?
- .DS_STORE, contains a list of files, blog