Dec 29, 2020 10:03 AM
(This post was last modified: Jan 7, 2021 02:42 AM by guardian.)
Dirsearch is a powerful tool that automatically checks for the existence of directories/files on a server
It might discover admin logins, configuration files the admin forgot to remove and more!
When attacking a site during a penetration test, I used this tool numerous times and have also had success based on the things I found with it
Dirsearch does not only output files it found, but also files it got a 403 (Forbidden Access) or other interesting response codes from
This makes the tool even more powerful to me
You can find it's Github Repository here
To use it on Linux, first install Git
Then clone into the repository
A folder named dirsearch will appear within the directory you executed this command in
Switch into the directory by using
You will need pip3 to install the requirements listed in requirements.txt
To install pip3 and afterwards install all the requirements using pip3 do
A basic usage of dirsearch could look like this
-u specifies the URL that you want to check for the files
-e specifies the file extensions that will be looked for, in this case: php,js,txt and .conf
In addition to that, there are some other useful flags you can use:
--cidr scans all hosts in the given cidr
-X Excludes specified extensions
-r Search directories recursively
--proxy Proxy your requests; good for circumventing IP blocks and privacy
As it is a tool I find myself using pretty often, I thought I would share that as well, hope you enjoyed this and learned something new
It might discover admin logins, configuration files the admin forgot to remove and more!
When attacking a site during a penetration test, I used this tool numerous times and have also had success based on the things I found with it
Dirsearch does not only output files it found, but also files it got a 403 (Forbidden Access) or other interesting response codes from
This makes the tool even more powerful to me
You can find it's Github Repository here
To use it on Linux, first install Git
Code
apt -y install gitThen clone into the repository
Code
git clone https://github.com/maurosoria/dirsearchA folder named dirsearch will appear within the directory you executed this command in
Switch into the directory by using
Code
cd dirsearchYou will need pip3 to install the requirements listed in requirements.txt
To install pip3 and afterwards install all the requirements using pip3 do
Code
apt install python3-pip
pip3 install -r requirements.txtA basic usage of dirsearch could look like this
Code
python3 dirsearch.py -u https://example.com -e php,js,txt,conf-u specifies the URL that you want to check for the files
-e specifies the file extensions that will be looked for, in this case: php,js,txt and .conf
In addition to that, there are some other useful flags you can use:
--cidr scans all hosts in the given cidr
-X Excludes specified extensions
-r Search directories recursively
--proxy Proxy your requests; good for circumventing IP blocks and privacy
As it is a tool I find myself using pretty often, I thought I would share that as well, hope you enjoyed this and learned something new
All my answers/posts are for educational purposes only. I am not in any way responsible for the actions you perform with the acquired knowledge.
![[Image: ZjBA6fR.gif]](https://i.imgur.com/ZjBA6fR.gif)



