206 lines
7.0 KiB
HTML
206 lines
7.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; font-src 'self' data:; img-src 'self' data:; connect-src 'self'; base-uri 'self'; form-action 'self' https://defcon.social https://bsky.app;">
|
|
<meta http-equiv="X-Content-Type-Options" content="nosniff">
|
|
<link rel="stylesheet" href="../assets/css/style.css">
|
|
<link rel="icon" type="image/x-icon" href="../favicon.ico">
|
|
<script>
|
|
// Apply theme immediately to prevent flash
|
|
(function() {
|
|
const theme = localStorage.getItem('theme') ||
|
|
(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
document.documentElement.setAttribute('data-theme', theme);
|
|
})();
|
|
</script>
|
|
<title>katana Cheatsheet - Cheatsheets - Launch Pad</title>
|
|
</head>
|
|
<body>
|
|
<button class="theme-toggle" id="themeToggle" aria-label="Toggle dark mode">
|
|
<svg class="theme-icon theme-icon-moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
|
|
<svg class="theme-icon theme-icon-sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: none;"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>
|
|
</button>
|
|
<br/><br/>
|
|
<div class="name">
|
|
__ _______________________ _________._________________________
|
|
\_ _____/ \______ \ / _ \ / _____/ / _____/ | | \_ _____/
|
|
| __) | _/ / /_\ \ / \ ___ / \ ___ | | | __)_
|
|
| \ | | \ / | \ \ \_\ \ \ \_\ \ | |___ | \
|
|
\___ / |____|_ / \____|__ / \______ / \______ / |_______ \ /_______ /
|
|
\/ \/ \/ \/ \/ \/ \/
|
|
</div>
|
|
<div class="blog-page-header">
|
|
<div class="blog-header-content">
|
|
<a href="/cheatsheets" class="back-link" title="Back to Cheatsheets">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 24 24" class="home-icon"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>
|
|
</a>
|
|
<h1 class="blog-page-title">katana Cheatsheet</h1>
|
|
</div>
|
|
</div>
|
|
<div class="blog-post-container">
|
|
<div class="blog-posts-container" style="max-width: 900px; margin: 0 auto;">
|
|
<div class="blog-post">
|
|
<div class="blog-post-content">
|
|
<p><a href="index.html">← Back to cheatsheets</a></p>
|
|
<p><a href="../index.html">← Home</a></p>
|
|
<hr>
|
|
<p>Katana is a fast web crawler designed for web application security testing. Discovers endpoints, parameters, and hidden paths through intelligent crawling and JavaScript execution.</p>
|
|
<hr>
|
|
<h2>Basic Usage</h2>
|
|
<ul>
|
|
<li>katana -u https://example.com - Crawl URL</li>
|
|
</ul>
|
|
<ul>
|
|
<li>katana -list urls.txt - Crawl from list</li>
|
|
</ul>
|
|
<ul>
|
|
<li>katana -u https://example.com -o output.txt - Save output</li>
|
|
</ul>
|
|
<ul>
|
|
<li>katana -u https://example.com -json - JSON output</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Options</h2>
|
|
<ul>
|
|
<li>-u url - Target URL</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-list file - URLs from file</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-o file - Output file</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-json - JSON output format</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-depth N - Max crawl depth (default: 3)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-scope domain - Scope to domain</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-crawl - Enable crawling</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-js-crawl - JavaScript crawling</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-headless - Use headless browser</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-timeout N - Request timeout (seconds)</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Filtering</h2>
|
|
<ul>
|
|
<li>-match-regex pattern - Match regex</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-filter-regex pattern - Filter regex</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-match-status 200,301 - Match status codes</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-filter-status 404 - Filter status codes</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-match-size N - Match response size</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-filter-size N - Filter response size</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Advanced Options</h2>
|
|
<ul>
|
|
<li>-delay N - Delay between requests (ms)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-concurrency N - Concurrent requests</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-rate-limit N - Rate limit (req/sec)</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-proxy http://proxy:8080 - Use proxy</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-header "Name: Value" - Custom header</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-cookie "name=value" - Cookie</li>
|
|
</ul>
|
|
<ul>
|
|
<li>-user-agent "UA" - User agent</li>
|
|
</ul>
|
|
<hr>
|
|
<h2>Common Examples</h2>
|
|
<h3>Basic Crawl</h3>
|
|
<pre><code>katana -u https://example.com</code></pre>
|
|
<p>Crawl target website.</p>
|
|
<h3>Save Output</h3>
|
|
<pre><code>katana -u https://example.com -o urls.txt</code></pre>
|
|
<p>Save discovered URLs.</p>
|
|
<h3>JSON Output</h3>
|
|
<pre><code>katana -u https://example.com -json -o results.json</code></pre>
|
|
<p>Output in JSON format.</p>
|
|
<h3>JavaScript Crawling</h3>
|
|
<pre><code>katana -u https://example.com -js-crawl -headless</code></pre>
|
|
<p>Enable JS execution.</p>
|
|
<h3>Depth Limit</h3>
|
|
<pre><code>katana -u https://example.com -depth 5</code></pre>
|
|
<p>Set crawl depth.</p>
|
|
<h3>Scope to Domain</h3>
|
|
<pre><code>katana -u https://example.com -scope example.com</code></pre>
|
|
<p>Limit to domain.</p>
|
|
<h3>Filter Status</h3>
|
|
<pre><code>katana -u https://example.com -filter-status 404</code></pre>
|
|
<p>Exclude 404 responses.</p>
|
|
<h3>With Proxy</h3>
|
|
<pre><code>katana -u https://example.com -proxy http://127.0.0.1:8080</code></pre>
|
|
<p>Route through proxy.</p>
|
|
<h3>Custom Headers</h3>
|
|
<pre><code>katana -u https://example.com -header "Authorization: Bearer token"</code></pre>
|
|
<p>Add authentication header.</p>
|
|
<h3>From List</h3>
|
|
<pre><code>katana -list urls.txt -o discovered.txt</code></pre>
|
|
<p>Crawl multiple URLs.</p>
|
|
<hr>
|
|
<h2>Tips</h2>
|
|
<ul>
|
|
<li>Use -js-crawl for modern SPAs</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Adjust -depth based on site size</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Use -scope to avoid crawling external sites</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Filter out noise with -filter-status</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Use -json for programmatic processing</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Combine with other tools in pipelines</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Respect rate limits and robots.txt</li>
|
|
</ul>
|
|
<ul>
|
|
<li>Great for endpoint discovery</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script async type="text/javascript" src="../blog/analytics.js"></script>
|
|
<script src="../theme.js"></script>
|
|
</body>
|
|
</html>
|
|
|