plugins

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: AGPL-3.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtoDNS        = "dns"
	ProtoDHCP       = "dhcp"
	ProtoEcho       = "echo"
	ProtoFTP        = "ftp"
	ProtoHTTP       = "http"
	ProtoHTTPS      = "https"
	ProtoHTTP2      = "http2"
	ProtoIMAP       = "imap"
	ProtoIMAPS      = "imaps"
	ProtoIPMI       = "ipmi"
	ProtoIPSEC      = "ipsec"
	ProtoJDWP       = "jdwp"
	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

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

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

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

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

func (Service) Metadata

func (e Service) Metadata() Metadata

func (Service) Type

func (e Service) Type() string

type ServiceDHCP

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

func (ServiceDHCP) Type

func (e ServiceDHCP) Type() string

type ServiceDNS

type ServiceDNS struct{}

func (ServiceDNS) Type

func (e ServiceDNS) Type() string

type ServiceEcho

type ServiceEcho struct{}

func (ServiceEcho) Type

func (e ServiceEcho) Type() string

type ServiceFTP

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

func (ServiceFTP) Type

func (e ServiceFTP) Type() string

type ServiceHTTP

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

func (e ServiceHTTP) Type() string

type ServiceHTTPS

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

func (e ServiceHTTPS) Type() string

type ServiceIMAP

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

func (ServiceIMAP) Type

func (e ServiceIMAP) Type() string

type ServiceIMAPS

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

func (ServiceIMAPS) Type

func (e ServiceIMAPS) Type() string

type ServiceIPMI

type ServiceIPMI struct{}

func (ServiceIPMI) Type

func (e ServiceIPMI) Type() string

type ServiceIPSEC

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

func (ServiceIPSEC) Type

func (e ServiceIPSEC) Type() string

type ServiceJDWP

type ServiceJDWP struct {
	Description string `json:"description"`
	JdwpMajor   int32  `json:"jdwpMajor"`
	JdwpMinor   int32  `json:"jdwpMinor"`
	VMVersion   string `json:"VMVersion"`
	VMName      string `json:"VMName"`
}

func (ServiceJDWP) Type

func (e ServiceJDWP) Type() string

type ServiceKafka

type ServiceKafka struct{}

func (ServiceKafka) Type

func (e ServiceKafka) Type() string

type ServiceLDAP

type ServiceLDAP struct{}

func (ServiceLDAP) Type

func (e ServiceLDAP) Type() string

type ServiceLDAPS

type ServiceLDAPS struct{}

func (ServiceLDAPS) Type

func (e ServiceLDAPS) Type() string

type ServiceMQTT

type ServiceMQTT struct{}

func (ServiceMQTT) Type

func (e ServiceMQTT) Type() string

type ServiceMSSQL

type ServiceMSSQL struct {
}

func (ServiceMSSQL) Type

func (e ServiceMSSQL) Type() string

type ServiceModbus

type ServiceModbus struct{}

func (ServiceModbus) Type

func (e ServiceModbus) Type() string

type ServiceMySQL

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

func (e ServiceMySQL) Type() string

type ServiceNTP

type ServiceNTP struct{}

func (ServiceNTP) Type

func (e ServiceNTP) Type() string

type ServiceNetbios

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

func (ServiceNetbios) Type

func (e ServiceNetbios) Type() string

type ServiceOpenVPN

type ServiceOpenVPN struct{}

func (ServiceOpenVPN) Type

func (e ServiceOpenVPN) Type() string

type ServiceOracle

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

func (ServiceOracle) Type

func (e ServiceOracle) Type() string

type ServicePOP3

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

func (ServicePOP3) Type

func (e ServicePOP3) Type() string

type ServicePOP3S

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

func (ServicePOP3S) Type

func (e ServicePOP3S) Type() string

type ServicePostgreSQL

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

func (ServicePostgreSQL) Type

func (e ServicePostgreSQL) Type() string

type ServiceRDP

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

func (e ServiceRDP) Type() string

type ServiceRPC

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

func (ServiceRPC) Type

func (e ServiceRPC) Type() string

type ServiceRedis

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

func (ServiceRedis) Type

func (e ServiceRedis) Type() string

type ServiceRsync

type ServiceRsync struct{}

func (ServiceRsync) Type

func (e ServiceRsync) Type() string

type ServiceRtsp

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

func (ServiceRtsp) Type

func (e ServiceRtsp) Type() string

type ServiceSMB

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

func (e ServiceSMB) Type() string

type ServiceSMTP

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

func (ServiceSMTP) Type

func (e ServiceSMTP) Type() string

type ServiceSMTPS

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

func (ServiceSMTPS) Type

func (e ServiceSMTPS) Type() string

type ServiceSNMP

type ServiceSNMP struct{}

func (ServiceSNMP) Type

func (e ServiceSNMP) Type() string

type ServiceSSH

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

func (e ServiceSSH) Type() string

type ServiceStun

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

func (ServiceStun) Type

func (e ServiceStun) Type() string

type ServiceTelnet

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

func (ServiceTelnet) Type

func (e ServiceTelnet) Type() string

type ServiceUnknown

type ServiceUnknown map[string]any

func (ServiceUnknown) Map

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

func (ServiceUnknown) Type

func (e ServiceUnknown) Type() string

type ServiceVNC

type ServiceVNC struct{}

func (ServiceVNC) Type

func (e ServiceVNC) Type() string

type Target

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