runner

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 76 Imported by: 0

Documentation

Overview

Package runner executes the enumeration process.

Index

Constants

View Source
const (
	DefaultResumeFile      = "resume.cfg"
	DefaultOutputDirectory = "output"
)

Variables

This section is empty.

Functions

func DoHealthCheck

func DoHealthCheck(options *Options, flagSet *goflags.FlagSet) string

func MustDisableSandbox

func MustDisableSandbox() bool

MustDisableSandbox determines if the current os and user needs sandbox mode disabled

func ResultToMap

func ResultToMap(resp Result) (map[string]any, error)

func SaveOnlyUrl

func SaveOnlyUrl(url string, file *os.File)

func SearchArray

func SearchArray(wordtosearch string, array []string) bool

Types

type AsnResponse

type AsnResponse struct {
	AsNumber  string   `json:"as_number" csv:"as_number"`
	AsName    string   `json:"as_name" csv:"as_name"`
	AsCountry string   `json:"as_country" csv:"as_country"`
	AsRange   []string `json:"as_range" csv:"as_range"`
}

func (AsnResponse) String

func (o AsnResponse) String() string

type Browser

type Browser struct {
	// contains filtered or unexported fields
}

func NewBrowser

func NewBrowser(proxy string, useLocal bool) (*Browser, error)

func (*Browser) Close

func (b *Browser) Close()

func (*Browser) ScreenshotWithBody

func (b *Browser) ScreenshotWithBody(url string, timeout time.Duration) ([]byte, string, error)

type FilterOperator

type FilterOperator struct {
	// contains filtered or unexported fields
}

func (FilterOperator) Parse

func (f FilterOperator) Parse(flagValue string) (string, time.Duration, error)

Parse the given value into operator and value pair

type OnResultCallback

type OnResultCallback func(Result)

OnResultCallback (hostResult)

type Options

type Options struct {
	CustomHeaders customheader.CustomHeaders
	CustomPorts   customport.CustomPorts

	Output           string
	OutputAll        bool
	StoreResponseDir string
	HTTPProxy        string
	SocksProxy       string
	InputFile        string
	InputTargetHost  goflags.StringSlice
	Methods          string
	RequestURI       string
	RequestURIs      string

	OutputMatchStatusCode     string
	OutputMatchContentLength  string
	OutputFilterStatusCode    string
	OutputFilterErrorPage     bool
	OutputFilterContentLength string
	InputRawRequest           string

	RequestBody        string
	OutputFilterString string
	OutputMatchString  string
	OutputFilterRegex  string
	OutputMatchTech    goflags.StringSlice
	OutputMatchRegex   string
	Retries            int
	Threads            int
	Timeout            int
	Delay              time.Duration

	VHost                  bool
	VHostInput             bool
	Smuggling              bool
	ExtractTitle           bool
	StatusCode             bool
	Location               bool
	ContentLength          bool
	FollowRedirects        bool
	StoreResponse          bool
	JSONOutput             bool
	CSVOutput              bool
	CSVOutputEncoding      string
	Silent                 bool
	Version                bool
	Verbose                bool
	NoColor                bool
	OutputServerHeader     bool
	OutputWebSocket        bool
	ResponseInStdout       bool
	Base64ResponseInStdout bool

	FollowHostRedirects bool
	MaxRedirects        int
	OutputMethod        bool
	TLSProbe            bool
	CSPProbe            bool
	OutputContentType   bool
	OutputIP            bool
	OutputCName         bool
	Unsafe              bool
	Debug               bool
	DebugRequests       bool
	DebugResponse       bool
	Pipeline            bool
	HTTP2Probe          bool
	OutputCDN           bool
	OutputResponseTime  bool
	NoFallback          bool
	NoFallbackScheme    bool
	TechDetect          bool
	TLSGrab             bool

	ShowStatistics            bool
	StatsInterval             int
	RandomAgent               bool
	StoreChain                bool
	Deny                      customlist.CustomList
	Allow                     customlist.CustomList
	MaxResponseBodySizeToSave int
	MaxResponseBodySizeToRead int
	OutputExtractRegexs       goflags.StringSlice
	OutputExtractPresets      goflags.StringSlice
	RateLimit                 int
	RateLimitMinute           int
	Probe                     bool
	Resume                    bool

	ExcludeCDN            bool
	HostMaxErrors         int
	Stream                bool
	SkipDedupe            bool
	ProbeAllIPS           bool
	Resolvers             goflags.StringSlice
	Favicon               bool
	OutputFilterFavicon   goflags.StringSlice
	OutputMatchFavicon    goflags.StringSlice
	LeaveDefaultPorts     bool
	ZTLS                  bool
	OutputLinesCount      bool
	OutputMatchLinesCount string

	OutputFilterLinesCount string
	Memprofile             string

	OutputWordsCount      bool
	OutputMatchWordsCount string

	OutputFilterWordsCount string

	Hashes                   string
	Jarm                     bool
	Asn                      bool
	OutputMatchCdn           goflags.StringSlice
	OutputFilterCdn          goflags.StringSlice
	SniName                  string
	OutputMatchResponseTime  string
	OutputFilterResponseTime string
	HealthCheck              bool
	ListDSLVariable          bool
	OutputFilterCondition    string
	OutputMatchCondition     string
	//The OnResult callback function is invoked for each result. It is important to check for errors in the result before using Result.Err.
	OnResult           OnResultCallback
	DisableUpdateCheck bool
	NoDecode           bool
	Screenshot         bool
	UseInstalledChrome bool
	TlsImpersonate     bool
	DisableStdin       bool
	IDProccess         bool
	// contains filtered or unexported fields
}

