scan

package
v0.0.0-...-0f6999a Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result scan.Result

Result - A type containing various objects that are outputs of a scan. It has only one .Target, which theoretically means that we must have n Results for n Results. This type is to be created from and used by a scan.Run type, which has various methods to set up, populate, curate and save the data from a complete Scan, sometimes concurrently. A Result is not meant to be saved in a database: it is only used as a feeder type for the scan.Run.

func (*Result) ToPB

func (r *Result) ToPB() *scan.Result

ToPB - Get the Protobuf object for the Result

type Run

type Run scan.Run

Run - Represents a scan before, after or while being run. This run can be the one of any scanner: fields are not mandatorily used by all scanners for all scans, but this type gives a common tree in which to store hosts, ports, services, statistics and various other information.

The type provides many convenience methods to process all the output of the scan, either at once or continuously, or even to refine the objects based on/ with those already in a database. Therefore, all the methods of this type are meant to be used server-side, and not in an implant.

For having similar functionality from within an implant, use the Protobuf scan.Run type, which itself has some convenience methods that do NOT need any database or its related libraries.

func NewRun

func NewRun(scanner string, args ...string) *Run

NewRun - Create a new scan.Run based on a tool (scanner) name, and with an optional Options type holding various settings to be customized for your use.

func (*Run) AddResult

func (r *Run) AddResult(res *Result) (err error)

AddResult - Return a Result (which must be created with construtor: has mapped ID) This function takes care of matching anything against DB, populates various fields, and adds all of those into the Run object tree.

Note that when you call this function, if your scan makes use of the Result.Data field (used by custom/specific service scanner), we assume that it is correctly populated. You however have access to a few functions to manage the types you can put in this .Data

As for many other objects that you'll find as field in "request option structs", this Result can hold a host, service, port, etc. It is always advised to pass objects that are themselves coming from other tools/pipes, so as to keep track of them in complex workflows.

func (*Run) AddTarget

func (r *Run) AddTarget(t *Target)

AddTarget - Add a Target to the Scan. The fields are only checked when they are needed by the service probing stack used by the scan.

func (*Run) InitResult

func (r *Run) InitResult() *Result

InitResult - Instantiate a new result that has the Run UUID in ref. The rest of the object can be populated by the user as he wishes.

type Target

type Target scan.Target

Target - This type can be used as an Input object to a scan, in which case only the Input fields matter to you

Represents how the target was specified when passed to nmap, its status and the reason of its status. Example: <target specification="domain.does.not.exist" status="skipped" reason="invalid"/>

func (*Target) ToORM

func (t *Target) ToORM(ctx context.Context) (scan.TargetORM, error)

ToORM - Get the SQL object for the Target

func (*Target) ToPB

func (t *Target) ToPB() *scan.Target

ToPB - Get the Protobuf object for the Target

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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