port

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package port provides the data structures and logic necessary for interacting with ports on a network.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Details

type Details struct {
	Port     int    `json:"port" yaml:"port"`
	Protocol string `json:"protocol" yaml:"protocol"`
}

Details represents a singular instance of a port that was scanned and found to be open on a target host.

type Host

type Host struct {
	Host  string    `json:"host" yaml:"host"`
	IP    string    `json:"ip" yaml:"ip"`
	Ports []Details `json:"ports" yaml:"ports"`
}

Host represents a singular instance of a host that was scanned and found to have open ports.

type Report

type Report struct {
	Hosts  []Host   `json:"hosts" yaml:"hosts"`
	Errors []string `json:"errors" yaml:"errors"`
}

Report represents the final output of a port scan, including all hosts that were scanned and their open ports. It includes all of the hosts that were scanned alongside any non-fatal errors that were encountered during the scan.

func RunPortScan

func RunPortScan(ctx context.Context, target string, ports string, topport string) (Report, error)

RunPortScan takes a target host and a list of ports to scan and returns a report of all hosts that were scanned and their open ports.

Jump to

Keyboard shortcuts

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