package common import ( "context" "time" ) // TargetInfo SMB目标信息 type TargetInfo struct { Host string Port int Domain string } // Credential SMB认证凭据 type Credential struct { Username string Password string Hash []byte IsHash bool } // ConnectionResult 连接结果 type ConnectionResult struct { Success bool Shares []string HasAdminAccess bool Error error } // ScanConfig 扫描配置 type ScanConfig struct { MaxConcurrent int Timeout time.Duration GlobalTimeout time.Duration } // SmbConnector SMB连接器接口 type SmbConnector interface { // Connect 建立SMB连接并进行认证 Connect(ctx context.Context, target *TargetInfo, cred *Credential) (*ConnectionResult, error) // GetProtocolName 获取协议名称 GetProtocolName() string // GetDefaultPort 获取默认端口 GetDefaultPort() int } // CredentialManager 凭据管理器接口 type CredentialManager interface { // GenerateCredentials 生成认证凭据列表 GenerateCredentials() []Credential // HandleAuthFailure 处理认证失败 HandleAuthFailure(username string, err error) // IsUserLocked 检查用户是否被锁定 IsUserLocked(username string) bool // GetCredentialCount 获取凭据总数 GetCredentialCount() int } // ScanResult 扫描结果 type ScanResult struct { Success bool Credential Credential Shares []string Error error } // Scanner 并发扫描器接口 type Scanner interface { // Scan 执行并发扫描 Scan(ctx context.Context, target *TargetInfo, connector SmbConnector, credMgr CredentialManager, config *ScanConfig) (*ScanResult, error) }