Directory Enumeration
Lets see how to brute-force directories using the dirbuster and dirb tools.
Description
You are a Penetration Tester hired by the company AwdMgmt to perform security tests on their internal Web Application and machines. You are asked to perform the penetration test on the client premises. During this engagement you are not given a well-defined scope. You are sitting in the client corporate building, directly attached to the client network.

Goal
The goal of this lab is to first find the web servers in the network you are directly attached. Then to test the Web Application running on it in order to check if you can access restricted areas (such as the login page)!
Tools
The best tools for this lab are:
Dirbuster
mysql
Web browser
Steps
Find all the machines in the network
Since we do not have any information about the network and related hosts, the first step is to find all alive hosts in the network.
Identify the machines role
Now that we know there is a host on the target network, let us scan it and gather as much information as we can about it. We are interested in web servers.
Explore the web application
Once we have found a web server explore the Web Application from a web browser and analyze it.
Remember that the goal of our tests is to access the restricted web area.
Find hidden files
Now that you have an idea of how the Web Application works, run dirbuster and check if there is any file that may be useful to access the login page!
Test the credentials found
You should have found two interesting files. Use the information stored in these two files to access the DMBS.
Retrieve the correct admin password
Now that you have access to the database, dump the administrator credentials and try to log into the Web Application.
Solutions
We are now connected to the enterprise network AwdMgmt.

10.104.11.50/24 this is our ip address connected via tap0 interface.
lets discover the devices in our network.
now lets discover the ports running on the 96 and 198. For this lets use the nmap.
based on the results we now know that a http service is running on the ip 10.104.11.96. So, lets visit the ip and check if any site is running on it.

now that we have the site ,lets enumerate the directories by using DIRBUSTER.
Dirbuster is a tool which uses wordlist to check the possible directories present in the website. Alternatives for the Dirbuster is dirb, ffuzz etc.
lets proceed with the dirbuster tool
Enter the url.
Select the number of threads.
Select the wordlist file, i have used directory-list-2.3-medium.txt
Specify the extentions to search for
and run the dirbuster.


now we have some of the directories in the site

after looking at the staff directory we find a note in this path
http://10.104.11.96/staff/readme.txt which shows the following

now after closely looking at the other search results we found a old config file.
however after checking the old config file, the username and password were wrong/expired.
then we found the page http://10.104.11.96/signup.php where the real credentials were present so we used that creds and connected the db that was present in 10.104.11.198 to website ip.

now lets login and check the mysql database for the password.
we got the admin credentials, so lets go ahead and try them on the site!

That's it for today see ya , until next time bye!!!
Last updated
Was this helpful?