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