scan

package
v0.0.0-...-ed80cad Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package Scan provides types and functions to perform TCP port scans on a list of hosts

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExists    = errors.New("Host already in the list")
	ErrNotExists = errors.New("Host not in th elist")
)

Functions

This section is empty.

Types

type HostsList

type HostsList struct {
	Hosts []string
}

func (*HostsList) Add

func (hl *HostsList) Add(host string) error

Add adds a host to the list

func (*HostsList) Load

func (hl *HostsList) Load(hostsFile string) error

Load obtains hosts from the host file

func (*HostsList) Remove

func (hl *HostsList) Remove(host string) error

Remove deletes a host from the list

func (*HostsList) Save

func (hl *HostsList) Save(hostsFile string) error

Save saves hosts to a hsots file

type PortState

type PortState struct {
	Port int
	Open state
}

type Results

type Results struct {
	Host       string
	NotFound   bool
	PortStates []PortState
}

func Run

func Run(hl *HostsList, ports []int) []Results

Run performs a port scan on the hosts list

Jump to

Keyboard shortcuts

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