sshauditor

package
v0.0.0-...-db27fb8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: NCSA Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialWithDeadline

func DialWithDeadline(network, addr string, config *ssh.ClientConfig) (*ssh.Client, error)

DialWithDeadline is identical to ssh.Dial except that it calls SetDeadline on the underlying connection

func EnumerateHosts

func EnumerateHosts(netblocks []string, exclude []string) ([]string, error)

func ExpandCIDRs

func ExpandCIDRs(netblocks []string) ([]string, error)

func FetchSSHKeyFingerprint

func FetchSSHKeyFingerprint(hostport string) string

func SSHAuthAttempt

func SSHAuthAttempt(hostport, user, password string) (string, error)

func SSHDialAttempt

func SSHDialAttempt(client *ssh.Client, dest string) bool

func SSHExecAttempt

func SSHExecAttempt(client *ssh.Client, hostport string) bool

Types

type AuditReport

type AuditReport struct {
	ActiveHosts      []Host
	ActiveHostsCount int

	DuplicateKeys      map[string][]Host
	DuplicateKeysCount int

	Vulnerabilities      []Vulnerability
	VulnerabilitiesCount int
}

type AuditResult

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

type BruteForceResult

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

type Credential

type Credential struct {
	User         string
	Password     string
	ScanInterval int `db:"scan_interval"`
}

func (Credential) String

func (c Credential) String() string

type Host

type Host struct {
	Hostport    string
	Version     string
	Fingerprint string
	SeenFirst   string `db:"seen_first"`
	SeenLast    string `db:"seen_last"`
}

type HostCredential

type HostCredential struct {
	Hostport     string `json:"-"`
	User         string
	Password     string
	LastTested   string `db:"last_tested"`
	Result       string
	ScanInterval int `db:"scan_interval"`
}

type LogSearcher

type LogSearcher interface {
	GetIPs() ([]string, error)
}

func NewSplunkLogSearcher

func NewSplunkLogSearcher(baseURL string) LogSearcher

type SQLiteStore

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

func NewSQLiteStore

func NewSQLiteStore(uri string) (*SQLiteStore, error)

func (*SQLiteStore) AddCredential

func (s *SQLiteStore) AddCredential(c Credential) (bool, error)

func (*SQLiteStore) Begin

func (s *SQLiteStore) Begin() (*sqlx.Tx, error)

func (*SQLiteStore) Close

func (s *SQLiteStore) Close() error

func (*SQLiteStore) Commit

func (s *SQLiteStore) Commit() error

func (*SQLiteStore) DeleteHost

func (s *SQLiteStore) DeleteHost(hostport string) error

func (*SQLiteStore) Exec

func (s *SQLiteStore) Exec(query string, args ...interface{}) (sql.Result, error)

func (*SQLiteStore) Get

func (s *SQLiteStore) Get(dest interface{}, query string, args ...interface{}) error

func (*SQLiteStore) GetActiveHosts

func (s *SQLiteStore) GetActiveHosts(maxAgeDays int) ([]Host, error)

GetActiveHosts returns a list of hosts seen at most maxAgeDays ago

func (*SQLiteStore) GetAllCreds

func (s *SQLiteStore) GetAllCreds() ([]Credential, error)

func (*SQLiteStore) GetVulnerabilities

func (s *SQLiteStore) GetVulnerabilities() ([]Vulnerability, error)

func (*SQLiteStore) Init

func (s *SQLiteStore) Init() error

func (*SQLiteStore) ResetCreds

func (s *SQLiteStore) ResetCreds() error

func (*SQLiteStore) ResetInterval

func (s *SQLiteStore) ResetInterval() error

func (*SQLiteStore) Select

func (s *SQLiteStore) Select(dest interface{}, query string, args ...interface{}) error

type SSHAuditor

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

func New

func New(store *SQLiteStore) *SSHAuditor

func (*SSHAuditor) Discover

func (a *SSHAuditor) Discover(cfg ScanConfiguration) error

func (*SSHAuditor) Dupes

func (a *SSHAuditor) Dupes() (map[string][]Host, error)

func (*SSHAuditor) GetReport

func (a *SSHAuditor) GetReport() (AuditReport, error)

func (*SSHAuditor) Logcheck

func (a *SSHAuditor) Logcheck(cfg ScanConfiguration) error

func (*SSHAuditor) LogcheckReport

func (a *SSHAuditor) LogcheckReport(ls LogSearcher) error

func (*SSHAuditor) Rescan

func (a *SSHAuditor) Rescan(cfg ScanConfiguration) (AuditResult, error)

func (*SSHAuditor) Scan

func (*SSHAuditor) Vulnerabilities

func (a *SSHAuditor) Vulnerabilities() ([]Vulnerability, error)

type SSHHost

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

type ScanConfiguration

type ScanConfiguration struct {
	Include     []string
	Exclude     []string
	Ports       []int
	Concurrency int
}

type ScanRequest

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

type ScanResult

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

func ScanPort

func ScanPort(hostport string) ScanResult

type SplunkLogSearcher

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

func (*SplunkLogSearcher) GetIPs

func (s *SplunkLogSearcher) GetIPs() ([]string, error)

type Vulnerability

type Vulnerability struct {
	HostCredential
	Host `db:"host"`
}

Jump to

Keyboard shortcuts

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