Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
K

katana

> 开发工具
Open source

A next-generation crawling and spidering framework.

17.3K stars0 likes0 views
WebsiteGitHub

About

A next-generation crawling and spidering framework.


A next-generation crawling and spidering framework

Features • Installation • Usage • Scope • Config • Filters • Join Discord

Features

  • Fast And fully configurable web crawling
  • Standard and Headless mode
  • JavaScript parsing / crawling
  • Customizable automatic form filling
  • Scope control - Preconfigured field / Regex
  • Knowledge base - ML page-type / form classification (auto-downloaded model)
  • Customizable output - Preconfigured fields
  • INPUT - STDIN, URL and LIST
  • OUTPUT - STDOUT, FILE and JSON

Installation

katana requires Go 1.26+ to install successfully. If you encounter any installation issues, we recommend trying with the latest available version of Go, as the minimum required version may have changed. Run the command below or download a pre-compiled binary from the release page.

bash
CGO_ENABLED=1 go install github.com/projectdiscovery/katana/cmd/katana@latest

More options to install / run katana-

Docker

To install / update docker to latest tag -

bash
docker pull projectdiscovery/katana:latest

To run katana in standard mode using docker -

bash
docker run projectdiscovery/katana:latest -u https://tesla.com

To run katana in headless mode using docker -

bash
docker run projectdiscovery/katana:latest -u https://tesla.com -system-chrome -headless
Ubuntu

It's recommended to install the following prerequisites -

bash
sudo apt update
sudo apt install zip curl wget git snapd
sudo snap refresh
sudo snap install golang --classic

sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://dl.google.com/linux/linux_signing_key.pub \
  | sudo gpg --dearmor -o /etc/apt/keyrings/google-chrome.gpg

echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg] \
  http://dl.google.com/linux/chrome/deb/ stable main" \
  | sudo tee /etc/apt/sources.list.d/google-chrome.list > /dev/null

sudo apt update
sudo apt install google-chrome-stable

install katana -

bash
go install github.com/projectdiscovery/katana/cmd/katana@latest

Usage

bash
katana -h

This will display help for the tool. Here are all the switches it supports.

…

Running Katana

Input for katana

katana requires url or endpoint to crawl and accepts single or multiple inputs.

Input URL can be provided using -u option, and multiple values can be provided using comma-separated input, similarly file input is supported using -list option and additionally piped input (stdin) is also supported.

URL Input

bash
katana -u https://tesla.com

Multiple URL Input (comma-separated)

bash
katana -u https://tesla.com,https://google.com

List Input

bash
$ cat url_list.txt

https://tesla.com
https://google.com
katana -list url_list.txt

STDIN (piped) Input

bash
echo https://tesla.com | katana
bash
cat domains | httpx | katana

Page Content Similarity

Optional Layer-2 filtering after exact MD5 content dedup. Shared HTML normalization strips chrome (nav/header/footer/scripts), then one of three modes decides whether a page is similar enough to skip further parse/enqueue (cluster budget). URL-shape dedup (-fsu) remains independent.

Mode Flag Best for
simhash (default) -pcsm simhash Near-duplicate / template clones (Hamming via -pcsd)
tfidf -pcsm tfidf Topical cosine similarity (-pcst)
bm25 -pcsm bm25 Topical similarity with length normalization (-pcst)
bash
# Near-duplicate detection (default mode)
katana -u https://example.com -pcs

# TF-IDF topical filtering with higher budget
katana -u https://shop.example.com -pcs -pcsm tfidf -pcst 0.85 -pcsn 2

# BM25 mode
katana -u https://example.com -pcs -pcsm bm25

# Alias from older flag name
katana -u https://example.com -sdd -pcsm simhash

Example completion stats:

bash
[INF] Content similarity (simhash): 103 processed, 30 accepted, 73 filtered - 70.9% filter rate
[INF] Crawl completed in 14s. 21 endpoints found.

Example running katana -

…

Crawling Mode

Standard Mode

Standard crawling modality uses the standard go http library under the hood to handle HTTP requests/responses. This modality is much faster as it doesn't have the browser overhead. Still, it analyzes HTTP responses body as is, without any javascript or DOM rendering, potentially missing post-dom-rendered endpoints or asynchronous endpoint calls that might happen in complex web applications depending, for example, on browser-specific events.

Headless Mode

Headless mode hooks internal headless calls to handle HTTP requests/responses directly within the browser context. This offers two advantages:

  • The HTTP fingerprint (TLS and user agent) fully identify the client as a legitimate browser
  • Better coverage since the endpoints are discovered analyzing the standard raw response, as in the previous modality, and also the browser-rendered one with javascript enabled.

Headless crawling is optional and can be enabled using -headless option.

Here are other headless CLI options -

…

-no-sandbox

Runs headless chrome browser with no-sandbox option, useful when running as root user.

bash
katana -u https://tesla.com -headless -no-sandbox

-no-incognito

Runs headless chrome browser without incognito mode, useful when using the local browser.

bash
katana -u https://tesla.com -headless -no-incognito

To preserve cookies and other browser session data across runs, combine -no-incognito with -chrome-data-dir so Katana reuses your chosen Chrome profile directory instead of an isolated temporary one.

bash
katana -u https://tesla.com -headless -no-incognito -chrome-data-dir /tmp/katana-profile

-headless-options

When crawling in headless mode, additional chrome options can be specified using -headless-options, for example -

