meatballs i wanted meatballs god damn it

This commit is contained in:
2026-05-23 13:25:01 -06:00
parent eebdba57ec
commit 4ce18be210
2 changed files with 350 additions and 8 deletions
+11 -8
View File
@@ -104,17 +104,17 @@ audit_passphrase() {
if [[ -z "$raw_password" ]]; then
echo "[ERROR] No passphrase provided for validation." >&2
return 2
exit 2
fi
if [[ -z "$check_password" ]]; then
echo "[ERROR] No check passphrase provided for validation." >&2
return 2
exit 2
fi
if [[ "$raw_password" != "$check_password" ]]; then
echo "[ERROR] Passphrases do not match!" >&2
return 2
exit 2
fi
unset check_password
@@ -125,7 +125,7 @@ audit_passphrase() {
local pass_len="${#raw_password}"
if [ "$pass_len" -lt 35 ]; then
echo "❌ REJECTED: Passphrase is too short ($pass_len characters). Minimum length required is 35."
return 1
exit 1
fi
echo "[PASS] Length verification satisfied ($pass_len characters)."
@@ -135,14 +135,15 @@ audit_passphrase() {
# cracklib-check reads from stdin and outputs 'password: status'
# If secure, the status string reads "OK"
if ! command -v cracklib-check &> /dev/null; then
echo "[WARN] cracklib-check binary not found. Skipping dictionary audit." >&2
echo "[ERROR] cracklib-check binary not found. Skipping dictionary audit." >&2
exit 1
else
local cracklib_result
cracklib_result=$(echo "$raw_password" | cracklib-check | cut -d':' -f2 | xargs)
if [[ "$cracklib_result" != "OK" ]]; then
echo "❌ REJECTED by cracklib-check: $cracklib_result"
return 1
exit 1
fi
echo "[PASS] Local dictionary and structural complexity audit clear."
fi
@@ -160,7 +161,7 @@ audit_passphrase() {
if ! response=$(curl -s -H "User-Agent: Bash-Passphrase-Audit-Script" "$api_url"); then
echo "[FATAL] Failed to communicate with HIBP API." >&2
return 3
exit 3
fi
local match
@@ -170,13 +171,15 @@ audit_passphrase() {
local pwn_count
pwn_count=$(echo "$match" | cut -d':' -f2 | tr -d $'\r')
echo "❌ VULNERABLE: This passphrase has appeared in $pwn_count known public breaches."
return 1
exit 1
else
echo "✅ SUCCESS: Passphrase meets all local criteria and was not found in HIBP records."
return 0
fi
}
audit_passphrase "it was always you who i despised, redd fPGuXrWrP9WBWbW1xhSTwgBD :3" "it was always you who i despised, redd fPGuXrWrP9WBWbW1xhSTwgBD :3"
exit_cleanup() {
reset