Skip to content

Commit

Permalink
bump default interactsh httpclient timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunKoyalwar committed Aug 16, 2023
1 parent 4512d27 commit b0ae735
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions v2/internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,15 @@ func New(options *types.Options) (*Runner, error) {
if httpclient != nil {
opts.HTTPClient = httpclient
}
if opts.HTTPClient == nil {
httpOpts := retryablehttp.DefaultOptionsSingle
httpOpts.Timeout = 20 * time.Second // for stability reasons
if options.Timeout > 20 {
httpOpts.Timeout = time.Duration(options.Timeout) * time.Second
}
// in testing it was found most of times when interactsh failed, it was due to failure in registering /polling requests
opts.HTTPClient = retryablehttp.NewClient(retryablehttp.DefaultOptionsSingle)
}
interactshClient, err := interactsh.New(opts)
if err != nil {
gologger.Error().Msgf("Could not create interactsh client: %s", err)
Expand Down

0 comments on commit b0ae735

Please sign in to comment.