bash
katana -u https://tesla.com -headless -system-chrome -headless-options --disable-gpu,proxy-server=http://127.0.0.1:8080

-page-load-strategy

Controls how katana waits for pages to load in headless mode. Different strategies are useful for different types of web applications:

Strategy Description
heuristic (default) Smart waiting that adapts to page behavior - waits for load event, network idle, and DOM stability
load Waits only for the browser's load event
domcontentloaded Waits for DOMContentLoaded event plus additional time (configurable via -dwt) for JavaScript rendering
networkidle Waits for network activity to stop
none No waiting - returns immediately after navigation starts
bash
katana -u https://tesla.com -headless -pls domcontentloaded

The domcontentloaded strategy is particularly useful for Single Page Applications (SPAs) that never fully complete loading due to continuous background requests (websockets, polling, etc.).

-dom-wait-time

When using the domcontentloaded page load strategy, this option specifies how many seconds to wait after the DOMContentLoaded event fires. This allows time for JavaScript to render interactive elements. Default is 5 seconds.

bash
katana -u https://tesla.com -headless -pls domcontentloaded -dwt 10

Captcha Solving

Katana supports automatic captcha detection and solving during headless crawling. When a captcha page is encountered, katana identifies the captcha provider, solves it via an external service, and continues crawling.

Supported captcha types: reCAPTCHA v2, reCAPTCHA v3, reCAPTCHA Enterprise, Cloudflare Turnstile, hCaptcha

-captcha-solver-provider

Option to specify the captcha solver provider. Currently supported: capsolver.

-captcha-solver-key

API key for the captcha solver provider.

bash
katana -u https://example.com -headless -csp capsolver -csk YOUR_API_KEY

The provider and key can also be set via environment variables:

bash
export CAPTCHA_SOLVER_PROVIDER=capsolver
export CAPTCHA_SOLVER_KEY=YOUR_API_KEY
katana -u https://example.com -headless

Scope Control

Crawling can be endless if not scoped, as such katana comes with multiple support to define the crawl scope.

-field-scope

Most handy option to define scope with predefined field name, rdn being default option for field scope.

  • rdn - crawling scoped to root domain name and all subdomains (e.g. *example.com) (default)
  • fqdn - crawling scoped to given sub(domain) (e.g. www.example.com or api.example.com)
  • dn - crawling scoped to domain name keyword (e.g. example)
bash
katana -u https://tesla.com -fs dn

-crawl-scope

For advanced scope control, -cs option can be used that comes with regex support.

bash
katana -u https://tesla.com -cs login

For multiple in scope rules, file input with multiline string / regex can be passed.

bash
$ cat in_scope.txt

login/
admin/
app/
wordpress/
bash
katana -u https://tesla.com -cs in_scope.txt

-crawl-out-scope

For defining what not to crawl, -cos option can be used and also support regex input.

bash
katana -u https://tesla.com -cos logout

For multiple out of scope rules, file input with multiline string / regex can be passed.

bash
$ cat out_of_scope.txt

/logout
/log_out
bash
katana -u https://tesla.com -cos out_of_scope.txt

-no-scope

Katana is default to scope *.domain, to disable this -ns option can be used and also to crawl the internet.

bash
katana -u https://tesla.com -ns

-display-out-scope

As default, when scope option is used, it also applies for the links to display as output, as such external URLs are default to exclude and to overwrite this behavior, -do option can be used to display all the external URLs that exist in targets scoped URL / Endpoint.

katana -u https://tesla.com -do

Here is all the CLI options for the scope control -

bash
katana -h scope

Flags:
SCOPE:
   -cs, -crawl-scope string[]       in scope url regex to be followed by crawler
   -cos, -crawl-out-scope string[]  out of scope url regex to be excluded by crawler
   -fs, -field-scope string         pre-defined scope field (dn,rdn,fqdn) (default "rdn")
   -ns, -no-scope                   disables host based default scope
   -do, -display-out-scope          display external endpoint from scoped crawling

Crawler Configuration

Katana comes with multiple options to configure and control the crawl as the way we want.

-depth

Option to define the depth to follow the urls for crawling, the more depth the more number of endpoint being crawled + time for crawl.

katana -u https://tesla.com -d 5

-js-crawl

Option to enable JavaScript file parsing + crawling the endpoints discovered in JavaScript files, disabled as default.

katana -u https://tesla.com -jc

-crawl-duration

Option to predefined crawl duration, disabled as

Issues· 17 open

View all issuesOpen on GitHub
  • #1717

    Headless treats volatile links as new doors every time

    Updated Jul 27, 2026
  • #1716

    Headless cannot verify locations with a clean session rewalk

    Updated Jul 27, 2026
  • #1718

    Headless has no distinct crawl identities

    Updated Jul 27, 2026
  • #1719

    Headless lacks a near-duplicate page explore budget

    Updated Jul 27, 2026
  • #1720

    Headless cartography knobs need named strategies

    Updated Jul 27, 2026
  • #1715

    Headless crawl paths are not exportable

    Updated Jul 17, 2026
  • #1713

    Hybrid/headless crawl path is too slow

    Updated Jul 17, 2026
  • #1629

    add recorded flow support

    Type: EnhancementUpdated Apr 16, 2026
  • #1582

    Add CF /crawl endpoint support

    Type: EnhancementUpdated Mar 11, 2026

> Tags

Goclicrawlergocrawlerhacktoberfest

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具