scan

package
v0.0.0-...-74469e8 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveScanWebSocketConnection

func ActiveScanWebSocketConnection(item *db.WebSocketConnection, interactionsManager *integrations.InteractionsManager, payloadGenerators []*generation.PayloadGenerator, options HistoryItemScanOptions)

func CreateRequestFromInsertionPoints

func CreateRequestFromInsertionPoints(history *db.History, builders []InsertionPointBuilder) (*http.Request, error)

func GetValidInsertionPoints

func GetValidInsertionPoints() []string

func GetValidScanModes

func GetValidScanModes() []string

func IsValidScanMode

func IsValidScanMode(mode string) bool

func SaveInteractionCallback

func SaveInteractionCallback(interaction *server.Interaction)

Types

type DetectedIssue

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

type FullScanOptions

type FullScanOptions struct {
	Title              string              `json:"title" validate:"omitempty,min=1,max=255"`
	StartURLs          []string            `json:"start_urls" validate:"required,dive,url"`
	MaxDepth           int                 `json:"max_depth" validate:"min=0"`
	MaxPagesToCrawl    int                 `json:"max_pages_to_crawl" validate:"min=0"`
	ExcludePatterns    []string            `json:"exclude_patterns"`
	WorkspaceID        uint                `json:"workspace_id" validate:"required,min=0"`
	PagesPoolSize      int                 `json:"pages_pool_size" validate:"min=1,max=100"`
	Headers            map[string][]string `json:"headers" validate:"omitempty"`
	InsertionPoints    []string            `json:"insertion_points" validate:"omitempty,dive,oneof=parameters urlpath body headers cookies json xml"`
	Mode               ScanMode            `json:"mode" validate:"omitempty,oneof=fast smart fuzz"`
	ExperimentalAudits bool                `json:"experimental_audits"`
}

type FuzzItemOptions

type FuzzItemOptions struct {
	WorkspaceID     uint     `json:"workspace_id" validate:"required,min=0"`
	TaskID          uint     `json:"task_id" validate:"required,min=0"`
	Mode            ScanMode `json:"mode" validate:"omitempty,oneof=fast smart fuzz"`
	FingerprintTags []string `json:"fingerprint_tags" validate:"omitempty,dive"`
}

type HistoryItemScanOptions

type HistoryItemScanOptions struct {
	WorkspaceID        uint     `json:"workspace_id" validate:"required,min=0"`
	TaskID             uint     `json:"task_id" validate:"required,min=0"`
	TaskJobID          uint     `json:"task_job_id" validate:"required,min=0"`
	Mode               ScanMode `json:"mode" validate:"omitempty,oneof=fast smart fuzz"`
	InsertionPoints    []string `json:"insertion_points" validate:"omitempty,dive,oneof=parameters urlpath body headers cookies json xml"`
	FingerprintTags    []string `json:"fingerprint_tags" validate:"omitempty,dive"`
	ExperimentalAudits bool     `json:"experimental_audits"`
}

func (HistoryItemScanOptions) IsScopedInsertionPoint

func (o HistoryItemScanOptions) IsScopedInsertionPoint(insertionPoint string) bool

type InsertionPoint

type InsertionPoint struct {
	Type         InsertionPointType
	Name         string       // the name of the parameter/header/cookie
	Value        string       // the current value
	ValueType    lib.DataType // the type of the value (string, int, float, etc.)
	OriginalData string       // the original data (URL, header string, body, cookie string) in which this insertion point was found
}

func GetInsertionPoints

func GetInsertionPoints(history *db.History, scoped []string) ([]InsertionPoint, error)

func (*InsertionPoint) String

func (i *InsertionPoint) String() string

type InsertionPointBuilder

type InsertionPointBuilder struct {
	Point   InsertionPoint
	Payload string
}

type InsertionPointType

type InsertionPointType string
const (
	InsertionPointTypeParameter InsertionPointType = "parameter"
	InsertionPointTypeHeader    InsertionPointType = "header"
	InsertionPointTypeBody      InsertionPointType = "body"
	InsertionPointTypeCookie    InsertionPointType = "cookie"
	InsertionPointTypeURLPath   InsertionPointType = "urlpath"
)

type ScanMode

type ScanMode string
const (
	ScanModeFast  ScanMode = "fast"
	ScanModeSmart ScanMode = "smart"
	ScanModeFuzz  ScanMode = "fuzz"
)

func GetScanMode

func GetScanMode(mode string) ScanMode

func (ScanMode) IsHigherOrEqual

func (sm ScanMode) IsHigherOrEqual(other ScanMode) bool

func (ScanMode) String

func (sm ScanMode) String() string

type TemplateScanner

type TemplateScanner struct {
	Concurrency         int
	InteractionsManager *integrations.InteractionsManager
	AvoidRepeatedIssues bool
	WorkspaceID         uint
	// contains filtered or unexported fields
}

func (*TemplateScanner) EvaluateDetectionMethod

func (f *TemplateScanner) EvaluateDetectionMethod(result TemplateScannerResult, method generation.DetectionMethod) (bool, string, int, error)

EvaluateDetectionMethod evaluates a detection method and returns a boolean indicating if it matched, a description of the match, the confidence and a possible error

func (*TemplateScanner) EvaluateResult

func (f *TemplateScanner) EvaluateResult(result TemplateScannerResult) (bool, string, int, error)

func (*TemplateScanner) Run

func (f *TemplateScanner) Run(history *db.History, payloadGenerators []*generation.PayloadGenerator, insertionPoints []InsertionPoint, options HistoryItemScanOptions) map[string][]TemplateScannerResult

Run starts the fuzzing job

type TemplateScannerResult

type TemplateScannerResult struct {
	Original       *db.History
	Result         *db.History
	Response       http.Response
	ResponseData   http_utils.FullResponseData
	Err            error
	Payload        generation.Payload
	InsertionPoint InsertionPoint
	Duration       time.Duration
	Issue          *db.Issue
}

type TemplateScannerTask

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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