Skip to content

Scan hashcat automatically for hashtypes - #2505

Open
s3inlc wants to merge 23 commits into
886-stack-4-hashtype-assocfrom
886-stack-5-hashcat-scan
Open

s3inlc wants to merge 23 commits into
886-stack-4-hashtype-assocfrom
886-stack-5-hashcat-scan

Conversation

@s3inlc

@s3inlc s3inlc commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Adds automatic detection of the hash types supported by hashcat binaries.

When a hashcat binary is added or updated, a background scan reads its supported hash modes and updates its hash type associations accordingly. Re-scanning reflects changes between binary versions by adding newly supported modes and removing modes that are no longer available.

Hash modes that do not yet exist in Hashtopolis are created automatically using the name, salted status, and slow-hash information reported by hashcat. Existing hash types are left unchanged.

Because hashcat associations are determined by the binary itself, they cannot be edited manually. Other cracker types are not scanned and continue to support manually managed associations.

Existing hashcat binaries are queued for scanning during migration, and pending scan jobs are cleaned up when their associated binaries are deleted.

@s3inlc
s3inlc added this pull request to stack #2501 September 18, 2026 12:49
@s3inlc
s3inlc force-pushed the 886-stack-5-hashcat-scan branch 4 times, most recently from e269582 to 9d021d6 Compare September 22, 2026 13:03
@s3inlc
s3inlc force-pushed the 886-stack-5-hashcat-scan branch from 9d021d6 to c8a1918 Compare September 22, 2026 13:53
@s3inlc
s3inlc marked this pull request as ready for review September 22, 2026 14:28
@s3inlc
s3inlc requested a review from jessevz September 22, 2026 14:28
@s3inlc
s3inlc force-pushed the 886-stack-5-hashcat-scan branch from c8a1918 to 30163c7 Compare September 23, 2026 07:29
@s3inlc
s3inlc force-pushed the 886-stack-5-hashcat-scan branch 2 times, most recently from 535f20a to 8a04aec Compare September 23, 2026 09:13
@s3inlc
s3inlc force-pushed the 886-stack-5-hashcat-scan branch from 8a04aec to 025b5ae Compare September 23, 2026 09:43
@s3inlc
s3inlc force-pushed the 886-stack-5-hashcat-scan branch 2 times, most recently from 4b1373f to a6e187f Compare September 23, 2026 13:03
@s3inlc
s3inlc force-pushed the 886-stack-5-hashcat-scan branch 3 times, most recently from 68f0b48 to 44a6360 Compare September 24, 2026 10:00
@s3inlc
s3inlc requested a lite review from Copilot September 24, 2026 11:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Critical archive execution, path traversal, cleanup, and resource-safety issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 5 High severity · 5 Medium severity

Open (10)
What changed in this PR

Adds background scanning of hashcat binaries to detect supported hash modes and synchronize associations.

Changes:

  • Adds scan jobs, migration/startup seeding, and cleanup.
  • Extracts archives, executes binaries, parses modes, and updates associations.
  • Restricts manual hashcat edits and adds tests and Docker support.
File Description
src/​migrations/​postgres/​20260918091600_cracker-binary-hashtypes.sql Queues PostgreSQL scans.
src/​migrations/​mysql/​20260918091600_cracker-binary-hashtypes.sql Queues MySQL scans.
src/​inc/​utils/​HashtypeUtils.php Supports system-created hash types.
src/​inc/​utils/​CrackerUtils.php Manages scan jobs and associations.
src/​inc/​utils/​CrackerScanUtils.php Extracts archives and scans binaries.
src/​inc/​startup/​setup.php Queues initial scans.
src/​inc/​jobs/​handlers/​ScanCrackerJob.php Executes scan jobs.
src/​inc/​jobs/​BackgroundJobRegistry.php Registers the scan handler.
src/​inc/​handlers/​CrackerHandler.php Passes user context on updates.
src/​inc/​defines/​DBackgroundJobType.php Defines the scan job type.
src/​inc/​apiv2/​model/​CrackerBinaryAPI.php Restricts manual hashcat associations.
Dockerfile Installs 7-Zip.
ci/​phpunit/​inc/​utils/​HashtypeUtilsTest.php Updates hash type tests.
ci/​phpunit/​inc/​utils/​CrackerUtilsTest.php Tests scan queuing and synchronization.
ci/​phpunit/​inc/​utils/​CrackerScanUtilsTest.php Tests output parsing.
ci/​phpunit/​inc/​jobs/​ScanCrackerJobTest.php Tests scan execution.
ci/​phpunit/​fixtures/​crackerscan/​hashcat_example_hashes.json Provides parser fixture data.
ci/​apiv2/​utils.py Adjusts background-job cleanup.
ci/​apiv2/​test_cracker.py Adds API and scan tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/inc/jobs/handlers/ScanCrackerJob.php Outdated
Comment thread src/inc/jobs/handlers/ScanCrackerJob.php Outdated
Comment thread src/inc/utils/CrackerScanUtils.php Outdated
Comment thread src/inc/utils/CrackerScanUtils.php Outdated
Comment thread src/inc/utils/CrackerScanUtils.php
Comment thread src/inc/apiv2/model/CrackerBinaryAPI.php Outdated
Comment thread src/inc/startup/setup.php Outdated
Comment thread src/inc/utils/CrackerScanUtils.php
Comment thread src/inc/utils/CrackerScanUtils.php Outdated
Comment thread src/inc/utils/CrackerUtils.php
@s3inlc
s3inlc force-pushed the 886-stack-5-hashcat-scan branch from 826807a to 4151699 Compare October 1, 2026 06:45
s3inlc added 21 commits October 1, 2026 14:59
…atches the supported ones from the cracker binary
…ixed the missing hashtypes to fix inconsistency
… the currently actual hashcat release we ship with hashtopolis
@s3inlc
s3inlc force-pushed the 886-stack-5-hashcat-scan branch from 4c0e73d to 4c66bcf Compare October 1, 2026 12:59
@s3inlc
s3inlc requested a review from jessevz October 2, 2026 07:06
Comment thread src/inc/apiv2/model/HashTypeAPI.php Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants