Documentation
¶
Index ¶
- Constants
- Variables
- func CalcCombinations(userCh []string, passCh []string) int
- func CalcCombinationsCombo(userCh []string, passCh []string) int
- func CalcCombinationsPass(passCh []string) int
- func Contains(s []string, e string) bool
- func CopyReaderToFile(reader io.Reader, filePath string) error
- func CountCredentials(h *Host, user, password, combo, version string, isPasswordOnly bool) int
- func CountLinesInChunkedFile(cf *ChunkedFile) (int, error)
- func GetIPv4Address(ifaceName string) (net.IP, error)
- func GetPasswordsFromDefaultWordlist(version string, serviceType string) []string
- func GetUsersAndPasswords(h *Host, user string, password string, version string) ([]string, []string)
- func GetUsersAndPasswordsCombo(h *Host, combo string, version string) ([]string, []string)
- func GetUsersFromDefaultWordlist(version string, serviceType string) []string
- func IsFile(fileName string) bool
- func MapService(service string) string
- func ParseFile(filename string) (map[Host]int, error)
- func ParseGNMAP(filename string) (map[Host]int, error)
- func ParseJSON(filename string) (map[Host]int, error)
- func ParseList(filename string) (map[Host]int, error)
- func ParseNessus(filename string) (map[Host]int, error)
- func ParseNexpose(filename string) (map[Host]int, error)
- func ParseXML(filename string) (map[Host]int, error)
- func PrintComprehensiveSummary(outputDir string)
- func PrintResult(service string, host string, port int, user string, pass string, result bool, ...)
- func PrintSkipping(host string, service string, retries int, maxRetries int)
- func PrintSocksError(service string, err string)
- func PrintWarningBeta(service string)
- func PrintfColored(color pterm.Color, format string, args ...interface{})
- func PrintlnColored(color pterm.Color, msg string)
- func ReadLinesFromChunkedFile(cf *ChunkedFile, callback func(string) error) error
- func ReadPasswordsFromFile(filename string) ([]string, error)
- func ReadUsersFromFile(filename string) ([]string, error)
- func RecordAttempt(success bool)
- func RecordConnectionError(host string)
- func RecordError(isConnectionError bool)
- func RecordSuccess(service string, host string, port int, user string, password string, ...)
- func SetTotalHostsAndServices(hosts int, services int)
- func UpdateConcurrency(current int)
- func ValidateNetworkInterface(iface string) (string, error)
- func WriteToFile(service string, content string, port int, output string) error
- type ChunkIterator
- type ChunkedFile
- type ConnectionManager
- type CredentialIterator
- type Host
- type NessusHost
- type NessusItem
- type NessusReport
- type NexposeEndpoint
- type NexposeNode
- type NexposeService
- type NmapAddress
- type NmapHost
- type NmapPort
- type NmapRun
- type NmapService
- type NmapState
- type OutputStats
- type OutputStatsCopy
- type PerformanceMetricsdeprecated
- func (pm *PerformanceMetrics) GetAttemptsPerSecond() float64
- func (pm *PerformanceMetrics) GetMetrics() PerformanceMetrics
- func (pm *PerformanceMetrics) GetSuccessRate() float64
- func (pm *PerformanceMetrics) PrintPerformanceReport()
- func (pm *PerformanceMetrics) RecordAttempt(success bool, responseTime time.Duration)
- func (pm *PerformanceMetrics) RecordError(isConnectionError bool)
- func (pm *PerformanceMetrics) UpdateConcurrency(current int)
- type PerformanceOptimizer
- type SuccessResult
- type WordlistCache
Constants ¶
const DefaultScannerBufferSize = 64 * 1024 // 64 KB
DefaultScannerBufferSize is the initial buffer size for scanners
const FileChunkSize = 500 * 1024 * 1024
FileChunkSize defines the maximum size for password file chunks (in bytes) Default: 500 MB per chunk
const LargeFileThreshold = 1 * 1024 * 1024 * 1024
LargeFileThreshold defines the file size threshold for automatic chunking (in bytes) Default: 1 GB
const MaxLineLength = 1024 * 1024 // 1 MB
MaxLineLength is the maximum length of a single line in input files
Variables ¶
var DisableFileChunking = false
DisableFileChunking is a global flag to disable automatic file chunking
var InsecureTLS bool
InsecureTLS controls whether HTTPS/TLS verification is disabled for HTTP(S) modules
var LogEvery int64 = 1
LogEvery controls attempt logging frequency; 1 = log every attempt
var NAME_MAP = map[string]string{
"ms-sql-s": "mssql",
"microsoft-ds": "smbnt",
"cifs": "smbnt",
"postgresql": "postgres",
"smtps": "smtp",
"submission": "smtp",
"imaps": "imap",
"pop3s": "pop3",
"iss-realsecure": "vmauthd",
"snmptrap": "snmp",
"mysql": "mysql",
"vnc": "vnc",
"mongod": "mongodb",
"textui": "teamspeak",
"xmpp-client": "xmpp",
"ms-wbt-server": "rdp",
}
var NoColorMode bool
NoColorMode controls whether colored output is disabled
var Silent bool
Silent controls whether to suppress per-attempt logs (successes still printed)
var UseEmptyPassword bool
UseEmptyPassword instructs GetUsersAndPasswords to include a single empty string (blank password) when the password flag was explicitly provided as empty by the user (e.g., -p ”).
Functions ¶
func CalcCombinations ¶
func CalcCombinationsCombo ¶
func CalcCombinationsPass ¶
func CopyReaderToFile ¶
CopyReaderToFile copies data from reader to file efficiently
func CountCredentials ¶
CountCredentials counts total credentials without loading them all into memory
func CountLinesInChunkedFile ¶
func CountLinesInChunkedFile(cf *ChunkedFile) (int, error)
CountLinesInChunkedFile counts total lines across all chunks
func GetUsersAndPasswords ¶
func MapService ¶
func PrintComprehensiveSummary ¶
func PrintComprehensiveSummary(outputDir string)
PrintComprehensiveSummary prints a comprehensive summary report
func PrintResult ¶
func PrintResult(service string, host string, port int, user string, pass string, result bool, con_result bool, progressCh chan<- int, retrying bool, output string, delayTime time.Duration)
PrintResult prints individual results (legacy format for compatibility)
func PrintSkipping ¶
PrintSkipping prints host skipping messages
func PrintSocksError ¶
PrintSocksError prints SOCKS proxy errors
func PrintWarningBeta ¶
func PrintWarningBeta(service string)
PrintWarningBeta prints beta service warnings
func PrintfColored ¶
PrintfColored prints a formatted colored message
func PrintlnColored ¶
PrintlnColored prints a colored message with newline
func ReadLinesFromChunkedFile ¶
func ReadLinesFromChunkedFile(cf *ChunkedFile, callback func(string) error) error
ReadLinesFromChunkedFile reads all lines from chunked file (memory efficient)
func ReadPasswordsFromFile ¶
func ReadUsersFromFile ¶
func RecordAttempt ¶
func RecordAttempt(success bool)
RecordAttempt records any attempt (success or failure)
func RecordConnectionError ¶
func RecordConnectionError(host string)
RecordConnectionError records a connection error for a specific host
func RecordError ¶
func RecordError(isConnectionError bool)
RecordError records connection or authentication errors
func RecordSuccess ¶
func RecordSuccess(service string, host string, port int, user string, password string, duration time.Duration)
RecordSuccess records a successful credential attempt
func SetTotalHostsAndServices ¶
SetTotalHostsAndServices sets the total counts for hosts and services
func UpdateConcurrency ¶
func UpdateConcurrency(current int)
UpdateConcurrency updates concurrency metrics
Types ¶
type ChunkIterator ¶
type ChunkIterator struct {
// contains filtered or unexported fields
}
ChunkIterator provides sequential access to file chunks
func NewChunkIterator ¶
func NewChunkIterator(cf *ChunkedFile) *ChunkIterator
NewChunkIterator creates a new chunk iterator
func (*ChunkIterator) Close ¶
func (ci *ChunkIterator) Close() error
Close closes the current file and performs cleanup
type ChunkedFile ¶
type ChunkedFile struct {
OriginalPath string
ChunkPaths []string
TempDir string
ChunkSize int64
IsChunked bool
// contains filtered or unexported fields
}
ChunkedFile represents a large file that has been split into chunks
func NewChunkedFile ¶
func NewChunkedFile(filePath string) (*ChunkedFile, error)
NewChunkedFile creates a chunked file manager
func (*ChunkedFile) Cleanup ¶
func (cf *ChunkedFile) Cleanup() error
Cleanup removes temporary chunk files
func (*ChunkedFile) GetChunkPaths ¶
func (cf *ChunkedFile) GetChunkPaths() []string
GetChunkPaths returns the list of chunk file paths
type ConnectionManager ¶
type ConnectionManager struct {
Socks5 string
Timeout time.Duration
Iface string
LocalIP net.IP
Dialer proxy.Dialer
DialFunc func(network, address string) (net.Conn, error)
ConnPool map[string]chan net.Conn
PoolMutex sync.RWMutex
}
func NewConnectionManager ¶
func (*ConnectionManager) ClearPool ¶
func (cm *ConnectionManager) ClearPool()
func (*ConnectionManager) Dial ¶
func (cm *ConnectionManager) Dial(network, address string) (net.Conn, error)
func (*ConnectionManager) DialUDP ¶
func (cm *ConnectionManager) DialUDP(network, address string) (*net.UDPConn, error)
func (*ConnectionManager) Release ¶
func (cm *ConnectionManager) Release(conn net.Conn)
type CredentialIterator ¶
type CredentialIterator struct {
// contains filtered or unexported fields
}
CredentialIterator provides lazy/streaming credential generation to avoid loading entire wordlists into memory
func GetCredentialIterator ¶
func GetCredentialIterator(h *Host, user, password, combo, version string, isPasswordOnly bool) (*CredentialIterator, error)
GetCredentialIterator creates an iterator for streaming credentials
func NewCredentialIterator ¶
func NewCredentialIterator(host *Host, user, password, combo, version string, isPasswordOnly bool) (*CredentialIterator, error)
NewCredentialIterator creates a new credential iterator
func (*CredentialIterator) Close ¶
func (ci *CredentialIterator) Close() error
Close cleans up file handles
func (*CredentialIterator) Next ¶
func (ci *CredentialIterator) Next() (user, password string, ok bool)
Next returns the next credential, or false if done
type NessusHost ¶
type NessusHost struct {
Name string `xml:"name,attr"`
Items []NessusItem `xml:"ReportItem"`
}
type NessusItem ¶
type NessusReport ¶
type NessusReport struct {
Hosts []NessusHost `xml:"Report>ReportHost"`
}
type NexposeEndpoint ¶
type NexposeEndpoint struct {
Port string `xml:"port,attr"`
Status string `xml:"status,attr"`
Protocol string `xml:"protocol,attr"`
Service NexposeService `xml:"services>service"`
}
type NexposeNode ¶
type NexposeNode struct {
Address string `xml:"address,attr"`
Endpoints []NexposeEndpoint `xml:"endpoints>endpoint"`
}
type NexposeService ¶
type NexposeService struct {
Name string `xml:"name,attr"`
}
type NmapAddress ¶
type NmapHost ¶
type NmapHost struct {
Addresses []NmapAddress `xml:"address"`
Ports []NmapPort `xml:"ports>port"`
}
type NmapPort ¶
type NmapPort struct {
PortId string `xml:"portid,attr"`
Protocol string `xml:"protocol,attr"`
PortState NmapState `xml:"state"`
Service NmapService `xml:"service"`
}
type NmapService ¶
type NmapService struct {
Name string `xml:"name,attr"`
}
type OutputStats ¶
type OutputStats struct {
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
TotalAttempts int64 `json:"total_attempts"`
SuccessfulAttempts int64 `json:"successful_attempts"`
FailedAttempts int64 `json:"failed_attempts"`
ConnectionErrors int64 `json:"connection_errors"`
AuthenticationErrors int64 `json:"authentication_errors"`
SuccessRate float64 `json:"success_rate"`
AttemptsPerSecond float64 `json:"attempts_per_second"`
AverageResponseTime time.Duration `json:"average_response_time"`
PeakConcurrency int `json:"peak_concurrency"`
TotalHosts int `json:"total_hosts"`
TotalServices int `json:"total_services"`
SuccessfulResults []SuccessResult `json:"successful_results"`
ServiceBreakdown map[string]int `json:"service_breakdown"`
HostBreakdown map[string]int `json:"host_breakdown"`
ConnectionErrorHosts map[string]int `json:"connection_error_hosts"`
// contains filtered or unexported fields
}
OutputStats tracks comprehensive statistics for the bruteforce session
type OutputStatsCopy ¶
type OutputStatsCopy struct {
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
TotalAttempts int64 `json:"total_attempts"`
SuccessfulAttempts int64 `json:"successful_attempts"`
FailedAttempts int64 `json:"failed_attempts"`
ConnectionErrors int64 `json:"connection_errors"`
AuthenticationErrors int64 `json:"authentication_errors"`
SuccessRate float64 `json:"success_rate"`
AttemptsPerSecond float64 `json:"attempts_per_second"`
AverageResponseTime time.Duration `json:"average_response_time"`
PeakConcurrency int `json:"peak_concurrency"`
TotalHosts int `json:"total_hosts"`
TotalServices int `json:"total_services"`
SuccessfulResults []SuccessResult `json:"successful_results"`
ServiceBreakdown map[string]int `json:"service_breakdown"`
HostBreakdown map[string]int `json:"host_breakdown"`
ConnectionErrorHosts map[string]int `json:"connection_error_hosts"`
}
OutputStatsCopy is a copy of OutputStats without the mutex for safe copying
func CalculateFinalStats ¶
func CalculateFinalStats() OutputStatsCopy
CalculateFinalStats calculates final statistics
type PerformanceMetrics
deprecated
type PerformanceMetrics struct{}
Deprecated: PerformanceMetrics is superseded by OutputStats. Kept to avoid breaking imports. It now proxies to the OutputStats-based implementation.
func GetGlobalMetrics ¶
func GetGlobalMetrics() *PerformanceMetrics
GetGlobalMetrics returns the legacy-compatible metrics object.
func (*PerformanceMetrics) GetAttemptsPerSecond ¶
func (pm *PerformanceMetrics) GetAttemptsPerSecond() float64
func (*PerformanceMetrics) GetMetrics ¶
func (pm *PerformanceMetrics) GetMetrics() PerformanceMetrics
GetMetrics returns a snapshot emulating the old struct using OutputStatsCopy.
func (*PerformanceMetrics) GetSuccessRate ¶
func (pm *PerformanceMetrics) GetSuccessRate() float64
func (*PerformanceMetrics) PrintPerformanceReport ¶
func (pm *PerformanceMetrics) PrintPerformanceReport()
func (*PerformanceMetrics) RecordAttempt ¶
func (pm *PerformanceMetrics) RecordAttempt(success bool, responseTime time.Duration)
RecordAttempt proxies to the new stats system.
func (*PerformanceMetrics) RecordError ¶
func (pm *PerformanceMetrics) RecordError(isConnectionError bool)
RecordError proxies to the new stats system.
func (*PerformanceMetrics) UpdateConcurrency ¶
func (pm *PerformanceMetrics) UpdateConcurrency(current int)
UpdateConcurrency proxies to OutputStats peak concurrency tracking.
type PerformanceOptimizer ¶
type PerformanceOptimizer struct{}
PerformanceOptimizer now reads from OutputStats.
func NewPerformanceOptimizer ¶
func NewPerformanceOptimizer() *PerformanceOptimizer
func (*PerformanceOptimizer) GetOptimizationSuggestions ¶
func (po *PerformanceOptimizer) GetOptimizationSuggestions() []string
type SuccessResult ¶
type SuccessResult struct {
Service string `json:"service"`
Host string `json:"host"`
Port int `json:"port"`
User string `json:"user"`
Password string `json:"password"`
Time time.Time `json:"time"`
Duration string `json:"duration"`
}
SuccessResult represents a successful credential attempt
type WordlistCache ¶
type WordlistCache struct {
// contains filtered or unexported fields
}
WordlistCache provides thread-safe caching of wordlists
func (*WordlistCache) Set ¶
func (wc *WordlistCache) Set(key string, words []string)