Options contains configuration options for httpx.

func ParseOptions

func ParseOptions() *Options

ParseOptions parses the command line options for application

func (*Options) ShouldLoadResume

func (options *Options) ShouldLoadResume() bool

ShouldLoadResume resume file

func (*Options) ShouldSaveResume

func (options *Options) ShouldSaveResume() bool

ShouldSaveResume file

func (*Options) ValidateOptions

func (options *Options) ValidateOptions() error

type Result

type Result struct {
	Timestamp    time.Time              `json:"timestamp,omitempty" csv:"timestamp"`
	ASN          *AsnResponse           `json:"asn,omitempty" csv:"asn"`
	Err          error                  `json:"-" csv:"-"`
	CSPData      *httpx.CSPData         `json:"csp,omitempty" csv:"csp"`
	TLSData      *clients.Response      `json:"tls,omitempty" csv:"tls"`
	Hashes       map[string]interface{} `json:"hash,omitempty" csv:"hash"`
	ExtractRegex []string               `json:"extract_regex,omitempty" csv:"extract_regex"`
	CDNName      string                 `json:"cdn_name,omitempty" csv:"cdn_name"`
	Port         string                 `json:"port,omitempty" csv:"port"`
	Raw          string                 `json:"-" csv:"-"`
	URL          string                 `json:"url,omitempty" csv:"url"`
	Input        string                 `json:"input,omitempty" csv:"input"`
	Location     string                 `json:"location,omitempty" csv:"location"`
	Title        string                 `json:"title,omitempty" csv:"title"`

	Scheme             string                 `json:"scheme,omitempty" csv:"scheme"`
	Error              string                 `json:"error,omitempty" csv:"error"`
	WebServer          string                 `json:"webserver,omitempty" csv:"webserver"`
	ResponseBody       string                 `json:"body,omitempty" csv:"body"`
	ContentType        string                 `json:"content_type,omitempty" csv:"content_type"`
	Method             string                 `json:"method,omitempty" csv:"method"`
	Host               string                 `json:"host,omitempty" csv:"host"`
	Path               string                 `json:"path,omitempty" csv:"path"`
	FavIconMMH3        string                 `json:"favicon,omitempty" csv:"favicon"`
	FaviconPath        string                 `json:"favicon_path,omitempty" csv:"favicon_path"`
	FinalURL           string                 `json:"final_url,omitempty" csv:"final_url"`
	ResponseHeader     map[string]interface{} `json:"header,omitempty" csv:"header"`
	RawHeader          string                 `json:"raw_header,omitempty" csv:"raw_header"`
	Request            string                 `json:"request,omitempty" csv:"request"`
	ResponseTime       string                 `json:"time,omitempty" csv:"time"`
	Jarm               string                 `json:"jarm,omitempty" csv:"jarm"`
	ChainStatusCodes   []int                  `json:"chain_status_codes,omitempty" csv:"chain_status_codes"`
	A                  []string               `json:"a,omitempty" csv:"a"`
	CNAMEs             []string               `json:"cname,omitempty" csv:"cname"`
	Technologies       []string               `json:"tech,omitempty" csv:"tech"`
	Extracts           map[string][]string    `json:"extracts,omitempty" csv:"extracts"`
	Chain              []httpx.ChainItem      `json:"chain,omitempty" csv:"chain"`
	Words              int                    `json:"words" csv:"words"`
	Lines              int                    `json:"lines" csv:"lines"`
	StatusCode         int                    `json:"status_code,omitempty" csv:"status_code"`
	ContentLength      int                    `json:"content_length,omitempty" csv:"content_length"`
	Failed             bool                   `json:"failed" csv:"failed"`
	VHost              bool                   `json:"vhost,omitempty" csv:"vhost"`
	WebSocket          bool                   `json:"websocket,omitempty" csv:"websocket"`
	CDN                bool                   `json:"cdn,omitempty" csv:"cdn"`
	HTTP2              bool                   `json:"http2,omitempty" csv:"http2"`
	ID                 int                    `json:"id" csv:"id"`
	Total              int                    `json:"total" csv:"total"`
	Pipeline           bool                   `json:"pipeline,omitempty" csv:"pipeline"`
	HeadlessBody       string                 `json:"headless_body,omitempty" csv:"headless_body"`
	ScreenshotBytes    []byte                 `json:"screenshot_bytes,omitempty" csv:"screenshot_bytes"`
	StoredResponsePath string                 `json:"stored_response_path,omitempty" csv:"stored_response_path"`
	ScreenshotPath     string                 `json:"screenshot_path,omitempty" csv:"screenshot_path"`
	KnowledgeBase      map[string]interface{} `json:"knowledgebase,omitempty" csv:"knowledgebase"`
	// contains filtered or unexported fields
}

