activescan

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package activescan is the deterministic active-scan engine: it enumerates the injection points of a request, fires per-class payloads at them through a caller-supplied sender, and confirms vulnerabilities with detectors. It has no dependency on the proxy/control — the caller wires a SendFunc (normally the `sender`, so probes are recorded and session-auth applied) and the scope gate.

It is "without AI" by construction; the AI operates the SAME engine over MCP.

Index

Constants

This section is empty.

Variables

View Source
var Checks = []Check{
	xssCheck, sqliErrorCheck, sqliBooleanCheck, sqliTimeCheck, sstiCheck,
	openRedirectCheck, pathTraversalCheck, cmdInjectionCheck,
	xxeCheck, crlfCheck,
	nosqlCheck, ldapCheck, xpathCheck,
	hostHeaderCheck, corsReflectionCheck,
}

Checks is the built-in active-check set.

Functions

func BuiltinTemplate

func BuiltinTemplate(id string) (string, bool)

BuiltinTemplate returns default Starlark for a built-in active probe. Saving to ~/.interseptor/active-checks/<id>.star overrides the Go probe.

func IsBuiltinID

func IsBuiltinID(id string) bool

IsBuiltinID reports whether id is a built-in active probe.

Types

type Check

type Check struct {
	ID                          string
	Class, Severity, Title, Fix string
	Run                         func(p Point, baseline Response, probe Prober) *Hit
}

Check is one active vulnerability check. Run is given the point, the unmutated baseline response, and a probe to fire payloads; it returns a Hit or nil.

func BuiltinMeta

func BuiltinMeta(id string) (Check, bool)

BuiltinMeta returns metadata for a built-in active probe.

type Finding

type Finding struct {
	Class    string `json:"class"`
	Severity string `json:"severity"`
	Title    string `json:"title"`
	Detail   string `json:"detail,omitempty"`
	Fix      string `json:"fix"`
	Point    Point  `json:"point"`
	Evidence string `json:"evidence"`
	FlowID   int64  `json:"flowId"`
}

Finding is a confirmed active-scan result (shaped like a scanner issue).

func Run

func Run(ctx context.Context, t Target, send SendFunc, opts Options) ([]Finding, int)

Run scans t with every built-in Check, bounded by opts and cancellable via ctx (the kill switch). Returns the findings and the number of requests issued.

type Hit

type Hit struct {
	Evidence string
	FlowID   int64
	Title    string
	Severity string
	Detail   string
	Fix      string
}

Hit is a confirmed detection from a check. The override fields (Title/Severity/ Detail/Fix) are empty for the built-in checks (which carry those on the Check itself) but populated by user-authored checks so each finding is self-describing.

type Options

type Options struct {
	MaxRequests int // hard cap on probes (default 800)
	Concurrency int // parallel point×check tasks (default 6)
	Disabled    map[string]bool
	Custom      []Check // user-authored (Starlark) active checks, in addition to Checks
}

Options bound a run.

type Point

type Point struct {
	Kind  string `json:"kind"` // "query" | "form" | "json"
	Name  string `json:"name"`
	Value string `json:"value"`
}

Point is one injection location in a request.

func Points

func Points(t Target) []Point

Points enumerates query, form-body, and top-level JSON-body injection points.

type Prober

type Prober func(payload string) Response

Prober sends one payload into the point under test and returns the response.

type Response

type Response struct {
	FlowID   int64
	Status   int
	Headers  http.Header
	Body     string
	Duration time.Duration
}

Response is one probe's result.

type SendFunc

type SendFunc func(Target) Response

SendFunc issues a (possibly mutated) request and returns its response. It must be safe for concurrent use.

type Target

type Target struct {
	Method  string
	URL     string
	Headers http.Header
	Body    string
}

Target is the request being scanned.

func (Target) With

func (t Target) With(p Point, payload string) Target

With returns a copy of t with point p's value replaced by payload.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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