cracker

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var ErrHashcatBinaryNotFound = errors.New("hashcat binary not found")

ErrHashcatBinaryNotFound indicates the hashcat binary could not be located.

Functions

func CheckForExistingClient

func CheckForExistingClient(pidFilePath string) bool

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

func ExtractHashcatArchive(ctx context.Context, newArchivePath string) (string, error)

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

func FindHashcatBinary() (string, error)

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

func GetCurrentHashcatVersion(ctx context.Context) (string, error)

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

func MoveArchiveFile(tempArchivePath string) (string, error)

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.

Jump to

Keyboard shortcuts

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