Documentation
¶
Overview ¶
Package cracker provides hashcat binary management and process control utilities. It handles binary discovery, version checking, process lifecycle management, and archive extraction for distributed agent environments.
Index ¶
- Variables
- func CheckForExistingClient(pidFilePath string) bool
- func CreateDataDirs() error
- func CreateLockFile() error
- func ExtractHashcatArchive(ctx context.Context, newArchivePath string) (string, error)
- func FindHashcatBinary() (string, error)
- func GetCurrentHashcatVersion(ctx context.Context) (string, error)
- func MoveArchiveFile(tempArchivePath string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ErrHashcatBinaryNotFound = errors.New("hashcat binary not found")
ErrHashcatBinaryNotFound indicates the hashcat binary could not be located.
Functions ¶
func CheckForExistingClient ¶
CheckForExistingClient checks if a hashcat process is already running. It reads the PID file and verifies if the process is still active. Returns true if a running process is found or if errors occur during checks.
func CreateDataDirs ¶
func CreateDataDirs() error
CreateDataDirs creates all required data directories for the agent. It ensures each configured directory path exists, creating it if necessary. Returns an error if any directory creation fails.
func CreateLockFile ¶
func CreateLockFile() error
CreateLockFile creates a lock file containing the current process ID. This is used to prevent multiple hashcat instances from running simultaneously. Returns an error if the file cannot be written.
func ExtractHashcatArchive ¶
ExtractHashcatArchive extracts a new hashcat archive with backup management. It removes any previous backup, backs up the current installation, and extracts the new archive. Returns the path to the newly extracted hashcat directory.
func FindHashcatBinary ¶
FindHashcatBinary searches for the hashcat binary in multiple locations. It checks configuration paths, installation directories, and the system PATH. Returns the path to the first executable binary found, or an error if none exist.
func GetCurrentHashcatVersion ¶
GetCurrentHashcatVersion retrieves the version string of the installed hashcat binary. It first locates the binary, then queries it for version information. Returns an empty version string if the binary cannot be found or queried.
func MoveArchiveFile ¶
MoveArchiveFile moves a temporary archive file to its final location. It relocates the archive to the crackers path with a standard name. Returns the new path or an error if the move fails.
Types ¶
This section is empty.