interactsh

package
v3.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2024 License: MIT Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInteractshClientNotInitialized = errors.New("interactsh client not initialized")
)

Functions

func HasMarkers

func HasMarkers(data string) bool

HasMarkers checks if the text contains interactsh markers

func HasMatchers

func HasMatchers(op *operators.Operators) bool

HasMatchers returns true if an operator has interactsh part matchers or extractors.

Used by requests to show result or not depending on presence of interact.sh data part matchers.

Types

type Client

type Client struct {
	sync.Once
	sync.RWMutex
	// contains filtered or unexported fields
}

Client is a wrapped client for interactsh server.

func New

func New(options *Options) (*Client, error)

New returns a new interactsh server client

func (*Client) AlreadyMatched

func (c *Client) AlreadyMatched(data *RequestData) bool

func (*Client) Close

func (c *Client) Close() bool

Close the interactsh clients after waiting for cooldown period.

func (*Client) MakePlaceholders

func (c *Client) MakePlaceholders(urls []string, data map[string]interface{})

MakePlaceholders does placeholders for interact URLs and other data to a map

func (*Client) NewURL

func (c *Client) NewURL() (string, error)

func (*Client) NewURLWithData

func (c *Client) NewURLWithData(data string) (string, error)

func (*Client) Replace

func (c *Client) Replace(data string, interactshURLs []string) (string, []string)

ReplaceMarkers replaces the default {{interactsh-url}} placeholders with interactsh urls

func (*Client) ReplaceWithMarker

func (c *Client) ReplaceWithMarker(data string, regex *regexp.Regexp, interactshURLs []string) (string, []string)

ReplaceMarkers replaces the placeholders with interactsh urls and appends them to interactshURLs

func (*Client) RequestEvent

func (c *Client) RequestEvent(interactshURLs []string, data *RequestData)

RequestEvent is the event for a network request sent by nuclei.

func (*Client) URL

func (c *Client) URL() (string, error)

URL returns a new URL that can be interacted with

type MakeResultEventFunc

type MakeResultEventFunc func(wrapped *output.InternalWrappedEvent) []*output.ResultEvent

MakeResultEventFunc is a result making function for nuclei

type Options

type Options struct {
	// ServerURL is the URL of the interactsh server.
	ServerURL string
	// Authorization is the Authorization header value
	Authorization string
	// CacheSize is the numbers of requests to keep track of at a time.
	// Older items are discarded in LRU manner in favor of new requests.
	CacheSize int
	// Eviction is the period of time after which to automatically discard
	// interaction requests.
	Eviction time.Duration
	// CooldownPeriod is additional time to wait for interactions after closing
	// of the poller.
	CooldownPeriod time.Duration
	// PollDuration is the time to wait before each poll to the server for interactions.
	PollDuration time.Duration
	// Output is the output writer for nuclei
	Output output.Writer
	// IssuesClient is a client for issue exporting
	IssuesClient reporting.Client
	// Progress is the nuclei progress bar implementation.
	Progress progress.Progress
	// Debug specifies whether debugging output should be shown for interactsh-client
	Debug bool
	// DebugRequest outputs interaction request
	DebugRequest bool
	// DebugResponse outputs interaction response
	DebugResponse bool
	// DisableHttpFallback controls http retry in case of https failure for server url
	DisableHttpFallback bool
	// NoInteractsh disables the engine
	NoInteractsh bool
	// NoColor disables printing colors for matches
	NoColor bool

	StopAtFirstMatch bool
	HTTPClient       *retryablehttp.Client
}

Options contains configuration options for interactsh nuclei integration.

func DefaultOptions

func DefaultOptions(output output.Writer, reporting reporting.Client, progress progress.Progress) *Options

DefaultOptions returns the default options for interactsh client

type RequestData

type RequestData struct {
	MakeResultFunc MakeResultEventFunc
	Event          *output.InternalWrappedEvent
	Operators      *operators.Operators
	MatchFunc      operators.MatchFunc
	ExtractFunc    operators.ExtractFunc
}

RequestData contains data for a request event

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL