plugins

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 7 Imported by: 120

Documentation

Index

Constants

View Source
const (
	ProtoDNS        = "dns"
	ProtoDHCP       = "dhcp"
	ProtoFTP        = "ftp"
	ProtoHTTP       = "http"
	ProtoHTTPS      = "https"
	ProtoHTTP2      = "http2"
	ProtoIMAP       = "imap"
	ProtoIMAPS      = "imaps"
	ProtoIPSEC      = "ipsec"
	ProtoKafka      = "kafka"
	ProtoLDAP       = "ldap"
	ProtoLDAPS      = "ldaps"
	ProtoModbus     = "modbus"
	ProtoMQTT       = "mqtt"
	ProtoMSSQL      = "mssql"
	ProtoMySQL      = "mysql"
	ProtoNetbios    = "netbios"
	ProtoNTP        = "ntp"
	ProtoOracle     = "oracle"
	ProtoOpenVPN    = "openvpn"
	ProtoPOP3       = "pop3"
	ProtoPOP3S      = "pop3s"
	ProtoPostgreSQL = "postgresql"
	ProtoRDP        = "rdp"
	ProtoRPC        = "rpc"
	ProtoRedis      = "redis"
	ProtoRsync      = "rsync"
	ProtoRtsp       = "rtsp"
	ProtoSMB        = "smb"
	ProtoSMTP       = "smtp"
	ProtoSMTPS      = "smtps"
	ProtoSNMP       = "snmp"
	ProtoSSH        = "ssh"
	ProtoStun       = "stun"
	ProtoTelnet     = "telnet"
	ProtoVNC        = "vnc"
	ProtoUnknown    = "unknown"
)
View Source
const TypeService string = "service"

Variables

View Source
var Plugins = make(map[Protocol][]Plugin)

Functions

func RegisterPlugin

func RegisterPlugin(p Plugin)

This function must not be run concurrently. This function should only be run once per plugin.

Types

type Metadata added in v1.0.4

type Metadata interface {
	Type() string
}

type Plugin

type Plugin interface {
	Run(net.Conn, time.Duration, Target) (*Service, error)
	PortPriority(uint16) bool
	Name() string
	Type() Protocol
	Priority() int
}

type PluginID

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

Used as a key for maps to plugins. i.e.: map[Service] Plugin

func CreatePluginID

func CreatePluginID(p Plugin) PluginID

func (PluginID) String

func (p PluginID) String() string

type Protocol

type Protocol uint64

type SupportedIPVersion uint64

const (
	IP Protocol = iota + 1
	UDP
	TCP
	TCPTLS
)

func (Protocol) String

func (p Protocol) String() (s string)

type RPCB added in v1.0.4

type RPCB struct {
	Program  int    `json:"program"`
	Version  int    `json:"version"`
	Protocol string `json:"protocol"`
	Address  string `json:"address"`
	Owner    string `json:"owner"`
}

type Service added in v1.0.4

type Service struct {
	Host      string          `json:"host,omitempty"`
	IP        string          `json:"ip"`
	Port      int             `json:"port"`
	Protocol  string          `json:"protocol"`
	TLS       bool            `json:"tls"`
	Transport string          `json:"transport"`
	Version   string          `json:"version,omitempty"`
	Raw       json.RawMessage `json:"metadata"`
}

func CreateServiceFrom added in v1.0.4

func CreateServiceFrom(target Target, m Metadata, tls bool, version string, transport Protocol) *Service

func (Service) Metadata added in v1.0.4

func (e Service) Metadata() Metadata

func (Service) Type added in v1.0.4

func (e Service) Type() string

type ServiceDHCP added in v1.0.4

type ServiceDHCP struct {
	Option string `json:"option"`
}

func (ServiceDHCP) Type added in v1.0.4

func (e ServiceDHCP) Type() string

type ServiceDNS added in v1.0.4

type ServiceDNS struct {
	ResponseTXT string `json:"responseTXT"`
}

func (ServiceDNS) Type added in v1.0.4

func (e ServiceDNS) Type() string

type ServiceFTP added in v1.0.4

type ServiceFTP struct {
	Banner         string `json:"banner"`
	AnonymousLogin bool   `json:"anonymousLogin"`
}

func (ServiceFTP) Type added in v1.0.4

func (e ServiceFTP) Type() string

type ServiceHTTP added in v1.0.4

type ServiceHTTP struct {
	Status          string      `json:"status"`     // e.g. "200 OK"
	StatusCode      int         `json:"statusCode"` // e.g. 200
	ResponseHeaders http.Header `json:"responseHeaders"`
	Technologies    []string    `json:"technologies,omitempty"`
}

func (ServiceHTTP) Type added in v1.0.4

func (e ServiceHTTP) Type() string

type ServiceHTTPS added in v1.0.4

type ServiceHTTPS struct {
	Status          string      `json:"status"`     // e.g. "200 OK"
	StatusCode      int         `json:"statusCode"` // e.g. 200
	ResponseHeaders http.Header `json:"responseHeaders"`
	Technologies    []string    `json:"technologies,omitempty"`
}

func (ServiceHTTPS) Type added in v1.0.4

func (e ServiceHTTPS) Type() string

type ServiceIMAP added in v1.0.4

type ServiceIMAP struct {
	Banner string `json:"banner"`
}

func (ServiceIMAP) Type added in v1.0.4

func (e ServiceIMAP) Type() string

type ServiceIMAPS added in v1.0.4

type ServiceIMAPS struct {
	Banner string `json:"banner"`
}

func (ServiceIMAPS) Type added in v1.0.4

func (e ServiceIMAPS) Type() string

type ServiceIPSEC added in v1.0.4

type ServiceIPSEC struct {
	ResponderISP string `json:"responderISP"`
	MessageID    string `json:"messageID"`
}

func (ServiceIPSEC) Type added in v1.0.4

func (e ServiceIPSEC) Type() string

type ServiceKafka added in v1.0.4

type ServiceKafka struct{}

func (ServiceKafka) Type added in v1.0.4

func (e ServiceKafka) Type() string

type ServiceLDAP added in v1.0.4

type ServiceLDAP struct{}

func (ServiceLDAP) Type added in v1.0.4

func (e ServiceLDAP) Type() string

type ServiceLDAPS added in v1.0.4

type ServiceLDAPS struct{}

func (ServiceLDAPS) Type added in v1.0.4

func (e ServiceLDAPS) Type() string

type ServiceMQTT added in v1.0.4

type ServiceMQTT struct{}

func (ServiceMQTT) Type added in v1.0.4

func (e ServiceMQTT) Type() string

type ServiceMSSQL added in v1.0.4

type ServiceMSSQL struct {
}

func (ServiceMSSQL) Type added in v1.0.4

func (e ServiceMSSQL) Type() string

type ServiceModbus added in v1.0.4

type ServiceModbus struct{}

func (ServiceModbus) Type added in v1.0.4

func (e ServiceModbus) Type() string

type ServiceMySQL added in v1.0.4

type ServiceMySQL struct {
	PacketType   string `json:"packetType"` // the type of packet returned by the server (i.e. handshake or error)
	ErrorMessage string `json:"errorMsg"`   // error message if the server returns an error packet
	ErrorCode    int    `json:"errorCode"`  // error code returned if the server returns an error packet
}

func (ServiceMySQL) Type added in v1.0.4

func (e ServiceMySQL) Type() string

type ServiceNTP added in v1.0.4

type ServiceNTP struct{}

func (ServiceNTP) Type added in v1.0.4

func (e ServiceNTP) Type() string

type ServiceNetbios added in v1.0.4

type ServiceNetbios struct {
	NetBIOSName string `json:"netBIOSName"`
}

func (ServiceNetbios) Type added in v1.0.4

func (e ServiceNetbios) Type() string

type ServiceOpenVPN added in v1.0.4

type ServiceOpenVPN struct{}

func (ServiceOpenVPN) Type added in v1.0.4

func (e ServiceOpenVPN) Type() string

type ServiceOracle added in v1.0.4

type ServiceOracle struct {
	Info string `json:"info"`
}

func (ServiceOracle) Type added in v1.0.4

func (e ServiceOracle) Type() string

type ServicePOP3 added in v1.0.4

type ServicePOP3 struct {
	Banner string `json:"banner"`
}

func (ServicePOP3) Type added in v1.0.4

func (e ServicePOP3) Type() string

type ServicePOP3S added in v1.0.4

type ServicePOP3S struct {
	Banner string `json:"banner"`
}

func (ServicePOP3S) Type added in v1.0.4

func (e ServicePOP3S) Type() string

type ServicePostgreSQL added in v1.0.4

type ServicePostgreSQL struct {
	AuthRequired bool `json:"authRequired"`
}

func (ServicePostgreSQL) Type added in v1.0.4

func (e ServicePostgreSQL) Type() string

type ServiceRDP added in v1.0.4

type ServiceRDP struct {
	OSFingerprint       string `json:"fingerprint,omitempty"` // e.g. Windows Server 2016 or 2019
	OSVersion           string `json:"osVersion,omitempty"`
	TargetName          string `json:"targetName,omitempty"`
	NetBIOSComputerName string `json:"netBIOSComputerName,omitempty"`
	NetBIOSDomainName   string `json:"netBIOSDomainName,omitempty"`
	DNSComputerName     string `json:"dnsComputerName,omitempty"`
	DNSDomainName       string `json:"dnsDomainName,omitempty"`
	ForestName          string `json:"forestName,omitempty"`
}

func (ServiceRDP) Type added in v1.0.4

func (e ServiceRDP) Type() string

type ServiceRPC added in v1.0.4

type ServiceRPC struct {
	Entries []RPCB `json:"entries"`
}

func (ServiceRPC) Type added in v1.0.4

func (e ServiceRPC) Type() string

type ServiceRedis added in v1.0.4

type ServiceRedis struct {
	AuthRequired bool `json:"authRequired:"`
}

func (ServiceRedis) Type added in v1.0.4

func (e ServiceRedis) Type() string

type ServiceRsync added in v1.0.4

type ServiceRsync struct{}

func (ServiceRsync) Type added in v1.0.4

func (e ServiceRsync) Type() string

type ServiceRtsp added in v1.0.4

type ServiceRtsp struct {
	ServerInfo string `json:"serverInfo"`
}

func (ServiceRtsp) Type added in v1.0.4

func (e ServiceRtsp) Type() string

type ServiceSMB added in v1.0.4

type ServiceSMB struct {
	SigningEnabled      bool   `json:"signingEnabled"`  // e.g. Is SMB Signing Enabled?
	SigningRequired     bool   `json:"signingRequired"` // e.g. Is SMB Signing Required?
	OSVersion           string `json:"osVersion"`
	NetBIOSComputerName string `json:"netBIOSComputerName,omitempty"`
	NetBIOSDomainName   string `json:"netBIOSDomainName,omitempty"`
	DNSComputerName     string `json:"dnsComputerName,omitempty"`
	DNSDomainName       string `json:"dnsDomainName,omitempty"`
	ForestName          string `json:"forestName,omitempty"`
}

func (ServiceSMB) Type added in v1.0.4

func (e ServiceSMB) Type() string

type ServiceSMTP added in v1.0.4

type ServiceSMTP struct {
	Banner      string   `json:"banner"`
	AuthMethods []string `json:"auth_methods"`
}

func (ServiceSMTP) Type added in v1.0.4

func (e ServiceSMTP) Type() string

type ServiceSMTPS added in v1.0.4

type ServiceSMTPS struct {
	Banner      string   `json:"banner"`
	AuthMethods []string `json:"auth_methods"`
}

func (ServiceSMTPS) Type added in v1.0.4

func (e ServiceSMTPS) Type() string

type ServiceSNMP added in v1.0.4

type ServiceSNMP struct{}

func (ServiceSNMP) Type added in v1.0.4

func (e ServiceSNMP) Type() string

type ServiceSSH added in v1.0.4

type ServiceSSH struct {
	Banner              string `json:"banner"`
	PasswordAuthEnabled bool   `json:"passwordAuthEnabled"`
	Algo                string `json:"algo"`
	HostKey             string `json:"hostKey,omitempty"`
	HostKeyType         string `json:"hostKeyType,omitempty"`
	HostKeyFingerprint  string `json:"hostKeyFingerprint,omitempty"`
}

func (ServiceSSH) Type added in v1.0.4

func (e ServiceSSH) Type() string

type ServiceStun added in v1.0.4

type ServiceStun struct {
	Info string `json:"info"`
}

func (ServiceStun) Type added in v1.0.4

func (e ServiceStun) Type() string

type ServiceTelnet added in v1.0.4

type ServiceTelnet struct {
	ServerData string `json:"serverData"`
}

func (ServiceTelnet) Type added in v1.0.4

func (e ServiceTelnet) Type() string

type ServiceUnknown added in v1.0.4

type ServiceUnknown map[string]any

func (ServiceUnknown) Map added in v1.0.4

func (e ServiceUnknown) Map() map[string]any

func (ServiceUnknown) Type added in v1.0.4

func (e ServiceUnknown) Type() string

type ServiceVNC added in v1.0.4

type ServiceVNC struct{}

func (ServiceVNC) Type added in v1.0.4

func (e ServiceVNC) Type() string

type Target added in v1.0.4

type Target struct {
	Address netip.AddrPort
	Host    string
}

Jump to

Keyboard shortcuts

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