refactor: rename Markov LLM attack to Ollama attack and simplify interface

Rename markov_attack → ollama_attack and hcatMarkov → hcatOllama across
menu, attacks, and tests. Remove candidate count prompts and cracked-output
default wordlist logic. Rename config keys (markov* → ollama*) and drop
ollamaUrl. Fix Dockerfile.test to use granular build steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Justin Bollinger
2026-02-13 19:17:50 -05:00
parent 2cb54beecb
commit 88d786d9aa
5 changed files with 14 additions and 27 deletions

View File

@@ -19,7 +19,7 @@ RUN python -m pip install -q uv==0.9.28
COPY . /workspace
RUN make install
RUN make submodules vendor-assets && uv tool install . && make clean-vendor
ENV PATH="${HOME}/.local/bin:${PATH}"
ENV HATE_CRACK_SKIP_INIT=1

View File

@@ -23,8 +23,7 @@
"hashview_url": "http://localhost:8443",
"hashview_api_key": "",
"hashmob_api_key": "",
"ollamaUrl": "http://localhost:11434",
"ollamaModel": "llama3.2",
"markovCandidateCount": 5000,
"markovWordlist": "rockyou.txt"
"ollamaCandidateCount": 5000,
"ollamaWordlist": "rockyou.txt"
}

View File

@@ -83,7 +83,7 @@ def get_main_menu_options():
"12": _attacks.thorough_combinator,
"13": _attacks.bandrel_method,
"14": _attacks.loopback_attack,
"15": _attacks.markov_attack,
"15": _attacks.ollama_attack,
"90": download_hashmob_rules,
"91": weakpass_wordlist_menu,
"92": download_hashmob_wordlists,

View File

@@ -488,20 +488,16 @@ def bandrel_method(ctx: Any) -> None:
ctx.hcatBandrel(ctx.hcatHashType, ctx.hcatHashFile)
def markov_attack(ctx: Any) -> None:
print("\n\tLLM Markov Attack")
def ollama_attack(ctx: Any) -> None:
print("\n\tLLM Attack")
print("\t(1) Wordlist-based generation")
print("\t(2) Target-based generation")
choice = input("\nSelect generation mode: ").strip()
if choice == "1":
cracked_output = ctx.hcatHashFile + ".out"
if os.path.isfile(cracked_output):
default_wl = cracked_output
else:
default_wl = ctx.markovWordlist
if isinstance(default_wl, list):
default_wl = default_wl[0] if default_wl else ""
default_wl = ctx.ollamaWordlist
if isinstance(default_wl, list):
default_wl = default_wl[0] if default_wl else ""
print(f"\nDefault wordlist: {default_wl}")
override = input("Use a different wordlist? [y/N]: ").strip().lower()
if override == "y":
@@ -509,29 +505,21 @@ def markov_attack(ctx: Any) -> None:
wordlist = ctx._resolve_wordlist_path(wordlist, ctx.hcatWordlists)
else:
wordlist = default_wl
count_input = input(
f"Number of candidates to generate [{ctx.markovCandidateCount}]: "
).strip()
count = int(count_input) if count_input else ctx.markovCandidateCount
ctx.hcatMarkov(
ctx.hcatHashType, ctx.hcatHashFile, "wordlist", wordlist, count
ctx.hcatOllama(
ctx.hcatHashType, ctx.hcatHashFile, "wordlist", wordlist
)
elif choice == "2":
company = input("Company name: ").strip()
industry = input("Industry: ").strip()
location = input("Location: ").strip()
count_input = input(
f"Number of candidates to generate [{ctx.markovCandidateCount}]: "
).strip()
count = int(count_input) if count_input else ctx.markovCandidateCount
target_info = {
"company": company,
"industry": industry,
"location": location,
}
ctx.hcatMarkov(
ctx.hcatHashType, ctx.hcatHashFile, "target", target_info, count
ctx.hcatOllama(
ctx.hcatHashType, ctx.hcatHashFile, "target", target_info
)
else:
print("Invalid selection.")

View File

@@ -25,7 +25,7 @@ MENU_OPTION_TEST_CASES = [
("12", CLI_MODULE._attacks, "thorough_combinator", "thorough"),
("13", CLI_MODULE._attacks, "bandrel_method", "bandrel"),
("14", CLI_MODULE._attacks, "loopback_attack", "loopback"),
("15", CLI_MODULE._attacks, "markov_attack", "markov"),
("15", CLI_MODULE._attacks, "ollama_attack", "ollama"),
("90", CLI_MODULE, "download_hashmob_rules", "hashmob-rules"),
("91", CLI_MODULE, "weakpass_wordlist_menu", "weakpass-menu"),
("92", CLI_MODULE, "download_hashmob_wordlists", "hashmob-wordlists"),