root@sparrow:~/writeups$ cat dirsearch.md
// web
dirsearch
22 Jul 2026
ยท 1 min read
dirsearch is a Python script very popular in CTFs and pentesting for discovering hidden directories and files. Highly configurable, great for complex sites (PHP, JSP, ASP...): custom headers, user-agents, cookies, and automatic extension testing.
| Type | CLI (Python) |
| Platform | Kali / Linux |

Commands
| Command | What it does |
|---|---|
dirsearch -u http://IP-or-site/ | Simple scan |
dirsearch -u http://IP/ -w /usr/share/wordlists/dirb/common.txt | Use a specific wordlist |
dirsearch -u http://IP/ -e php,txt,html | Test specific extensions |
dirsearch -u http://IP/ -w wordlist.txt -i 200,301,403 | Filter by HTTP status codes |
dirsearch -u http://IP/ -w wordlist.txt -o results.txt | Save results |
Responsible use
These commands are for systems you own or have explicit written authorisation to test (labs, CTFs, contracted engagements). Using them against third-party infrastructure without permission is illegal in most countries.