OpenrelikWorkerCommon.PasswordUtils (openrelik_worker_common v0.1.0)

Copy Markdown View Source

Helper functions for password hash cracking (openrelik_worker_common.password_utils).

Summary

Functions

bruteforce_password_hashes(password_hashes, tmp_dir, password_list_file_path, password_rules_file_path, timeout_or_opts \\ 300, extra_args \\ "", opts \\ [])

@spec bruteforce_password_hashes(
  [String.t()],
  String.t() | nil,
  String.t(),
  String.t(),
  pos_integer() | keyword(),
  String.t(),
  keyword()
) :: [{String.t(), String.t()}]

Bruteforces password hashes using Hashcat or John the Ripper (john).

Parameters

  • password_hashes - List of password hashes as strings.
  • tmp_dir - Path to use as a temporary directory.
  • password_list_file_path - Path to the password list file.
  • password_rules_file_path - Path to the password rules file.
  • timeout - Number of seconds to run before terminating the process (default 300).
  • extra_args - Any extra arguments to be passed to Hashcat (default "").
  • opts - Optional keyword overrides for testing (:which_fn, :cmd_runner, :pot_file, :fallback_password_list).

Returns

List of {password_hash, plaintext} tuples.

Raises

RuntimeError if execution fails or required tools/wordlists are unavailable.