# Katana

> A fast Go crawler that maps every URL, endpoint, and JS file on a target site

- Category: Data & Labeling / Web Scraping & Crawling
- Language: Go
- Repository: https://github.com/projectdiscovery/katana
- Website: https://docs.projectdiscovery.io/opensource/katana/overview
- Canonical page: https://ai-tldr.dev/tools/katana/

## In short

Katana is a command-line crawling and spidering framework written in Go, built by ProjectDiscovery. You point it at a URL or a list of URLs, and it walks the site to discover every reachable URL, endpoint, and JavaScript file. It sits in the Web Scraping & Crawling category of the Data & Labeling tools and is open-source, written in Go.

## Overview

Katana is a command-line crawling and spidering framework written in Go, built by ProjectDiscovery. You point it at a URL or a list of URLs, and it walks the site to discover every reachable URL, endpoint, and JavaScript file.

It is aimed at security testers, bug bounty hunters, and engineers who need to map a site's attack surface or build automation pipelines. Katana runs in a standard HTTP mode or a headless (real browser) mode, and can parse JavaScript files to find endpoints that a plain crawler would miss.

Within the web scraping and crawling category, Katana focuses on speed and scriptability. It reads input from STDIN, a single URL, or a file list, and writes output to STDOUT, a file, or JSON, so it fits cleanly into shell pipelines alongside other tools.

## What it does

- Standard and headless (real browser) crawling modes
- JavaScript parsing and crawling to surface hidden endpoints
- Scope control via preconfigured fields or custom regex
- Customizable automatic form filling (experimental)
- Flexible input (STDIN, URL, list) and output (STDOUT, file, JSON)
- Configurable crawl depth, duration, and per-domain page limits

## Getting started

Katana requires Go 1.26+ to install from source, or you can pull a prebuilt Docker image. Once installed, you can crawl a target with a single command.

1. Install with Go

   Install the latest Katana binary using the Go toolchain. CGO must be enabled.

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

2. Or pull the Docker image

   If you prefer not to build from source, pull the official image.

```bash
docker pull projectdiscovery/katana:latest
```

3. Crawl a target

   Pass a URL with -u to start a standard crawl. Add -headless for browser-based crawling.

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

4. Check the available flags

   Run the help command to see all supported switches, including depth, JS crawling, and scope control.

```bash
katana -h
```

## When to use it

- Mapping a web application's URLs and endpoints during a security assessment or bug bounty
- Extracting endpoints from JavaScript files that a basic crawler would miss
- Feeding discovered URLs into automation pipelines via STDIN/STDOUT and JSON output
- Crawling single-page apps and JS-heavy sites in headless mode with a real browser
