-
-
Save leonjza/82f7b89df1abe7b4a768349313a58920 to your computer and use it in GitHub Desktop.
Katana Library Bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module katana | |
go 1.20 | |
require ( | |
github.com/projectdiscovery/gologger v1.1.10 | |
github.com/projectdiscovery/katana v1.0.2 | |
) | |
require ( | |
github.com/Mzack9999/go-http-digest-auth-client v0.6.1-0.20220414142836-eb8883508809 // indirect | |
github.com/PuerkitoBio/goquery v1.8.1 // indirect | |
github.com/akrylysov/pogreb v0.10.1 // indirect | |
github.com/andybalholm/cascadia v1.3.1 // indirect | |
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect | |
github.com/aymerick/douceur v0.2.0 // indirect | |
github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08 // indirect | |
github.com/dimchansky/utfbom v1.1.1 // indirect | |
github.com/dsnet/compress v0.0.1 // indirect | |
github.com/go-rod/rod v0.113.3 // indirect | |
github.com/golang/snappy v0.0.4 // indirect | |
github.com/gorilla/css v1.0.0 // indirect | |
github.com/json-iterator/go v1.1.12 // indirect | |
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect | |
github.com/lukasbob/srcset v0.0.0-20190730101422-86b742e617f3 // indirect | |
github.com/mholt/archiver v3.1.1+incompatible // indirect | |
github.com/microcosm-cc/bluemonday v1.0.24 // indirect | |
github.com/miekg/dns v1.1.54 // indirect | |
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | |
github.com/modern-go/reflect2 v1.0.2 // indirect | |
github.com/nwaples/rardecode v1.1.0 // indirect | |
github.com/pierrec/lz4 v2.6.0+incompatible // indirect | |
github.com/pkg/errors v0.9.1 // indirect | |
github.com/projectdiscovery/blackrock v0.0.1 // indirect | |
github.com/projectdiscovery/fastdialer v0.0.28 // indirect | |
github.com/projectdiscovery/goflags v0.1.9 // indirect | |
github.com/projectdiscovery/hmap v0.0.13 // indirect | |
github.com/projectdiscovery/networkpolicy v0.0.6 // indirect | |
github.com/projectdiscovery/ratelimit v0.0.8 // indirect | |
github.com/projectdiscovery/retryabledns v1.0.26 // indirect | |
github.com/projectdiscovery/retryablehttp-go v1.0.17 // indirect | |
github.com/projectdiscovery/utils v0.0.37 // indirect | |
github.com/projectdiscovery/wappalyzergo v0.0.100 // indirect | |
github.com/remeh/sizedwaitgroup v1.0.0 // indirect | |
github.com/rs/xid v1.5.0 // indirect | |
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect | |
github.com/syndtr/goleveldb v1.0.0 // indirect | |
github.com/tidwall/btree v1.4.3 // indirect | |
github.com/tidwall/buntdb v1.3.0 // indirect | |
github.com/tidwall/gjson v1.14.3 // indirect | |
github.com/tidwall/grect v0.1.4 // indirect | |
github.com/tidwall/match v1.1.1 // indirect | |
github.com/tidwall/pretty v1.2.0 // indirect | |
github.com/tidwall/rtred v0.1.2 // indirect | |
github.com/tidwall/tinyqueue v0.1.1 // indirect | |
github.com/ulikunitz/xz v0.5.8 // indirect | |
github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 // indirect | |
github.com/weppos/publicsuffix-go v0.15.1-0.20220724114530-e087fba66a37 // indirect | |
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect | |
github.com/yl2chen/cidranger v1.0.2 // indirect | |
github.com/ysmood/fetchup v0.2.3 // indirect | |
github.com/ysmood/goob v0.4.0 // indirect | |
github.com/ysmood/got v0.34.1 // indirect | |
github.com/ysmood/gson v0.7.3 // indirect | |
github.com/ysmood/leakless v0.8.0 // indirect | |
github.com/zmap/rc2 v0.0.0-20131011165748-24b9757f5521 // indirect | |
github.com/zmap/zcrypto v0.0.0-20220803033029-557f3e4940be // indirect | |
go.etcd.io/bbolt v1.3.7 // indirect | |
go.uber.org/multierr v1.11.0 // indirect | |
golang.org/x/crypto v0.7.0 // indirect | |
golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 // indirect | |
golang.org/x/mod v0.9.0 // indirect | |
golang.org/x/net v0.10.0 // indirect | |
golang.org/x/sys v0.8.0 // indirect | |
golang.org/x/text v0.9.0 // indirect | |
golang.org/x/tools v0.7.0 // indirect | |
gopkg.in/djherbis/times.v1 v1.3.0 // indirect | |
gopkg.in/yaml.v2 v2.4.0 // indirect | |
gopkg.in/yaml.v3 v3.0.1 // indirect | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/projectdiscovery/gologger" | |
"github.com/projectdiscovery/katana/pkg/engine/standard" | |
"github.com/projectdiscovery/katana/pkg/output" | |
"github.com/projectdiscovery/katana/pkg/types" | |
) | |
func main() { | |
options := &types.Options{ | |
MaxDepth: 2, // Maximum depth to crawl | |
FieldScope: "rdn", // Crawling Scope Field | |
BodyReadSize: 2 * 1024 * 1024, // Maximum response size to read | |
RateLimit: 150, // Maximum requests to send per second | |
Strategy: "depth-first", // Visit strategy (depth-first, breadth-first) | |
OnResult: func(result output.Result) { // Callback function to execute for result | |
gologger.Info().Msg(result.Request.URL) | |
}, | |
} | |
crawlerOptions, err := types.NewCrawlerOptions(options) | |
if err != nil { | |
gologger.Fatal().Msg(err.Error()) | |
} | |
defer crawlerOptions.Close() | |
crawler, err := standard.New(crawlerOptions) | |
if err != nil { | |
gologger.Fatal().Msg(err.Error()) | |
} | |
defer crawler.Close() | |
var input = "https://tesla.com" | |
err = crawler.Crawl(input) | |
if err != nil { | |
gologger.Warning().Msgf("Could not crawl %s: %s", input, err.Error()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment