Documentation ¶
Index ¶
- Constants
- Variables
- func NewGrabMarshaler() processing.Marshaler
- func NewGrabTargetDecoder(reader io.Reader) processing.Decoder
- func NewGrabWorker(config *Config) processing.Worker
- func RegisterEventType(t EventType)
- func WriteOutput(grabChan chan Grab, doneChan chan int, config *OutputConfig)
- type Config
- type Conn
- func (c *Conn) CheckHeartbleed(b []byte) (int, error)
- func (c *Conn) Close() error
- func (c *Conn) EHLO(domain string) error
- func (c *Conn) GetFTPBanner() error
- func (c *Conn) GetModbusResponse() (res ModbusResponse, err error)
- func (c *Conn) IMAPBanner(b []byte) (int, error)
- func (c *Conn) IMAPStartTLSHandshake() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) POP3Banner(b []byte) (int, error)
- func (c *Conn) POP3StartTLSHandshake() error
- func (c *Conn) Read(b []byte) (int, error)
- func (c *Conn) ReadMin(res []byte, bytes int) (cnt int, err error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SMTPBanner(b []byte) (int, error)
- func (c *Conn) SMTPHelp() error
- func (c *Conn) SMTPStartTLSHandshake() error
- func (c *Conn) SSHHandshake() error
- func (c *Conn) SendModbusEcho() (int, error)
- func (c *Conn) SetCAPool(pool *x509.CertPool)
- func (c *Conn) SetCBCOnly()
- func (c *Conn) SetChromeCiphers()
- func (c *Conn) SetChromeNoDHECiphers()
- func (c *Conn) SetDHEOnly()
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetDomain(domain string)
- func (c *Conn) SetExportsDHOnly()
- func (c *Conn) SetExportsOnly()
- func (c *Conn) SetFirefoxCiphers()
- func (c *Conn) SetFirefoxNoDHECiphers()
- func (c *Conn) SetNoSNI()
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetSChannelOnly()
- func (c *Conn) SetSafariCiphers()
- func (c *Conn) SetSafariNoDHECiphers()
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) States() []ConnectionEvent
- func (c *Conn) TLSHandshake() error
- func (c *Conn) Write(b []byte) (int, error)
- type ConnectEvent
- type ConnectionEvent
- type Dialer
- type EHLOEvent
- type EventData
- type EventType
- type ExceptionCode
- type ExceptionFunctionCode
- type ExceptionResponse
- type FTPBannerEvent
- type FunctionCode
- type Grab
- type GrabTarget
- type GrabWorker
- type HTTPGETEvent
- type HeartbleedEvent
- type MEIObject
- type MEIObjectID
- type MEIObjectSet
- type MEIResponse
- type MailBannerEvent
- type ModbusEvent
- type ModbusException
- type ModbusRequest
- type ModbusResponse
- type OutputConfig
- type ReadEvent
- type SMTPHelpEvent
- type SSHEvent
- type SSHScanConfig
- type StartTLSEvent
- type TLSHandshakeEvent
- type WriteEvent
Constants ¶
View Source
const ( SMTP_COMMAND = "STARTTLS\r\n" POP3_COMMAND = "STLS\r\n" IMAP_COMMAND = "a001 STARTTLS\r\n" )
View Source
const ( CONNECTION_EVENT_CONNECT_NAME = "connect" CONNECTION_EVENT_READ_NAME = "read" CONNECTION_EVENT_WRITE_NAME = "write" CONNECTION_EVENT_TLS_NAME = "tls_handshake" CONNECTION_EVENT_HEARTBLEED_NAME = "heartbleed" CONNECTION_EVENT_EHLO_NAME = "ehlo" CONNECTION_EVENT_STARTTLS_NAME = "starttls" CONNECTION_EVENT_MAIL_BANNER = "mail_banner" CONNECTION_EVENT_MODBUS = "modbus" CONNECTION_EVENT_FTP = "ftp" CONNECTION_EVENT_SSH_NAME = "ssh" )
View Source
const (
FunctionCodeMEI = FunctionCode(0x2B)
)
Variables ¶
View Source
var ConnectEventType = EventType{ TypeName: CONNECTION_EVENT_CONNECT_NAME, GetEmptyInstance: newConnectEvent, }
View Source
var EHLOEventType = EventType{ TypeName: CONNECTION_EVENT_EHLO_NAME, GetEmptyInstance: newEHLOEvent, }
View Source
var FTPBannerEventType = EventType{ TypeName: CONNECTION_EVENT_FTP, GetEmptyInstance: func() EventData { return new(FTPBannerEvent) }, }
View Source
var HTTPGetEventType = EventType{ TypeName: "http_get", GetEmptyInstance: func() EventData { return new(HTTPGETEvent) }, }
View Source
var HeartbleedEventType = EventType{ TypeName: CONNECTION_EVENT_HEARTBLEED_NAME, GetEmptyInstance: newHeartbleedEvent, }
View Source
var MailBannerEventType = EventType{ TypeName: CONNECTION_EVENT_MAIL_BANNER, GetEmptyInstance: func() EventData { return new(MailBannerEvent) }, }
View Source
var ModbusEventType = EventType{ TypeName: CONNECTION_EVENT_MODBUS, GetEmptyInstance: func() EventData { return new(ModbusEvent) }, }
View Source
var ModbusFunctionEncapsulatedInterface = FunctionCode(0x2B)
View Source
var ModbusHeaderBytes = []byte{
0x13, 0x37,
0x00, 0x00,
}
View Source
var ReadEventType = EventType{ TypeName: CONNECTION_EVENT_READ_NAME, GetEmptyInstance: func() EventData { return new(ReadEvent) }, }
View Source
var SMTPHelpEventType = EventType{ TypeName: "smtp_help", GetEmptyInstance: func() EventData { return new(SMTPHelpEvent) }, }
View Source
var SSHEventType = EventType{ TypeName: CONNECTION_EVENT_SSH_NAME, GetEmptyInstance: func() EventData { return new(SSHEvent) }, }
View Source
var StartTLSEventType = EventType{ TypeName: CONNECTION_EVENT_STARTTLS_NAME, GetEmptyInstance: func() EventData { return new(StartTLSEvent) }, }
View Source
var ( TLSHandshakeEventType = EventType{ TypeName: CONNECTION_EVENT_TLS_NAME, GetEmptyInstance: newTLSHandshakeEvent, } )
View Source
var WriteEventType = EventType{ TypeName: CONNECTION_EVENT_WRITE_NAME, GetEmptyInstance: newWriteEvent, }
Functions ¶
func NewGrabMarshaler ¶
func NewGrabMarshaler() processing.Marshaler
func NewGrabTargetDecoder ¶
func NewGrabTargetDecoder(reader io.Reader) processing.Decoder
func NewGrabWorker ¶
func NewGrabWorker(config *Config) processing.Worker
func RegisterEventType ¶
func RegisterEventType(t EventType)
func WriteOutput ¶
func WriteOutput(grabChan chan Grab, doneChan chan int, config *OutputConfig)
Types ¶
type Config ¶
type Config struct { // Connection Port uint16 Timeout time.Duration Senders uint ConnectionsPerHost uint // Encoding Encoding string // TLS TLS bool TLSVersion uint16 Heartbleed bool RootCAPool *x509.CertPool CBCOnly bool SChannelOnly bool DHEOnly bool ExportsOnly bool ExportsDHOnly bool FirefoxOnly bool FirefoxNoDHE bool ChromeOnly bool ChromeNoDHE bool SafariOnly bool SafariNoDHE bool NoSNI bool // SSH SSH SSHScanConfig // Banners and Data Banners bool SendData bool Data []byte Raw bool // Mail SMTP bool IMAP bool POP3 bool SMTPHelp bool EHLODomain string EHLO bool StartTLS bool // FTP FTP bool // Modbus Modbus bool // Error handling ErrorLog *zlog.Logger // Go Runtime Config GOMAXPROCS int }
type Conn ¶
type Conn struct { // Encoding type ReadEncoding string // contains filtered or unexported fields }
Implements the net.Conn interface
func (*Conn) GetFTPBanner ¶
func (*Conn) GetModbusResponse ¶
func (c *Conn) GetModbusResponse() (res ModbusResponse, err error)
func (*Conn) IMAPStartTLSHandshake ¶
func (*Conn) POP3StartTLSHandshake ¶
func (*Conn) RemoteAddr ¶
func (*Conn) SMTPStartTLSHandshake ¶
Do a STARTTLS handshake
func (*Conn) SSHHandshake ¶
func (*Conn) SendModbusEcho ¶
func (*Conn) SetCBCOnly ¶
func (c *Conn) SetCBCOnly()
func (*Conn) SetChromeCiphers ¶
func (c *Conn) SetChromeCiphers()
func (*Conn) SetChromeNoDHECiphers ¶
func (c *Conn) SetChromeNoDHECiphers()
func (*Conn) SetDHEOnly ¶
func (c *Conn) SetDHEOnly()
func (*Conn) SetExportsDHOnly ¶
func (c *Conn) SetExportsDHOnly()
func (*Conn) SetExportsOnly ¶
func (c *Conn) SetExportsOnly()
func (*Conn) SetFirefoxCiphers ¶
func (c *Conn) SetFirefoxCiphers()
func (*Conn) SetFirefoxNoDHECiphers ¶
func (c *Conn) SetFirefoxNoDHECiphers()
func (*Conn) SetSChannelOnly ¶
func (c *Conn) SetSChannelOnly()
func (*Conn) SetSafariCiphers ¶
func (c *Conn) SetSafariCiphers()
func (*Conn) SetSafariNoDHECiphers ¶
func (c *Conn) SetSafariNoDHECiphers()
func (*Conn) States ¶
func (c *Conn) States() []ConnectionEvent
func (*Conn) TLSHandshake ¶
Extra method - Do a TLS Handshake and record progress
type ConnectEvent ¶
type ConnectEvent struct { }
func (*ConnectEvent) GetType ¶
func (ce *ConnectEvent) GetType() EventType
func (*ConnectEvent) MarshalJSON ¶
func (ce *ConnectEvent) MarshalJSON() ([]byte, error)
func (*ConnectEvent) UnmarshalJSON ¶
func (ce *ConnectEvent) UnmarshalJSON([]byte) error
type ConnectionEvent ¶
func (*ConnectionEvent) MarshalJSON ¶
func (ce *ConnectionEvent) MarshalJSON() ([]byte, error)
func (*ConnectionEvent) UnmarshalJSON ¶
func (ce *ConnectionEvent) UnmarshalJSON(b []byte) error
type Dialer ¶
type EventType ¶
func EventTypeFromName ¶
func (EventType) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface
type ExceptionCode ¶
type ExceptionCode byte
type ExceptionFunctionCode ¶
type ExceptionFunctionCode byte
func (ExceptionFunctionCode) FunctionCode ¶
func (e ExceptionFunctionCode) FunctionCode() FunctionCode
type ExceptionResponse ¶
type ExceptionResponse struct { ExceptionFunction FunctionCode `json:"exception_function"` ExceptionType byte `json:"exception_type"` }
type FTPBannerEvent ¶
type FTPBannerEvent struct {
Banner string `json:"banner",omitempty`
}
func (*FTPBannerEvent) GetType ¶
func (f *FTPBannerEvent) GetType() EventType
type FunctionCode ¶
type FunctionCode byte
func (FunctionCode) ExceptionFunctionCode ¶
func (c FunctionCode) ExceptionFunctionCode() ExceptionFunctionCode
func (FunctionCode) IsException ¶
func (c FunctionCode) IsException() bool
type Grab ¶
type Grab struct { Host net.IP `json:"host"` Domain string `json:"domain"` Time time.Time `json:"timestamp"` Log []ConnectionEvent `json:"log"` }
func GrabBanner ¶
func GrabBanner(config *Config, target *GrabTarget) *Grab
func (*Grab) MarshalJSON ¶
func (*Grab) UnmarshalJSON ¶
type GrabTarget ¶
type GrabWorker ¶
type GrabWorker struct {
// contains filtered or unexported fields
}
GrabWorker implements ztools.processing.Worker
func (*GrabWorker) Done ¶
func (g *GrabWorker) Done()
func (*GrabWorker) Failure ¶
func (g *GrabWorker) Failure() uint
func (*GrabWorker) MakeHandler ¶
func (g *GrabWorker) MakeHandler(id uint) processing.Handler
func (*GrabWorker) RunCount ¶
func (g *GrabWorker) RunCount() uint
func (*GrabWorker) Success ¶
func (g *GrabWorker) Success() uint
func (*GrabWorker) Total ¶
func (g *GrabWorker) Total() uint
type HTTPGETEvent ¶
func (*HTTPGETEvent) GetType ¶
func (h *HTTPGETEvent) GetType() EventType
type HeartbleedEvent ¶
type HeartbleedEvent struct {
// contains filtered or unexported fields
}
func (*HeartbleedEvent) GetType ¶
func (h *HeartbleedEvent) GetType() EventType
func (*HeartbleedEvent) HeartbleedLog ¶
func (h *HeartbleedEvent) HeartbleedLog() *ztls.Heartbleed
func (*HeartbleedEvent) MarshalJSON ¶
func (h *HeartbleedEvent) MarshalJSON() ([]byte, error)
func (*HeartbleedEvent) UnmarshalJSON ¶
func (h *HeartbleedEvent) UnmarshalJSON(b []byte) error
type MEIObject ¶
type MEIObject struct { OID MEIObjectID Value string }
func (*MEIObject) MarshalJSON ¶
type MEIObjectID ¶
type MEIObjectID int
const ( OIDVendor MEIObjectID = 0 OIDProductCode MEIObjectID = 1 OIDRevision MEIObjectID = 2 OIDVendorURL MEIObjectID = 3 OIDProductName MEIObjectID = 4 OIDModelName MEIObjectID = 5 OIDUserApplicationName MEIObjectID = 6 )
func (*MEIObjectID) Name ¶
func (m *MEIObjectID) Name() string
type MEIObjectSet ¶
type MEIObjectSet []MEIObject
func (*MEIObjectSet) MarshalJSON ¶
func (ms *MEIObjectSet) MarshalJSON() ([]byte, error)
type MEIResponse ¶
type MEIResponse struct { ConformityLevel int `json:"conformity_level"` MoreFollows bool `json:"more_follows"` ObjectCount int `json:"object_count"` Objects MEIObjectSet `json:"objects"` }
type MailBannerEvent ¶
type MailBannerEvent struct {
Banner string
}
func (*MailBannerEvent) GetType ¶
func (mb *MailBannerEvent) GetType() EventType
func (*MailBannerEvent) MarshalJSON ¶
func (mb *MailBannerEvent) MarshalJSON() ([]byte, error)
func (*MailBannerEvent) UnmarshalJSON ¶
func (mb *MailBannerEvent) UnmarshalJSON(b []byte) error
type ModbusEvent ¶
type ModbusEvent struct { Length int `json:"length"` UnitID int `json:"unit_id"` Function FunctionCode `json:"function_code"` Response []byte `json:"raw_response"` MEIResponse *MEIResponse `json:"mei_response,omitempty"` ExceptionReponse *ExceptionResponse `json:"exception_response,omitempty"` }
func (*ModbusEvent) GetType ¶
func (m *ModbusEvent) GetType() EventType
func (*ModbusEvent) IsException ¶
func (m *ModbusEvent) IsException() bool
func (*ModbusEvent) ParseSelf ¶
func (m *ModbusEvent) ParseSelf()
type ModbusException ¶
type ModbusException struct { Function ExceptionFunctionCode ExceptionType ExceptionCode }
type ModbusRequest ¶
type ModbusRequest struct { Function FunctionCode Data []byte }
func (*ModbusRequest) MarshalBinary ¶
func (r *ModbusRequest) MarshalBinary() (data []byte, err error)
type ModbusResponse ¶
type ModbusResponse struct { Length int UnitID int Function FunctionCode Data []byte }
type ReadEvent ¶
type ReadEvent struct { Response []byte // contains filtered or unexported fields }
func (*ReadEvent) MarshalJSON ¶
func (*ReadEvent) UnmarshalJSON ¶
type SMTPHelpEvent ¶
type SMTPHelpEvent struct {
Response string
}
An SMTPHelpEvent represents sending a "HELP" message over SMTP
func (*SMTPHelpEvent) GetType ¶
func (h *SMTPHelpEvent) GetType() EventType
type SSHEvent ¶
type SSHEvent struct {
Handshake *ssh.HandshakeLog `json:"handshake"`
}
type SSHScanConfig ¶
func (*SSHScanConfig) GetClientImplementation ¶
func (sc *SSHScanConfig) GetClientImplementation() (*ssh.ClientImplementation, bool)
func (*SSHScanConfig) MakeConfig ¶
func (sc *SSHScanConfig) MakeConfig() *ssh.Config
func (*SSHScanConfig) MakeHostKeyNameList ¶
func (sc *SSHScanConfig) MakeHostKeyNameList() (ssh.NameList, error)
func (*SSHScanConfig) MakeKexNameList ¶
func (sc *SSHScanConfig) MakeKexNameList() (ssh.NameList, error)
type StartTLSEvent ¶
A StartTLSEvent represents sending a StartTLS
func (*StartTLSEvent) GetType ¶
func (s *StartTLSEvent) GetType() EventType
type TLSHandshakeEvent ¶
type TLSHandshakeEvent struct {
// contains filtered or unexported fields
}
HandshakeEvent implements the EventData interface
func (*TLSHandshakeEvent) GetHandshakeLog ¶
func (he *TLSHandshakeEvent) GetHandshakeLog() *ztls.ServerHandshake
func (*TLSHandshakeEvent) GetType ¶
func (he *TLSHandshakeEvent) GetType() EventType
func (*TLSHandshakeEvent) MarshalJSON ¶
func (he *TLSHandshakeEvent) MarshalJSON() ([]byte, error)
func (*TLSHandshakeEvent) UnmarshalJSON ¶
func (he *TLSHandshakeEvent) UnmarshalJSON(b []byte) error
type WriteEvent ¶
func (*WriteEvent) GetType ¶
func (w *WriteEvent) GetType() EventType
func (*WriteEvent) MarshalJSON ¶
func (w *WriteEvent) MarshalJSON() ([]byte, error)
func (*WriteEvent) UnmarshalJSON ¶
func (w *WriteEvent) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.