You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use katana as library and followed the code sample shown in the readme.
i have set the AutomaticFormFill to true in order to intercept the POST requests, but it doesn't work tried with both standard and hybrid mode
but if i run the katana as cli it intercepts the POST
below is the code that i am trying to get to work
package main
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Team,
I tried to use katana as library and followed the code sample shown in the readme.
i have set the AutomaticFormFill to true in order to intercept the POST requests, but it doesn't work tried with both standard and hybrid mode
but if i run the katana as cli it intercepts the POST
below is the code that i am trying to get to work
package main
import (
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/katana/pkg/engine/hybrid"
"github.com/projectdiscovery/katana/pkg/output"
"github.com/projectdiscovery/katana/pkg/types"
)
func main() {
gologger.Warning().Msgf("starting crawling")
options := &types.Options{
Headless: true,
UseInstalledChrome: true,
FieldConfig: "/tmp/katana/field-config.yaml",
FormConfig: "/tmp/katana/form-config.yaml",
AutomaticFormFill: true,
Verbose: true,
Retries: 2,
Timeout: 10,
ScrapeJSResponses: true,
MaxDepth: 10, // Maximum depth to crawl
FieldScope: "rdn", // Crawling Scope Field
BodyReadSize: 10 * 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().Msgf("test: %s", result.Request.Raw)
},
}
crawlerOptions, err := types.NewCrawlerOptions(options)
if err != nil {
gologger.Fatal().Msg(err.Error())
}
defer crawlerOptions.Close()
crawler, err := hybrid.New(crawlerOptions)
if err != nil {
gologger.Fatal().Msg(err.Error())
}
defer crawler.Close()
var input = "http://testasp.vulnweb.com/"
err = crawler.Crawl(input)
if err != nil {
gologger.Warning().Msgf("Could not crawl %s: %s", input, err.Error())
}
}
Beta Was this translation helpful? Give feedback.
All reactions