github.com/projectdiscovery/nuclei/v2@v2.9.15/pkg/protocols/common/interactsh/options.go (about)

     1  package interactsh
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/projectdiscovery/interactsh/pkg/client"
     7  	"github.com/projectdiscovery/nuclei/v2/pkg/output"
     8  	"github.com/projectdiscovery/nuclei/v2/pkg/progress"
     9  	"github.com/projectdiscovery/nuclei/v2/pkg/reporting"
    10  	"github.com/projectdiscovery/retryablehttp-go"
    11  )
    12  
    13  // Options contains configuration options for interactsh nuclei integration.
    14  type Options struct {
    15  	// ServerURL is the URL of the interactsh server.
    16  	ServerURL string
    17  	// Authorization is the Authorization header value
    18  	Authorization string
    19  	// CacheSize is the numbers of requests to keep track of at a time.
    20  	// Older items are discarded in LRU manner in favor of new requests.
    21  	CacheSize int
    22  	// Eviction is the period of time after which to automatically discard
    23  	// interaction requests.
    24  	Eviction time.Duration
    25  	// CooldownPeriod is additional time to wait for interactions after closing
    26  	// of the poller.
    27  	CooldownPeriod time.Duration
    28  	// PollDuration is the time to wait before each poll to the server for interactions.
    29  	PollDuration time.Duration
    30  	// Output is the output writer for nuclei
    31  	Output output.Writer
    32  	// IssuesClient is a client for issue exporting
    33  	IssuesClient reporting.Client
    34  	// Progress is the nuclei progress bar implementation.
    35  	Progress progress.Progress
    36  	// Debug specifies whether debugging output should be shown for interactsh-client
    37  	Debug bool
    38  	// DebugRequest outputs interaction request
    39  	DebugRequest bool
    40  	// DebugResponse outputs interaction response
    41  	DebugResponse bool
    42  	// DisableHttpFallback controls http retry in case of https failure for server url
    43  	DisableHttpFallback bool
    44  	// NoInteractsh disables the engine
    45  	NoInteractsh bool
    46  	// NoColor disables printing colors for matches
    47  	NoColor bool
    48  
    49  	StopAtFirstMatch bool
    50  	HTTPClient       *retryablehttp.Client
    51  }
    52  
    53  // DefaultOptions returns the default options for interactsh client
    54  func DefaultOptions(output output.Writer, reporting reporting.Client, progress progress.Progress) *Options {
    55  	return &Options{
    56  		ServerURL:           client.DefaultOptions.ServerURL,
    57  		CacheSize:           5000,
    58  		Eviction:            60 * time.Second,
    59  		CooldownPeriod:      5 * time.Second,
    60  		PollDuration:        5 * time.Second,
    61  		Output:              output,
    62  		IssuesClient:        reporting,
    63  		Progress:            progress,
    64  		DisableHttpFallback: true,
    65  		NoColor:             false,
    66  	}
    67  }