root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat dirsearch.md
// web

dirsearch

22 Jul 2026 · 2 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.

TypeCLI (Python)
PlatformKali / Linux
dirsearch cheat sheet

Commands

CommandWhat it does
dirsearch -u http://IP-or-site/Simple scan
dirsearch -u http://IP/ -w /usr/share/wordlists/dirb/common.txtUse a specific wordlist
dirsearch -u http://IP/ -e php,txt,htmlTest specific extensions
dirsearch -u http://IP/ -w wordlist.txt -i 200,301,403Filter by HTTP status codes
dirsearch -u http://IP/ -w wordlist.txt -o results.txtSave 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.