cmd

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: BSD-2-Clause, BSD-3-Clause, MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const MaxJSONLine = 1024 * 1024 * 16

Variables

View Source
var Checks []sshCheck
View Source
var TestKeyRSASizes = []int{1024, 2048, 4096}
View Source
var Version string

Version is set at link-time

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetStdinManager added in v0.3.3

func GetStdinManager() *stdinManager

func NewGSSAPIClient

func NewGSSAPIClient(addr string, tname string) *gssapiClient

func NewStdinManager

func NewStdinManager()

Types

type AnalysisStats

type AnalysisStats struct {
	PubKeyHalfAuthLimit map[string]map[uint64]struct{}
	InitialStage        map[string]map[uint64]struct{}
	HostKeyAlgos        map[string]map[uint64]struct{}
	KexAlgos            map[string]map[uint64]struct{}
	Versions            map[string]map[uint64]struct{}
	Ciphers             map[string]map[uint64]struct{}
	MACs                map[string]map[uint64]struct{}
	Compressions        map[string]map[uint64]struct{}
	AuthMethods         map[string]map[uint64]struct{}
	SessionMethods      map[string]map[uint64]struct{}
	SessionOutputs      map[string]map[uint64]struct{}
	HostKeys            map[string]map[uint64]struct{}
	KeyMap              map[string]uint64
	KeyMapRev           map[uint64]*string
	// contains filtered or unexported fields
}

func NewAnalysisStats

func NewAnalysisStats() *AnalysisStats

type FileModeHook

type FileModeHook struct {
	Writer    io.Writer
	LogLevels []logrus.Level
	Formatter logrus.Formatter
}

func (*FileModeHook) Fire

func (hook *FileModeHook) Fire(entry *logrus.Entry) error

func (*FileModeHook) Levels

func (hook *FileModeHook) Levels() []logrus.Level

type ScanConfig

type ScanConfig struct {
	EnabledChecks  map[string]struct{}
	Logger         *logrus.Logger
	OutputWriter   io.Writer
	TestKeyRSA1024 ssh.Signer
	TestKeyRSA2048 ssh.Signer
	TestKeyRSA4096 ssh.Signer
	TestKeyED25519 ssh.Signer
	BadKeyCache    *badkeys.Cache
	// contains filtered or unexported fields
}

func (*ScanConfig) AnalyzeResult

func (conf *ScanConfig) AnalyzeResult(res *auth.AuthResult, stats *AnalysisStats) error

func (*ScanConfig) GetAllHostKeys

func (conf *ScanConfig) GetAllHostKeys(addr string, options *auth.Options, root *auth.AuthResult, cached *auth.AuthResult)

func (*ScanConfig) GetSession

func (conf *ScanConfig) GetSession(addr string, options *auth.Options, cached *auth.AuthResult) (root *auth.AuthResult)

GetSession runs through all potential checks that can lead to a session

func (*ScanConfig) InteractCommand

func (conf *ScanConfig) InteractCommand(addr string, data []byte, ses *ssh.Session, sclient *ssh.Client, state *interactSessionState, shell io.WriteCloser) (bool, error)

func (*ScanConfig) InteractHandler

func (conf *ScanConfig) InteractHandler(addr string, options *auth.Options, root *auth.AuthResult) auth.SessionHandler

func (*ScanConfig) InteractRelay

func (conf *ScanConfig) InteractRelay(addr string, quit chan bool, shell io.WriteCloser, sclient *ssh.Client, ses *ssh.Session, state *interactSessionState)

func (*ScanConfig) InteractShowHelp

func (conf *ScanConfig) InteractShowHelp(addr string)

func (*ScanConfig) IsCheckEnabled

func (conf *ScanConfig) IsCheckEnabled(check string) bool

func (*ScanConfig) ScanHost

func (conf *ScanConfig) ScanHost(options *auth.Options, cached *auth.AuthResult) *auth.AuthResult

func (*ScanConfig) ScanTarget

func (conf *ScanConfig) ScanTarget(ch chan *auth.Options, wg *sync.WaitGroup, statTargetsDone *atomic.Uint64)

func (*ScanConfig) StartInteract

func (conf *ScanConfig) StartInteract(addr string, options *auth.Options, root *auth.AuthResult) error

func (*ScanConfig) TestSession

func (conf *ScanConfig) TestSession(addr string, options *auth.Options, root *auth.AuthResult)

TestSession tries to gain further access through a SSH session

func (*ScanConfig) WriteOutput

func (conf *ScanConfig) WriteOutput(res *auth.AuthResult)

type SessionOutputWriter

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

func NewSessionOutputWriter

func NewSessionOutputWriter(w io.Writer) *SessionOutputWriter

func (*SessionOutputWriter) Write

func (w *SessionOutputWriter) Write(p []byte) (int, error)

type TerminalModeHook

type TerminalModeHook struct {
	Writer    io.Writer
	LogLevels []logrus.Level
	Formatter logrus.Formatter
}

func (*TerminalModeHook) Fire

func (hook *TerminalModeHook) Fire(entry *logrus.Entry) error

func (*TerminalModeHook) Levels

func (hook *TerminalModeHook) Levels() []logrus.Level

Jump to

Keyboard shortcuts

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