runner

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chrome

type Chrome struct {

	// Don't write HTML response content
	SkipSSLCheck bool

	// Path to the Chrome binary. An empty value implies that
	// go-rod will auto download a platform appropriate binary
	// to use.
	Path string
	// WSS is a websocket URL. Setting this will prevent github.com/helviojunior/spraysharksprayshark
	// form launching Chrome, but rather use the remote instance.
	WSS string
	// Proxy server to use
	Proxy string

	ProxyUser     string
	ProxyPassword string

	// UserAgent is the user-agent string to set for Chrome
	UserAgent string
	// Headers to add to every request
	Headers []string
	// WindowSize, in pixels. Eg; X=1920,Y=1080
	WindowX int
	WindowY int
}

Chrome is Google Chrome related options

type ChromeNotFoundError

type ChromeNotFoundError struct {
	Err error
}

ChromeNotFoundError signals that chrome is not available

func (ChromeNotFoundError) Error

func (e ChromeNotFoundError) Error() string

type Credential

type Credential struct {
	Username string
	Password string
}

type Driver

type Driver interface {
	Check(username string, password string, runner *Runner, to int, enumOnly bool) (*models.Result, error)
	Close()
}

Driver is the interface browser drivers will implement.

type Logging

type Logging struct {
	// Debug display debug level logging
	Debug bool
	// LogScanErrors log errors related to scanning
	LogScanErrors bool
	// Silence all logging
	Silence bool
}

Logging is log related options

type Options

type Options struct {
	// Logging is logging options
	Logging Logging
	// Chrome is Chrome related options
	Chrome Chrome
	// Writer is output options
	Writer Writer
	// Scan is typically Scan options
	Scan Scan
}

Options are global github.com/helviojunior/spraysharksprayshark options

func NewDefaultOptions

func NewDefaultOptions() *Options

NewDefaultOptions returns Options with some default values

type Runner

type Runner struct {
	Driver Driver

	// Targets to scan.
	Targets chan Credential
	// contains filtered or unexported fields
}

Runner is a runner that probes web targets using a driver

func NewRunner

func NewRunner(logger *slog.Logger, driver Driver, opts Options, writers []writers.Writer) (*Runner, error)

New gets a new Runner ready for probing. It's up to the caller to call Close() on the runner

func (*Runner) AddSkipped added in v0.1.1

func (run *Runner) AddSkipped()

func (*Runner) Close

func (run *Runner) Close()

func (*Runner) Run

func (run *Runner) Run(total int, enumOnly_optional ...bool) Status

Run executes the runner, processing targets as they arrive in the Targets channel

type Scan

type Scan struct {
	// The scan driver to use. Can be one of [gorod, chromedp]
	Driver string
	// Threads (not really) are the number of goroutines to use.
	// More soecifically, its the go-rod page pool well use.
	Threads int
	// Timeout is the maximum time to wait for a page load before timing out.
	Timeout int
	// Number of seconds of delay between navigation and screenshotting
	Delay int
	// UriFilter are URI's that are okay to process. This should normally
	// be http and https
	UriFilter []string
	// write HTML response content
	SaveHTML bool
	// ScreenshotPath is the path where screenshot images will be stored.
	// An empty value means drivers will not write screenshots to disk. In
	// that case, you'd need to specify writer saves.
	ScreenshotPath string
	// ScreenshotFormat to save as
	ScreenshotFormat string
	// ScreenshotFullPage saves full, scrolled web pages
	ScreenshotFullPage bool
	// ScreenshotToWriter passes screenshots as a model property to writers
	ScreenshotToWriter bool
	// ScreenshotSkipSave skips saving screenshots to disk
	ScreenshotSkipSave bool
	// ScreenshotSaveAll store all result screenshots to disk
	ScreenshotSaveAll bool
}

Scan is scanning related options

type Status added in v0.1.1

type Status struct {
	Total      int
	Tested     int
	UserExists int
	NotFound   int
	Valid      int
	Error      int
	Skipped    int
	Label      string
	Running    bool
}

func (*Status) AddResult added in v0.1.1

func (st *Status) AddResult(result *models.Result)

func (*Status) Print added in v0.1.1

func (st *Status) Print(enumOnly_optional ...bool)

type UserOptions

type UserOptions struct {
	Username string
	Password string
}

Scan is scanning related options

type Writer

type Writer struct {
	UserPath  string
	Db        bool
	DbURI     string
	DbDebug   bool // enables verbose database logs
	Csv       bool
	CsvFile   string
	Jsonl     bool
	JsonlFile string
	Stdout    bool
	None      bool
}

Writer options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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