common

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorConnRefused = "connection refused"
	ErrorTimeout     = "connection timed out"
)

Variables

This section is empty.

Functions

func AssertSiteName added in v0.2.0

func AssertSiteName(config *Config) bool

func CIDRToIPs

func CIDRToIPs(cidrAddress string, iparr *IPArray, wg *sync.WaitGroup)

func Copy

func Copy(srcPath, dstPath string) (err error)

func GetIPs

func GetIPs(config *Config) []string

func Run added in v0.2.0

func Run(config *Config)

Types

type Config

type Config struct {
	General struct {
		Site         string
		Debug        bool
		Workers      int
		ScannedLimit int
		FoundLimit   int
	}
	Ping struct {
		Protocol string
		Port     uint16
		Count    int
		Timeout  time.Duration
		// contains filtered or unexported fields
	}
	HTTP struct {
		Port    uint16
		Count   int
		Timeout time.Duration
		// contains filtered or unexported fields
	}
	Sites []Site
}

type IPArray

type IPArray struct {
	IPs []string
	// contains filtered or unexported fields
}

func (*IPArray) AddIP

func (arr *IPArray) AddIP(ip string)

type ScanRecord

type ScanRecord struct {
	IP       string  `json:"ip"`       // ip:port
	Protocol string  `json:"protocol"` // icmp, tcp, udp
	PingRTT  float64 `json:"pingrtt"`  // response latency in milliseconds: 9999999 indicates timeout, -1 indicates unreachable, 0 general error.
	HttpRTT  float64 `json:"httprtt"`  // response latency in milliseconds: 9999999 indicates timeout, -1 indicates unreachable, 0 general error.
}

type ScanRecordArray

type ScanRecordArray []*ScanRecord

func (*ScanRecordArray) Len

func (records *ScanRecordArray) Len() int

func (*ScanRecordArray) Less

func (records *ScanRecordArray) Less(i, j int) bool

func (*ScanRecordArray) Swap

func (records *ScanRecordArray) Swap(i, j int)

type ScanResult

type ScanResult struct {
	// contains filtered or unexported fields
}

func (*ScanResult) AddRecord

func (result *ScanResult) AddRecord(record *ScanRecord)

func (*ScanResult) Found

func (result *ScanResult) Found() int

func (*ScanResult) IncScanCounter

func (result *ScanResult) IncScanCounter()

func (*ScanResult) Scanned

func (result *ScanResult) Scanned() int

type Site added in v0.2.0

type Site struct {
	Name               string
	IPRangesAPI        string
	IPRangesFile       string
	CustomIPRangesFile string
	IPOutputFile       string
	WithIPv6           bool
	HttpsURL           string
	Domains            []string
}

func RetrieveSiteCfg added in v0.2.0

func RetrieveSiteCfg(config *Config) Site

RetrieveSiteCfg assumed that the site name must exist in the configuration file and no error handling required

Jump to

Keyboard shortcuts

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