Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a2363fd
feat: added new full headless mode to katana (wip)
Ice3man543 Jan 12, 2025
e27c636
feat: use requests body + close browser & page
Ice3man543 Jan 13, 2025
59ff15d
feat: misc additions to scope
Ice3man543 Jan 14, 2025
2147238
feat: pass logger from outside + do not use global
Ice3man543 Jan 15, 2025
2577bc2
added user to optioanl flags
Ice3man543 Jan 15, 2025
eeff646
misc
Ice3man543 Jan 15, 2025
0ffba73
misc changes
Ice3man543 Jan 16, 2025
0e57538
feat: multiple bug fixes + edge cases handlings
Ice3man543 Jan 16, 2025
c1b06d7
feat: more additions + code, diagnostics, cookie-popups and stealth
Ice3man543 Jun 16, 2025
3677f09
feat: added additional simhash + misc additions and fixes
Ice3man543 Jun 26, 2025
1571d1e
feat: fixed panic + parser not working for katana headless
Ice3man543 Jul 15, 2025
3ace6f7
feat: handle singleton lock issue with multiple instances
Ice3man543 Jul 15, 2025
af26d37
feat: fixed singleton error with multiple processes in linux
Ice3man543 Jul 16, 2025
37d55fe
pprof misc fix
Ice3man543 Jul 22, 2025
c888a6a
feat: added timeout + fixing stuck on large lists
Ice3man543 Jul 23, 2025
0bb25ca
misc additions + debug
Ice3man543 Jul 27, 2025
3d19d31
misc
Ice3man543 Jul 27, 2025
8bf4a34
misc
Ice3man543 Jul 27, 2025
348eba0
misc
Ice3man543 Jul 27, 2025
665d973
feat: addressed review comments + better form fill + misc
Ice3man543 Sep 25, 2025
3f9b1d7
feat: more code review comments
Ice3man543 Sep 25, 2025
a228ae5
Merge branch 'dev' of https://github.com/projectdiscovery/katana into…
Ice3man543 Sep 25, 2025
20e61c9
fix out of scope parsing
Ice3man543 Sep 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ katana_*/
dist/

.vscode
.devcontainer
.devcontainer
.DS_Store
15 changes: 11 additions & 4 deletions cmd/katana/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func main() {
}
defer katanaRunner.Close()

// Check if env has profiling enabled

// close handler
resumeFilename := defaultResumeFilename()
go func() {
Expand All @@ -70,9 +72,11 @@ func main() {
pprofServer = pprofutils.NewPprofServer()
pprofServer.Start()
}
if pprofServer != nil {
defer pprofServer.Stop()
}
defer func() {
if pprofServer != nil {
defer pprofServer.Stop()
}
}()

if err := katanaRunner.ExecuteCrawling(); err != nil {
gologger.Fatal().Msgf("could not execute crawling: %s", err)
Expand Down Expand Up @@ -136,7 +140,8 @@ pipelines offering both headless and non-headless crawling.`)
)

flagSet.CreateGroup("headless", "Headless",
flagSet.BoolVarP(&options.Headless, "headless", "hl", false, "enable headless hybrid crawling (experimental)"),
flagSet.BoolVarP(&options.Headless, "headless", "hl", false, "enable headless crawling (experimental)"),
flagSet.BoolVarP(&options.HeadlessHybrid, "hybrid", "hh", false, "enable headless hybrid crawling (experimental)"),
flagSet.BoolVarP(&options.UseInstalledChrome, "system-chrome", "sc", false, "use local installed chrome browser instead of katana installed"),
flagSet.BoolVarP(&options.ShowBrowser, "show-browser", "sb", false, "show the browser on the screen with headless mode"),
flagSet.StringSliceVarP(&options.HeadlessOptionalArguments, "headless-options", "ho", nil, "start headless chrome with additional options", goflags.FileCommaSeparatedStringSliceOptions),
Expand All @@ -146,6 +151,8 @@ pipelines offering both headless and non-headless crawling.`)
flagSet.BoolVarP(&options.HeadlessNoIncognito, "no-incognito", "noi", false, "start headless chrome without incognito mode"),
flagSet.StringVarP(&options.ChromeWSUrl, "chrome-ws-url", "cwu", "", "use chrome browser instance launched elsewhere with the debugger listening at this URL"),
flagSet.BoolVarP(&options.XhrExtraction, "xhr-extraction", "xhr", false, "extract xhr request url,method in jsonl output"),
flagSet.IntVarP(&options.MaxFailureCount, "max-failure-count", "mfc", 10, "maximum number of consecutive action failures before stopping"),
flagSet.BoolVarP(&options.EnableDiagnostics, "enable-diagnostics", "ed", false, "enable diagnostics"),
)

