pingsweep

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 5 Imported by: 0

README

Pingsweep

Pingsweep is a go module that will ping every device in a given subnet. It can either automatically grab the subnet, based on connected subnets, or a subnet can be specified. It does this by sending one ICMP echo request, then closing the connection.

Pingsweep is useful for network discovery and filling out IPv4 arp tables.

This module will set off some antivirus programs.

Options

Pingsweep has several options, you can use the default options, or specify your own. See examples/main.go for how to do this.

  • UseDefaultNetwork (bool): Only use the default network, ignore all others. This will only select the subnet associated with the default gateway.
  • MaxSubnetSize (int): Maximum subnet size. Default is 21, anything longer will be ignored as a valid interface. You can change this to ping larger subnets.
  • CustomSubnet (string): Specify the custom subnet to ping. Must be in CIDR notation.

Ignored networks

Pingsweep will ignore anything in the 169.254.0.0/16 and 127.0.0.0/8 subnets. These are typically not routed and do not have other hosts on them.

Versions

v0.0.1 - Initial release - 08/06/24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PingDriver

func PingDriver(psconfig PSconfig) ([]net.Addr, error)

Driver

Types

type PSconfig

type PSconfig struct {
	UseDefaultNetwork bool   //Only use the default network, ignore all others
	MaxSubnetSize     int    //Maxinimum subnet size. Default is 21, anything longer will be ignored as a valid interface.
	CustomSubnet      string //Custom subnet to ping.
}

Handle package config.

func NewPSconfig

func NewPSconfig() PSconfig

Generates a default PSconfig.

Jump to

Keyboard shortcuts

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