netports

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: Apache-2.0 Imports: 10 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(p *extractor.Package) string

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

func (Extractor) Extract

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

func (e Extractor) ToPURL(p *extractor.Package) *purl.PackageURL

ToPURL converts a package 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