Versions in this module Expand all Collapse all v0 v0.1.7 May 10, 2023 v0.0.0 May 10, 2023 Changes in this version + const ErrTotalTimeout + const ReadLimitExceededActionError + const ReadLimitExceededActionNotSet + const ReadLimitExceededActionPanic + const ReadLimitExceededActionTruncate + const SCAN_APPLICATION_ERROR + const SCAN_CONNECTION_CLOSED + const SCAN_CONNECTION_REFUSED + const SCAN_CONNECTION_TIMEOUT + const SCAN_IO_TIMEOUT + const SCAN_PROTOCOL_ERROR + const SCAN_SUCCESS + const SCAN_UNKNOWN_ERROR + var DefaultBytesReadLimit = 256 * 1024 * 1024 + var DefaultReadLimitExceededAction = ReadLimitExceededActionTruncate + var DefaultSessionTimeout = 1 * time.Minute + var ErrInvalidArguments = errors.New("invalid arguments") + var ErrInvalidResponse = errors.New("invalid response") + var ErrMismatchedFlags = errors.New("mismatched flag/module") + var ErrReadLimitExceeded = errors.New("read limit exceeded") + var ErrUnexpectedResponse = errors.New("unexpected response") + var InsufficientBufferError = errors.New("not enough buffer space") + func AddCommand(command string, shortDescription string, longDescription string, port int, ...) (*flags.Command, error) + func AddGroup(shortDescription string, longDescription string, data interface{}) + func DialTimeoutConnection(proto string, target string, timeout time.Duration, bytesReadLimit int) (net.Conn, error) + func DialTimeoutConnectionEx(proto string, target string, ...) (net.Conn, error) + func EncodeGrab(raw *Grab, includeDebug bool) ([]byte, error) + func FlagsToSet(flags uint64, mapping map[uint64]string) (map[string]bool, []uint64) + func GetMetaFile() *os.File + func GetTargetsCSV(source io.Reader, ch chan<- ScanTarget) error + func GetTimeoutDialFunc(timeout time.Duration) func(string, string) (net.Conn, error) + func InputTargetsCSV(ch chan<- ScanTarget) error + func IsTimeoutError(err error) bool + func ListFlagsToSet(flags uint64, labels []string) (map[string]bool, []uint64) + func LogPanic(format string, args ...interface{}) + func MapFlagsToSet(flags uint64, mapping FlagMap) (map[string]bool, []uint64) + func NewFakeResolver(ipstr string) (*net.Resolver, error) + func NewIniParser() *flags.IniParser + func OutputResults(w *bufio.Writer, results <-chan []byte) error + func ParseCSVTarget(fields []string) (ipnet *net.IPNet, domain string, tag string, err error) + func PrintScanners() + func Process(mon *Monitor) + func ReadAvailable(conn net.Conn) ([]byte, error) + func ReadAvailableWithOptions(conn net.Conn, bufferSize int, readTimeout time.Duration, ...) ([]byte, error) + func ReadUntilRegex(connection net.Conn, res []byte, expr *regexp.Regexp) (int, error) + func RegisterScan(name string, s Scanner) + func SetInputFunc(f InputTargetsFunc) + func SetOutputFunc(f OutputResultsFunc) + func TLDMatches(host1 string, host2 string) bool + func WidenMapKeys(input map[int]string) map[uint64]string + func WidenMapKeys16(input map[uint16]string) map[uint64]string + func WidenMapKeys32(input map[uint32]string) map[uint64]string + func WidenMapKeys8(input map[uint8]string) map[uint64]string + type BaseFlags struct + BytesReadLimit int + Name string + Port uint + Timeout time.Duration + Trigger string + func (b *BaseFlags) GetName() string + type Config struct + ConnectionsPerHost int + Debug bool + Flush bool + GOMAXPROCS int + InputFileName string + LocalAddress string + LogFileName string + MetaFileName string + Multiple MultipleCommand + OutputFileName string + Prometheus string + ReadLimitPerHost int + Senders int + type Dialer struct + BytesReadLimit int + ConnectTimeout time.Duration + Dialer *net.Dialer + ReadLimitExceededAction ReadLimitExceededAction + ReadTimeout time.Duration + Timeout time.Duration + WriteTimeout time.Duration + func GetTimeoutConnectionDialer(timeout time.Duration) *Dialer + func NewDialer(value *Dialer) *Dialer + func (d *Dialer) Dial(proto string, target string) (net.Conn, error) + func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) + func (d *Dialer) SetDefaults() *Dialer + type FakeDNSServer struct + IP net.IP + func (f *FakeDNSServer) DialContext(ctx context.Context, network, address string) (net.Conn, error) + type FlagMap func(uint64) (string, error) + func GetFlagMapFromList(bits []string) FlagMap + func GetFlagMapFromMap(mapping map[uint64]string) FlagMap + type Grab struct + Data map[string]ScanResponse + Domain string + IP string + func BuildGrabFromInputResponse(t *ScanTarget, responses map[string]ScanResponse) *Grab + type InputTargetsFunc func(ch chan<- ScanTarget) error + type ModuleSet map[string]ScanModule + func NewModuleSet() ModuleSet + func (s ModuleSet) AddModule(name string, m ScanModule) + func (s ModuleSet) CopyInto(destination ModuleSet) + func (s ModuleSet) RemoveModule(name string) + type Monitor struct + Callback func(string) + func MakeMonitor(statusChanSize int, wg *sync.WaitGroup) *Monitor + func (m *Monitor) GetStatuses() map[string]*State + func (m *Monitor) Stop() + type MultipleCommand struct + BreakOnSuccess bool + ConfigFileName string + ContinueOnError bool + func (x *MultipleCommand) Help() string + func (x *MultipleCommand) Validate(args []string) error + type OutputResultsFunc func(results <-chan []byte) error + func OutputResultsWriterFunc(w io.Writer) OutputResultsFunc + type ReadLimitExceededAction string + type ScanError struct + Err error + Status ScanStatus + func DetectScanError(err error) *ScanError + func NewScanError(status ScanStatus, err error) *ScanError + func (err *ScanError) Error() string + func (err *ScanError) Unpack(results interface{}) (ScanStatus, interface{}, error) + type ScanFlags interface + Help func() string + Validate func(args []string) error + func ParseCommandLine(flags []string) ([]string, string, ScanFlags, error) + type ScanModule interface + Description func() string + NewFlags func() interface{} + NewScanner func() Scanner + func GetModule(name string) ScanModule + type ScanResponse struct + Error *string + Protocol string + Result interface{} + Status ScanStatus + Timestamp string + func RunScanner(s Scanner, mon *Monitor, target ScanTarget) (string, ScanResponse) + type ScanStatus string + func TryGetScanStatus(err error) ScanStatus + type ScanTarget struct + Domain string + IP net.IP + Port *uint + Tag string + func (target *ScanTarget) Host() string + func (target *ScanTarget) Open(flags *BaseFlags) (net.Conn, error) + func (target *ScanTarget) OpenTLS(baseFlags *BaseFlags, tlsFlags *TLSFlags) (*TLSConnection, error) + func (target *ScanTarget) OpenUDP(flags *BaseFlags, udp *UDPFlags) (net.Conn, error) + func (target ScanTarget) String() string + type Scanner interface + GetName func() string + GetTrigger func() string + Init func(flags ScanFlags) error + InitPerSender func(senderID int) error + Protocol func() string + Scan func(t ScanTarget) (ScanStatus, interface{}, error) + type State struct + Failures uint + Successes uint + type TLSConnection struct + func (conn *TLSConnection) Close() error + func (z *TLSConnection) GetLog() *TLSLog + func (z *TLSConnection) Handshake() error + type TLSFlags struct + CertificateMap string + Certificates string + CipherSuite string + ClientHello string + ClientRandom string + Config *tls.Config + CurvePreferences string + DSAEnabled bool + ExtendedMasterSecret bool + ExtendedRandom bool + HeartbeatEnabled bool + KeepClientLogs bool + MaxVersion int + MinVersion int + NextProtos string + NoECDHE bool + NoSNI bool + RenegotiateFreely bool + RootCAs string + SCTExt bool + ServerName string + SessionTicket bool + SignatureAlgorithms string + Time string + VerifyServerCertificate bool + func (t *TLSFlags) Connect(target *ScanTarget, flags *BaseFlags) (*TLSConnection, error) + func (t *TLSFlags) GetTLSConfig() (*tls.Config, error) + func (t *TLSFlags) GetTLSConfigForTarget(target *ScanTarget) (*tls.Config, error) + func (t *TLSFlags) GetTLSConnection(conn net.Conn) (*TLSConnection, error) + func (t *TLSFlags) GetTLSConnectionForTarget(conn net.Conn, target *ScanTarget) (*TLSConnection, error) + func (t *TLSFlags) GetWrappedConnection(conn net.Conn, cfg *tls.Config) *TLSConnection + type TLSLog struct + HandshakeLog *tls.ServerHandshake + type TimeoutConnection struct + BytesRead int + BytesReadLimit int + BytesWritten int + Cancel context.CancelFunc + ReadLimitExceededAction ReadLimitExceededAction + ReadTimeout time.Duration + Timeout time.Duration + WriteTimeout time.Duration + func NewTimeoutConnection(ctx context.Context, conn net.Conn, ...) *TimeoutConnection + func (c *TimeoutConnection) Close() error + func (c *TimeoutConnection) Read(b []byte) (n int, err error) + func (c *TimeoutConnection) SetDeadline(deadline time.Time) error + func (c *TimeoutConnection) SetDefaults() *TimeoutConnection + func (c *TimeoutConnection) SetReadDeadline(deadline time.Time) error + func (c *TimeoutConnection) SetWriteDeadline(deadline time.Time) error + func (c *TimeoutConnection) Write(b []byte) (n int, err error) + type UDPFlags struct + LocalAddress string + LocalPort uint