Katana — Full Practical Notes
Katana is ProjectDiscovery's fast web crawler. In an authorized web-security assessment, you can use it to discover URLs, endpoints, JavaScript files, forms, parameters, and other resources that are reachable from a target website.
Think of the workflow as:
Target ↓ Katana ↓ URLs / endpoints / JS / parameters ↓ httpx / nuclei / Burp Suite ↓ Manual security testing
Use it only on websites you own or are authorized to assess.
1. Install Katana
Kali Linux
First check whether it is already installed:
katana -version
If available through your installed ProjectDiscovery packages, update/install it according to your package setup.
A common Go installation method is:
go install github.com/projectdiscovery/katana/cmd/katana@latest
Then make sure Go's binary directory is in your PATH.
Check:
which katana
Then:
katana -h
2. Basic Crawling
The simplest command:
katana -u https://example.com
-u specifies the target URL.
Example against your own site:
katana -u https://yourdomain.com
Katana will crawl reachable resources and print discovered URLs.
3. Save Results
katana -u https://example.com -o urls.txt
View:
cat urls.txt
Count results:
wc -l urls.txt
Remove duplicates:
sort -u urls.txt
4. Basic Crawling Depth
Katana uses crawling depth to determine how far it follows links.
Example:
katana -u https://example.com -d 2
Depth 1:
katana -u https://example.com -d 1
Depth 3:
katana -u https://example.com -d 3
A higher depth can produce substantially more URLs.
For initial reconnaissance, start small:
katana -u https://example.com -d 2
5. JavaScript Crawling
JavaScript-heavy applications often contain routes and API references that ordinary HTML crawling may not reveal.
Katana supports JavaScript crawling.
katana -u https://example.com -jc
This can help discover resources referenced through JavaScript.
For modern React/Next.js applications, this is particularly useful during authorized testing.
6. Find JavaScript Files
You can save all discovered URLs:
katana -u https://example.com -o all.txt
Then filter JavaScript:
grep -Ei '\.js($|\?)' all.txt
Save them:
grep -Ei '\.js($|\?)' all.txt > javascript.txt
Count:
wc -l javascript.txt
7. Query Parameters
Suppose Katana discovers:
https://example.com/search?q=test https://example.com/product?id=10
You can identify URLs containing parameters:
grep '?' urls.txt
Save them:
grep '?' urls.txt > parameters.txt
This is useful during web-application reconnaissance because parameters can represent user-controlled input.
8. Forms
Katana can extract information from forms during crawling.
For example:
katana -u https://example.com -d 2
Depending on the target and output configuration, discovered form-related resources can help identify application functionality.
Forms may correspond to:
/login /register /search /contact /upload /admin
These are important areas for subsequent manual authorized testing.
9. Headless Crawling
Modern websites sometimes require JavaScript execution.
Katana supports headless crawling.
Check the available options:
katana -h
Then use the headless option supported by your installed version.
A common usage is:
katana -u https://example.com -headless
This can be useful for applications where links are dynamically generated by JavaScript.
10. Crawl Specific Extensions
You may want to identify specific resource types from the crawl.
For example:
katana -u https://example.com -o results.txt
Find PHP:
grep -Ei '\.php($|\?)' results.txt
Find JSON:
grep -Ei '\.json($|\?)' results.txt
Find XML:
grep -Ei '\.xml($|\?)' results.txt
Find JavaScript:
grep -Ei '\.js($|\?)' results.txt
11. Filtering URLs
Suppose:
katana -u https://example.com -o urls.txt
Only URLs containing /api/:
grep '/api/' urls.txt
Only admin-related paths:
grep -Ei '/admin|/dashboard|/manage' urls.txt
Only login-related paths:
grep -Ei '/login|/signin|/auth' urls.txt
This is reconnaissance, not proof that these paths are vulnerable.
12. Scope Control
When testing a website, you often want to stay within the target domain.
Katana supports scope-related options.
Check:
katana -h
Look for options related to:
scope crawl exclude
For example, depending on your version, you can configure crawling to remain within the intended host/domain.
This is extremely important during authorized testing.
13. Exclude Unwanted URLs
Large websites can contain things you don't want to crawl, such as:
logout logout links large files external domains tracking URLs
Katana provides filtering/exclusion options.
Check:
katana -h
Then configure exclusions appropriate to your authorized scope.
14. Rate Limiting
Don't hammer a web server.
Katana provides concurrency/rate-related options.
Check:
katana -h
For a production site you own, use conservative settings.
For example, you might reduce concurrency rather than launching an aggressive crawl.
The goal of reconnaissance is useful coverage, not maximum traffic.
15. Headers
You can provide custom HTTP headers when authorized.
For example, a custom user agent:
katana -u https://example.com -H 'User-Agent: SecurityTesting'
Custom headers are useful when your application requires authentication or a specific testing header.
Be careful with credentials and never expose authentication tokens in command history or shared logs.
16. Cookies / Authenticated Crawling
Some applications expose different content after login.
For authorized testing, you may need to provide session information.
Check the exact syntax supported by your version:
katana -h
Look for:
-H -header -cookie
For example, a testing session may use:
katana -u https://example.com -H 'Cookie: session=YOUR_TEST_SESSION'
Use only a test account/session that you are authorized to use.
17. POST Requests
Web applications aren't only GET-based.
Katana has options for crawling/request handling that can help identify POST-based functionality. Check your installed version:
katana -h
Pay particular attention to:
form field request method
This becomes useful when testing:
/login /register /search /contact /upload
18. Output Formats
Basic output:
katana -u https://example.com -o urls.txt
For structured output, check:
katana -h
Look for output-related options such as:
-jsonl
A JSONL workflow may look like:
katana -u https://example.com -jsonl -o results.jsonl
Then inspect:
head results.jsonl
Structured output is useful for automation.
19. Silent Mode
If you only want the discovered URLs and less console information:
katana -u https://example.com -silent
Save:
katana -u https://example.com -silent -o urls.txt
This is especially convenient for pipelines.
20. Stdin Input
Katana can be incorporated into pipelines.
For example, if you have targets in:
targets.txt
you can feed them to Katana using the supported stdin option.
Check:
katana -h
A typical workflow is:
cat targets.txt | katana
For larger workflows, combine it with ProjectDiscovery tools.
21. Katana + httpx
This is one of the most useful combinations.
Start with URLs:
katana -u https://example.com -silent -o urls.txt
Then check which discovered URLs respond:
cat urls.txt | httpx
Save:
cat urls.txt | httpx -o live.txt
Conceptually:
Katana ↓ Discover URLs ↓ httpx ↓ Identify responding HTTP services
22. Katana + Nuclei
After discovering URLs:
katana -u https://example.com -silent -o urls.txt
Then, for systems you are authorized to assess:
nuclei -l urls.txt
This creates:
Katana → Discovery Nuclei → Template-based security checks
Keep Nuclei's scan scope and templates appropriate to your authorization.
23. Katana + Burp Suite
A very useful workflow is:
Browser ↓ Burp Suite ↓ Understand application ↓ Katana ↓ Discover additional endpoints ↓ Burp Repeater ↓ Manual testing
Katana finds URLs; Burp lets you manually inspect and modify HTTP requests.
24. Practical Web Recon Workflow
For a website you own:
Step 1 — Crawl
katana -u https://example.com -d 2 -silent -o katana.txt
Step 2 — Remove duplicates
sort -u katana.txt -o katana.txt
Step 3 — Count
wc -l katana.txt
Step 4 — Find JavaScript
grep -Ei '\.js($|\?)' katana.txt > js.txt
Step 5 — Find parameters
grep '?' katana.txt > parameters.txt
Step 6 — Find APIs
grep -Ei '/api/|/graphql' katana.txt > api.txt
Step 7 — Find authentication areas
grep -Ei '/login|/signin|/register|/auth' katana.txt
Step 8 — Check discovered URLs
cat katana.txt | httpx
25. Practical Lab
You can practice against a local application instead of a public website.
Start a local web server:
mkdir katana-lab cd katana-lab echo "Hello Katana" > index.html python3 -m http.server 8000
Then another terminal:
katana -u http://127.0.0.1:8000
Save:
katana -u http://127.0.0.1:8000 -o lab.txt
Check:
cat lab.txt
26. Better Local Lab
Create some directories:
mkdir -p katana-lab/admin katana-lab/api
Create pages:
echo "Home" > katana-lab/index.html echo "Admin page" > katana-lab/admin/index.html echo '{"status":"ok"}' > katana-lab/api/status.json
Start:
cd katana-lab python3 -m http.server 8000
Then:
katana -u http://127.0.0.1:8000 -d 3
You'll see Katana discovering resources from the application.
27. Important Katana Options
The exact option set changes between releases, so check your installed version with:
katana -h
Commonly useful options include:
| Option | Purpose |
|---|---|
-u | Target URL |
-d | Crawl depth |
-o | Output file |
-silent | Reduce console output |
-jc | JavaScript crawling |
-headless | Browser/headless crawling |
-H | Custom HTTP header |
-jsonl | JSONL output |
-list / stdin | Multiple targets, depending on version |
| scope options | Control crawl scope |
| exclude options | Exclude unwanted resources |
Always use:
katana -h
as the authoritative reference for your installed version.
28. Katana vs Gobuster vs ffuf
These tools have different jobs.
| Tool | Main purpose |
|---|---|
| Katana | Crawl and discover URLs |
| Gobuster | Directory/DNS enumeration |
| ffuf | Fuzzing paths, parameters, values |
| Nmap | Network/port/service discovery |
| httpx | HTTP probing |
| Nuclei | Template-based vulnerability checks |
| Burp Suite | Manual web security testing |
A useful workflow is:
Nmap ↓ Find web server ↓ httpx ↓ Confirm HTTP service ↓ Katana ↓ Discover endpoints ↓ Gobuster / ffuf ↓ Discover additional paths ↓ Burp Suite ↓ Manual testing ↓ Nuclei ↓ Automated checks
29. Most Useful Commands to Remember
# Help katana -h # Basic crawl katana -u https://example.com # Crawl depth 2 katana -u https://example.com -d 2 # Save katana -u https://example.com -o urls.txt # Quiet output katana -u https://example.com -silent # JavaScript crawling katana -u https://example.com -jc # Headless crawling katana -u https://example.com -headless # JSONL katana -u https://example.com -jsonl -o results.jsonl # Find JavaScript grep -Ei '\.js($|\?)' urls.txt # Find parameters grep '?' urls.txt # Find API endpoints grep -Ei '/api/|/graphql' urls.txt # Send discovered URLs to httpx cat urls.txt | httpx
Remember the purpose
Katana is primarily a discovery tool.
Website ↓ Katana ↓ URLs ├── /login ├── /api/users ├── /admin ├── /search?q= ├── /assets/app.js └── /graphql ↓ Investigate each ↓ Authorized security testing
The important skill isn't just knowing katana -u; it's learning to take the URLs, parameters, APIs, JavaScript resources, and application functionality Katana discovers and feed that information into the next stage of your web-security assessment.