portscan

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Overview

Package portscan provides the data structures and logic necessary for conducting a port scan on a target host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostReport

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

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

type PortsReport

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

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

type Report

type Report struct {
	Hosts  []HostReport `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