flagSet.CreateGroup("scope", "Scope",
Expand Down
50 changes: 32 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
module github.com/projectdiscovery/katana

go 1.21
go 1.24

toolchain go1.24.2

require (
github.com/BishopFox/jsluice v0.0.0-20240110145140-0ddfab153e06
github.com/PuerkitoBio/goquery v1.8.1
github.com/go-rod/rod v0.114.1
github.com/adrianbrad/queue v1.3.0
github.com/dominikbraun/graph v0.23.0
github.com/go-rod/rod v0.116.2
github.com/imroc/req/v3 v3.54.0
github.com/json-iterator/go v1.1.12
github.com/lmittmann/tint v1.0.6
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/lukasbob/srcset v0.0.0-20190730101422-86b742e617f3
github.com/mfonda/simhash v0.0.0-20151007195837-79f94a1100d6
github.com/mitchellh/mapstructure v1.5.0
github.com/pkg/errors v0.9.1
github.com/projectdiscovery/dsl v0.3.6
Expand All @@ -25,7 +32,7 @@ require (
github.com/rs/xid v1.5.0
github.com/stretchr/testify v1.10.0
go.uber.org/multierr v1.11.0
golang.org/x/net v0.31.0
golang.org/x/net v0.41.0
gopkg.in/yaml.v3 v3.0.1
)

Expand All @@ -36,14 +43,14 @@ require (
github.com/Mzack9999/gcache v0.0.0-20230410081825-519e28eab057 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/alecthomas/chroma/v2 v2.14.0 // indirect
github.com/andybalholm/brotli v1.0.6 // indirect
github.com/andybalholm/brotli v1.2.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/charmbracelet/glamour v0.8.0 // indirect
github.com/charmbracelet/lipgloss v0.13.0 // indirect
github.com/charmbracelet/x/ansi v0.3.2 // indirect
github.com/cheggaaa/pb/v3 v3.1.4 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cloudflare/circl v1.6.1 // indirect
github.com/ditashi/jsbeautifier-go v0.0.0-20141206144643-2520a8026a9c // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/docker/go-units v0.5.0 // indirect
Expand All @@ -53,13 +60,16 @@ require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-github/v30 v30.1.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect
github.com/google/pprof v0.0.0-20250423184734-337e5dd93bb4 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hdm/jarm-go v0.0.7 // indirect
github.com/icholy/digest v1.1.0 // indirect
github.com/kataras/jwt v0.1.8 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
Expand All @@ -70,12 +80,15 @@ require (
github.com/minio/selfupdate v0.6.1-0.20230907112617-f11e74f84ca7 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a // indirect
github.com/onsi/gomega v1.36.3 // indirect
github.com/pierrec/lz4/v4 v4.1.2 // indirect
github.com/projectdiscovery/asnmap v1.1.1 // indirect
github.com/projectdiscovery/blackrock v0.0.1 // indirect
github.com/projectdiscovery/gostruct v0.0.2 // indirect
github.com/projectdiscovery/machineid v0.0.0-20240226150047-2e2c51e35983 // indirect
github.com/refraction-networking/utls v1.6.7 // indirect
github.com/quic-go/qpack v0.5.1 // indirect
github.com/quic-go/quic-go v0.53.0 // indirect
github.com/refraction-networking/utls v1.7.3 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/sashabaranov/go-openai v1.14.2 // indirect
Expand All @@ -92,16 +105,17 @@ require (
github.com/tidwall/rtred v0.1.2 // indirect
github.com/tidwall/tinyqueue v0.1.1 // indirect
github.com/ysmood/fetchup v0.2.3 // indirect
github.com/ysmood/got v0.34.1 // indirect
github.com/ysmood/got v0.40.0 // indirect
github.com/yuin/goldmark v1.7.4 // indirect
github.com/yuin/goldmark-emoji v1.0.3 // indirect
github.com/zcalusic/sysinfo v1.0.2 // indirect
go.uber.org/mock v0.5.2 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/term v0.26.0 // indirect
golang.org/x/sync v0.15.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
)

require (
Expand Down Expand Up @@ -136,17 +150,17 @@ require (
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/ysmood/goob v0.4.0 // indirect
github.com/ysmood/gson v0.7.3 // indirect
github.com/ysmood/leakless v0.8.0 // indirect
github.com/ysmood/leakless v0.9.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
github.com/zmap/rc2 v0.0.0-20190804163417-abaa70531248 // indirect
github.com/zmap/zcrypto v0.0.0-20230422215203-9a665e1e9968 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/mod v0.25.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.26.0 // indirect
golang.org/x/tools v0.34.0 // indirect
gopkg.in/djherbis/times.v1 v1.3.0 // indirect
gopkg.in/yaml.v2 v2.4.0
)
Loading