brute force directories and files in webservers using dirsearch

Raj Upadhyay
3 min readNov 19, 2020

Today Let’s learn about the “dirsearch” tool.

It’s one of the best tools I came across to brute force directories and files.

So let’s see what developers of the dirsearch say about their tool.

dirsearch gives the user the opportunity to perform a complex web content discovery, with many vectors for the wordlist, high accuracy, impressive performance, advanced connection/request settings, modern brute-force techniques, and nice output.

Let’s not talk much about dirsearch let’s see how to use it.

Installation

git clone https://github.com/maurosoria/dirsearch.git

Once cloning is complete.

cd dirsearch
  • Now let’s see the help window of the dirsearch tool.
python3 dirsearch.py -h

So we can do many things like,

URL: -u

The first and most important thing is to specify our target and we can do this by using -u.

python3 dirsearch.py -u "domain_name/target_url"

Extension: -e

So when we know that our target has used “PHP” to build a website then it’s advisable to search for “.php” extensions rather than going to search for “.aspx” or any other extensions.

Syntax:

python3 dirsearch.py -u "target" -e php

Consider a case when we want to go for all possible extension at that time we can do something like this.

  • “*” is used to specify “all” extensions

Threads: -t

We can specify the number of threads we want to use or we can say the number of requests we want to send.

Syntax

python3 dirsearch.py -u "target" -t number_of_threads

STATUS: -x

Many times we want to exclude some of the response from our search. Like, consider the case where we don’t want to see any “403” header response from search at that time -x will be very helpful.

Syntax:

python3 dirsearch.py -u "target" -x 403,401,404

wordlist: -w

Sometimes we want to specify our custom wordlist. we don’t want to use default wordlist at that time we can use “-w” to specify our custom wordlist.

So this is how we can use “dirsearch” to do directory brute force.

Thank you for reading.

--

--

Raj Upadhyay

Pursuing M. Tech. in Cyber Security and Incident Response. #LoveToPlayCTF #infosec #cybersecurity