-
Notifications
You must be signed in to change notification settings - Fork 246
1477 enhancement add hashtypes included by hashcat 7 #1481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
s3inlc
merged 12 commits into
dev
from
1477-enhancement-add-hashtypes-included-by-hashcat-7
Aug 20, 2025
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ff28599
Fixes bug in update script when there is still old 'type' name in age…
6f2f1f7
Added new hashcat7 hashing algorithms to update script (still have to…
8e74bed
Removed accidentely added hashtypes
3499e6a
Added slow hash and salted to update script
9ec53fa
Added new hashtypes to install script
854303c
Added script that automaticcaly generates update scripts for new hash…
87aa54b
Make it possible for admin users to always see objects, regardless of…
adc3989
update-hashes.py now understand new format
b1811b7
Added hashtypes added in Hashcat 7.1.1
df1cb1a
Fixed salt of newly added hashtypes
81fdfe8
Fixed review suggestions
a8b0bf5
Fixed wrong indentation
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| import requests | ||
| import subprocess | ||
| import json | ||
| import sys | ||
| import os | ||
| import re | ||
|
|
||
|
|
||
| class HashType: | ||
| def __init__(self, hashType, description, salted, slowHash): | ||
| self.hashType = hashType | ||
| self.description = description | ||
| self.salted = salted | ||
| self.slowHash = slowHash | ||
|
|
||
|
|
||
| url = "https://raw.githubusercontent.com/hashcat/hashcat/refs/tags/v7.1.1/docs/hashcat-example-hashes.md" | ||
| binary = sys.argv[1] # The hashcat binary is the first argument | ||
| if not os.path.isfile(binary): | ||
| print("usage: python3 update-hashes.py <hashcat binary>") | ||
| args = [binary, "-m", "PLACEHOLDER", "--exam", "--machine-readable", "--quiet"] | ||
| new_hashtypes = [] | ||
|
|
||
| response = requests.get(url) | ||
| response.raise_for_status() | ||
|
|
||
| lines = response.text.splitlines() | ||
|
|
||
| auth_uri = 'http://localhost:8080/api/v2/auth/token' | ||
| auth = ("admin", "hashtopolis") # default credentials | ||
| r = requests.post(auth_uri, auth=auth) | ||
| token = r.json()["token"] | ||
|
|
||
| headers = { | ||
| 'Authorization': 'Bearer ' + token | ||
| } | ||
| url = "http://localhost:8080/api/v2/ui/hashtypes/" | ||
| print("Retrieving hashes from db please wait...") | ||
|
|
||
| for line in lines[4:]: # skip first 4 header lines | ||
| splitted = line.split("|") | ||
| if len(splitted) == 1: # table is finished | ||
| break | ||
| hashType = re.search(r"\[`?(\d+)`?\]", splitted[1]).group(1) | ||
| description = splitted[2].strip().split("`")[1] | ||
| print(description) | ||
| r = requests.get(url + hashType, headers=headers) | ||
| if (r.status_code != 200): | ||
| args[2] = hashType | ||
| hashcat_output = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) | ||
| data = json.loads(hashcat_output.stdout) | ||
| slow_hash = data[hashType]["slow_hash"] | ||
| salted = data[hashType]["is_salted"] | ||
| new_hashtypes.append(HashType(hashType, description, salted, slow_hash)) | ||
| print("Finished retrieving hashes!") | ||
|
|
||
| print("Add the following to the update script:") | ||
| print('if (!isset($PRESENT["PLACEHOLDER"])){') | ||
| print(" $hashTypes = [") | ||
| for hashType in new_hashtypes: | ||
| print(f' new HashType( {hashType.hashType}, "{hashType.description}", {int(hashType.salted)}, {int(hashType.slowHash)}),') | ||
| print(" ];") | ||
| print(' foreach ($hashtypes as $hashtype) {') | ||
| print(' $check = Factory::getHashTypeFactory()->get($hashtype->getId());') | ||
| print(' if ($check === null) {') | ||
| print(' Factory::getHashTypeFactory()->save($hashtype);') | ||
| print(' }') | ||
| print(' }') | ||
| print(' $EXECUTED["PLACEHOLDER"] = true;') | ||
| print('}') | ||
|
|
||
| print("Add the following to the install script:") | ||
| for hashType in new_hashtypes: | ||
| print(f" ({hashType.hashType}, '{hashType.description}', {int(hashType.salted)}, {int(hashType.slowHash)}),") | ||
|
|
||
|
|
||
| print("Dont forgot to check if all hashtypes where salted = '1', are actually salted in a way that Hashtopolis understands!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.