output

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTMLWriter

type HTMLWriter struct{}

HTMLWriter implements HTML output

func (*HTMLWriter) Write

func (hw *HTMLWriter) Write(result *ScanResult, w io.Writer) error

type HostResult

type HostResult struct {
	IP       string       `json:"ip"`
	Hostname string       `json:"hostname"`
	Ports    []PortResult `json:"ports"`
}

HostResult represents findings for a single host

type JSONWriter

type JSONWriter struct{}

JSONWriter implements JSON output

func (*JSONWriter) Write

func (jw *JSONWriter) Write(result *ScanResult, w io.Writer) error

type PortResult

type PortResult struct {
	Port            int     `json:"port"`
	Protocol        string  `json:"protocol"`
	Service         string  `json:"service"`
	Banner          string  `json:"banner"`
	Version         string  `json:"version"`
	CPE             string  `json:"cpe"`
	Vulnerabilities []Vuln  `json:"vulnerabilities"`
	RiskScore       float64 `json:"risk_score"`
}

PortResult represents a single open port and its details

type ScanResult

type ScanResult struct {
	ScanID    string       `json:"scan_id"`
	Timestamp time.Time    `json:"timestamp"`
	Targets   []string     `json:"targets"`
	Results   []HostResult `json:"results"`
	Summary   ScanSummary  `json:"summary"`
}

ScanResult represents the top-level output structure

type ScanSummary

type ScanSummary struct {
	HostsScanned       int `json:"hosts_scanned"`
	OpenPorts          int `json:"open_ports"`
	VulnerableServices int `json:"vulnerable_services"`
	CriticalVulns      int `json:"critical_vulns"`
}

ScanSummary provides high-level metrics

type TableWriter

type TableWriter struct{}

TableWriter implements Table output

func (*TableWriter) Write

func (tw *TableWriter) Write(result *ScanResult, w io.Writer) error

type Vuln

type Vuln struct {
	CVE        string   `json:"cve"`
	CVSS       float64  `json:"cvss"`
	EPSS       float64  `json:"epss"`
	KEV        bool     `json:"kev"`
	Summary    string   `json:"summary"`
	References []string `json:"references"`
}

Vuln represents a specific vulnerability

type Writer

type Writer interface {
	Write(result *ScanResult, w io.Writer) error
}

Writer defines the interface for output formatters

func NewWriter

func NewWriter(format string) (Writer, error)

NewWriter returns a Writer based on the format string

Jump to

Keyboard shortcuts

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