port

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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