feat(pcfg): add pcfg_attack and prince_ling_attack handlers in attacks.py

This commit is contained in:
Justin Bollinger
2026-05-04 09:09:39 -04:00
parent 8d575f0bb2
commit 7173af241e
2 changed files with 32 additions and 0 deletions
+10
View File
@@ -400,6 +400,16 @@ def prince_attack(ctx: Any) -> None:
ctx.hcatPrince(ctx.hcatHashType, ctx.hcatHashFile)
def pcfg_attack(ctx: Any) -> None:
_notify.prompt_notify_for_attack("PCFG")
ctx.hcatPCFG(ctx.hcatHashType, ctx.hcatHashFile)
def prince_ling_attack(ctx: Any) -> None:
_notify.prompt_notify_for_attack("PRINCE-LING")
ctx.hcatPrinceLing(ctx.hcatHashType, ctx.hcatHashFile)
def yolo_combination(ctx: Any) -> None:
_notify.prompt_notify_for_attack("YOLO Combination")
ctx.hcatYoloCombination(ctx.hcatHashType, ctx.hcatHashFile)
+22
View File
@@ -0,0 +1,22 @@
from unittest.mock import MagicMock
from hate_crack.attacks import pcfg_attack, prince_ling_attack
def _make_ctx(hash_type: str = "1000", hash_file: str = "/tmp/hashes.txt") -> MagicMock:
ctx = MagicMock()
ctx.hcatHashType = hash_type
ctx.hcatHashFile = hash_file
return ctx
def test_pcfg_attack_invokes_hcatPCFG():
ctx = _make_ctx()
pcfg_attack(ctx)
ctx.hcatPCFG.assert_called_once_with("1000", "/tmp/hashes.txt")
def test_prince_ling_attack_invokes_hcatPrinceLing():
ctx = _make_ctx()
prince_ling_attack(ctx)
ctx.hcatPrinceLing.assert_called_once_with("1000", "/tmp/hashes.txt")