netports

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package netports extracts open ports on the system and maps them to running processes when possible.

Index

Constants

View Source
const (
	// Name is the unique name of this extractor.
	Name = "os/netports"
)

Variables

This section is empty.

Functions

func New

func New() standalone.Extractor

New creates a new Extractor.

Types

type Extractor

type Extractor struct{}

Extractor extracts open ports on the system.

func (Extractor) Ecosystem

func (Extractor) Ecosystem(i *extractor.Inventory) string

Ecosystem returns no Ecosystem since the ecosystem is not known by OSV yet.

func (Extractor) Extract

func (e Extractor) Extract(ctx context.Context, input *standalone.ScanInput) ([]*extractor.Inventory, error)

Extract extracts open ports on the system.

func (Extractor) Name

func (e Extractor) Name() string

Name of the extractor.

func (Extractor) Requirements

func (e Extractor) Requirements() *plugin.Capabilities

Requirements of the extractor.

func (Extractor) ToPURL

ToPURL converts an inventory created by this extractor into a PURL. This extractor does not create PURLs.

func (Extractor) Version

func (e Extractor) Version() int

Version of the extractor.

type Metadata

type Metadata struct {
	// The port number.
	Port uint32
	// The protocol (tcp, udp).
	Protocol string
	// The command line of the process listening on the port, if available.
	Cmdline string
}

Metadata contains metadata about a given open port.

Jump to

Keyboard shortcuts

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