Result of a scan

func (Result) CSVHeader

func (r Result) CSVHeader() string

CSVHeader the CSV headers

func (Result) CSVRow

func (r Result) CSVRow(scanopts *ScanOptions) string

CSVRow the CSV Row

func (Result) JSON

func (r Result) JSON(scanopts *ScanOptions) string

JSON the result

type ResumeCfg

type ResumeCfg struct {
	ResumeFrom string
	Index      int
	// contains filtered or unexported fields
}

type Runner

type Runner struct {
	HostErrorsCache gcache.Cache[string, int]
	// contains filtered or unexported fields
}

Runner is a client for running the enumeration process.

func New

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

New creates a new client for running enumeration process.

func (*Runner) Close

func (r *Runner) Close()

Close closes the httpx scan instance

func (*Runner) GetScanOpts

func (r *Runner) GetScanOpts() ScanOptions

func (*Runner) Process

func (r *Runner) Process(t string, wg *sizedwaitgroup.SizedWaitGroup, protocol string, scanopts *ScanOptions, output chan Result)

func (*Runner) RunEnumeration

func (r *Runner) RunEnumeration()

RunEnumeration on targets for httpx client

func (*Runner) RunEnumerationWithID

func (r *Runner) RunEnumerationWithID()

func (*Runner) SaveResumeConfig

func (r *Runner) SaveResumeConfig() error

SaveResumeConfig to file

type ScanOptions

type ScanOptions struct {
	Methods                   []string
	StoreResponseDirectory    string
	RequestURI                string
	RequestBody               string
	VHost                     bool
	OutputTitle               bool
	OutputStatusCode          bool
	OutputLocation            bool
	OutputContentLength       bool
	StoreResponse             bool
	OutputServerHeader        bool
	OutputWebSocket           bool
	OutputWithNoColor         bool
	OutputMethod              bool
	ResponseInStdout          bool
	Base64ResponseInStdout    bool
	ChainInStdout             bool
	TLSProbe                  bool
	CSPProbe                  bool
	VHostInput                bool
	OutputContentType         bool
	Unsafe                    bool
	Pipeline                  bool
	HTTP2Probe                bool
	OutputIP                  bool
	OutputCName               bool
	OutputCDN                 bool
	OutputResponseTime        bool
	PreferHTTPS               bool
	NoFallback                bool
	NoFallbackScheme          bool
	TechDetect                bool
	StoreChain                bool
	MaxResponseBodySizeToSave int
	MaxResponseBodySizeToRead int
	OutputExtractRegex        string

	ExcludeCDN         bool
	HostMaxErrors      int
	ProbeAllIPS        bool
	Favicon            bool
	LeaveDefaultPorts  bool
	OutputLinesCount   bool
	OutputWordsCount   bool
	Hashes             string
	Screenshot         bool
	UseInstalledChrome bool
	DisableStdini      bool
	// contains filtered or unexported fields
}

func (*ScanOptions) Clone

func (s *ScanOptions) Clone() *ScanOptions

Jump to

Keyboard shortcuts

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