Skip to content

Added association of hashtypes to cracker binaries - #2503

Open
s3inlc wants to merge 13 commits into
886-stack-3-background-jobsfrom
886-stack-4-hashtype-assoc
Open

s3inlc wants to merge 13 commits into
886-stack-3-background-jobsfrom
886-stack-4-hashtype-assoc

Conversation

@s3inlc

@s3inlc s3inlc commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Adds support for defining which hash types each cracker binary can process.

Hashcat binaries are associated with all available hash types automatically, including hash types added later. Other cracker types start without associations, allowing users to explicitly configure only the hash types they support.

Supported hash types can be viewed and managed through the cracker binary API. The reverse relationship is also visible on each hash type, making it possible to determine which cracker binaries support it.

Associations are kept consistent when cracker binaries or hash types are deleted.

NOTE: the edit relations part for crackers which are of binary 'hashcat' is only "temporary", in the next stack PR, this will be superseded by automation. This will then only be used for generic crackers.

@s3inlc
s3inlc added this pull request to stack #2501 September 18, 2026 07:46
@s3inlc
s3inlc force-pushed the 886-stack-4-hashtype-assoc branch 5 times, most recently from 5013534 to 6b133ce Compare September 22, 2026 13:53
@s3inlc
s3inlc requested a review from jessevz September 22, 2026 14:20
@s3inlc
s3inlc marked this pull request as ready for review September 22, 2026 14:20
@s3inlc
s3inlc force-pushed the 886-stack-4-hashtype-assoc branch from 6b133ce to 58d78f3 Compare September 23, 2026 07:29
@s3inlc
s3inlc force-pushed the 886-stack-4-hashtype-assoc branch from 58d78f3 to 5a88abe Compare September 23, 2026 08:22
@s3inlc
s3inlc force-pushed the 886-stack-4-hashtype-assoc branch 2 times, most recently from 9fbffb7 to 7fd3fa1 Compare September 23, 2026 09:43
@s3inlc
s3inlc force-pushed the 886-stack-4-hashtype-assoc branch from 7fd3fa1 to aaa91ce Compare September 23, 2026 11:48
@s3inlc
s3inlc force-pushed the 886-stack-4-hashtype-assoc branch from aaa91ce to d03cdbf Compare September 23, 2026 13:03
@s3inlc
s3inlc force-pushed the 886-stack-4-hashtype-assoc branch from d03cdbf to 0f2f787 Compare September 23, 2026 13:56
@s3inlc
s3inlc requested a lite review from Copilot September 23, 2026 14:08

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

Unresolved critical access-control, data-integrity, and API contract issues remain.

Get a fresh assessment by requesting another Copilot review.

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

Open (9)
What changed in this PR

Adds cracker-binary/hash-type associations, automatic hashcat linking, API management, lifecycle cleanup, OpenAPI updates, and tests.

Changes:

  • Adds association schemas, models, factories, and backfill logic.
  • Exposes bidirectional API relationships.
  • Adds lifecycle handling, documentation, and test coverage.
File Summary
src/​migrations/​postgres/​20260918091600_cracker-binary-hashtypes.sql PostgreSQL association schema and backfill
src/​migrations/​mysql/​20260918091600_cracker-binary-hashtypes.sql MySQL association schema and backfill
src/​inc/​utils/​HashtypeUtils.php Hash-type association lifecycle
src/​inc/​utils/​CrackerUtils.php Binary association management and cleanup
src/​inc/​startup/​setup.php Initial hashcat association backfill
src/​inc/​apiv2/​model/​HashTypeAPI.php Reverse relationship API
src/​inc/​apiv2/​model/​CrackerBinaryAPI.php Editable hashtype relationship API
src/​inc/​apiv2/​common/​AbstractBaseAPI.php Factory and permission registration
src/​dba/​models/​generator.php Association model metadata
src/​dba/​models/​CrackerBinaryHashtypeFactory.php Association factory
src/​dba/​models/​CrackerBinaryHashtype.php Association model
src/​dba/​Factory.php Factory registration
openapi.json Generated API specification
ci/​phpunit/​TestBase.php Association test cleanup
ci/​phpunit/​inc/​utils/​HashtypeUtilsTest.php Hash-type lifecycle tests
ci/​phpunit/​inc/​utils/​CrackerUtilsTest.php Binary association tests
ci/​phpunit/​inc/​apiv2/​openapi/​SpecBuilderModelApiTest.php OpenAPI relationship fixture coverage
ci/​phpunit/​fixtures/​openapi/​hashtype.spec.json Hash-type OpenAPI fixture
ci/​apiv2/​test_hashtype.py Reverse relationship tests
ci/​apiv2/​test_cracker.py Cracker relationship API 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/apiv2/model/CrackerBinaryAPI.php
Comment thread src/inc/apiv2/model/CrackerBinaryAPI.php
Comment thread src/inc/apiv2/model/HashTypeAPI.php
Comment thread src/migrations/mysql/20260918091600_cracker-binary-hashtypes.sql Outdated
Comment thread src/migrations/postgres/20260918091600_cracker-binary-hashtypes.sql
Comment thread openapi.json Outdated
Comment thread openapi.json
Comment thread openapi.json Outdated
Comment thread openapi.json Outdated
@s3inlc
s3inlc force-pushed the 886-stack-4-hashtype-assoc branch from c5712e8 to 23994f1 Compare September 30, 2026 14:03
CREATE TABLE `CrackerBinaryHashtype` (
`crackerBinaryHashtypeId` int NOT NULL AUTO_INCREMENT,
`crackerBinaryId` int NOT NULL,
`hashTypeId` int NOT NULL,

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.

Not 100% sure, but it could perhaps help to put an index on hashtype id, because a frequent search path would be 'select * where hashtypeid = ? innerjoin crackerbinary', since on the task page, we want to load all crackerbinaries that can crack this hashtype, which has to change evrytime a new hashtype is selected. Maybe we also need a helper endpoint to optimise the query if the default tomany relation ship endpoint is not good enough to use the index

@s3inlc
s3inlc force-pushed the 886-stack-4-hashtype-assoc branch from 23994f1 to a14443c Compare October 1, 2026 06:45
@s3inlc
s3inlc force-pushed the 886-stack-4-hashtype-assoc branch from a14443c to e98feac Compare October 1, 2026 12:59
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