Documentation ¶
Index ¶
- Variables
- func GenerateIPStreamFromCIDR(ipnet *net.IPNet, blacklist *NrayBlacklist) <-chan net.IP
- func GeneratePortStream(ports []uint16) <-chan uint16
- func GetNmapTopTCPPorts(topN uint) []uint16
- func GetNmapTopUDPPorts(topN uint) []uint16
- func ParsePorts(rawPorts []string, proto string) []uint16
- type AnyTargets
- type NrayBlacklist
- func (blacklist *NrayBlacklist) AddDNSNameToBlacklist(dnsName string)
- func (blacklist *NrayBlacklist) AddNetToBlacklist(network string)
- func (blacklist *NrayBlacklist) AddToBlacklist(element string) uint64
- func (blacklist *NrayBlacklist) IsDNSNameBlacklisted(dnsName string) bool
- func (blacklist *NrayBlacklist) IsIPBlacklisted(ip string) bool
- type TargetGenerator
Constants ¶
This section is empty.
Variables ¶
var TopTCPPorts = [...]uint16{} /* 8330 elements not displayed */
TopTCPPorts contains a static list of top TCP ports as contained in nmap 7.70 The list is created via sort -r -k3 /usr/share/nmap/nmap-services | grep tcp | awk '{split($2, splitted, "/"); print splitted[1]}'
var TopUDPPorts = [...]uint16{} /* 19050 elements not displayed */
TopUDPPorts contains a static list of top UDP ports as contained in nmap 7.70, generated the same way as TCP ports
Functions ¶
func GenerateIPStreamFromCIDR ¶
func GenerateIPStreamFromCIDR(ipnet *net.IPNet, blacklist *NrayBlacklist) <-chan net.IP
GenerateIPStreamFromCIDR uses the ZMap algorithm to expand a CIDR network. A blacklist may be specified and hosts contained in there are omitted. Returns a stream of hosts, which is closed when the network has been completely expanded.
func GeneratePortStream ¶
GeneratePortStream takes a list of ports and returns them in arbitrary order over a channel
func GetNmapTopTCPPorts ¶
GetNmapTopTCPPorts returns an array containing the topN TCP ports
func GetNmapTopUDPPorts ¶
GetNmapTopUDPPorts returns an array containing the topN UDP ports
func ParsePorts ¶
ParsePorts takes the a list of target strings supplied by the user and tries to parse them into a slice of uint32s Errors are sent back over errorChan
Types ¶
type AnyTargets ¶
AnyTargets is the most abstract type holding information regarding targets. Any number of hosts, networks, ports etc. is allowed
func (*AnyTargets) TargetCount ¶ added in v1.1.0
func (at *AnyTargets) TargetCount() uint64
TargetCount returns the number of targets, meaning individual ports on individual systems
type NrayBlacklist ¶
type NrayBlacklist struct {
// contains filtered or unexported fields
}
NrayBlacklist allows to add/query ip/net/dns blacklisted items
func (*NrayBlacklist) AddDNSNameToBlacklist ¶
func (blacklist *NrayBlacklist) AddDNSNameToBlacklist(dnsName string)
AddDNSNameToBlacklist adds a FQDN to the blacklist
func (*NrayBlacklist) AddNetToBlacklist ¶
func (blacklist *NrayBlacklist) AddNetToBlacklist(network string)
AddNetToBlacklist adds a CIDR network range to the blacklist <ip>/32 achieves the same for a single IP
func (*NrayBlacklist) AddToBlacklist ¶
func (blacklist *NrayBlacklist) AddToBlacklist(element string) uint64
AddToBlacklist can be used if the type of the element is unclear
func (*NrayBlacklist) IsDNSNameBlacklisted ¶
func (blacklist *NrayBlacklist) IsDNSNameBlacklisted(dnsName string) bool
IsDNSNameBlacklisted returns true if a given DNS name is blacklisted
func (*NrayBlacklist) IsIPBlacklisted ¶
func (blacklist *NrayBlacklist) IsIPBlacklisted(ip string) bool
IsIPBlacklisted returns true if the given IP is contained in a network in the blacklist
type TargetGenerator ¶
type TargetGenerator struct {
// contains filtered or unexported fields
}
TargetGenerator is the type that unifies all backends and provides central access to all generated targets
func (*TargetGenerator) GetTargetChan ¶
func (tg *TargetGenerator) GetTargetChan() <-chan AnyTargets
GetTargetChan is used to expose a read-only channel to the core
func (*TargetGenerator) Init ¶
func (tg *TargetGenerator) Init(config *viper.Viper)
Init takes the target generation subtree of the configuration and sets up the TargetGenerator to receive targets from
func (*TargetGenerator) TargetCount ¶ added in v1.1.0
func (tg *TargetGenerator) TargetCount() uint64
TargetCount returns the total target count of this target generator.