Select multiple hashfiles during job creation, combined into a new hashfile
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 399
- Forks
- 52
- Avg merge
- 21h 39m
- Merged PRs (30d)
- 79
Description
Summary
During job creation, the "Use existing" hashfile picker only allows selecting a
single hashfile at a time. Allow selecting multiple existing hashfiles and
combine their hashes into one new auto-named hashfile for the job.
Motivation
Operators frequently accumulate hashes across several uploads (e.g. per-host
pwdumps, staged captures) and want to crack them together in one job. Today the
only workaround is manually merging files outside Hashview and re-uploading,
which loses the per-source hashfiles and duplicates data.
Current behavior
- UI: single-select radio per row
hashview/templates/jobs_assigned_hashfiles.html.j2:238<input type="radio" name="hashfile_id" value="{{ hashfile.id }}" ...> - Route: reads one
hashfile_idand assigns it directly to the job
hashview/jobs/routes.py:434-438elif request.method == 'POST' and request.form.get('hashfile_id'): job.hashfile_id = request.form['hashfile_id'] - A job references exactly one
Hashfiles.id; there is no notion of combining files.
Proposed behavior
- Change the "Use existing" picker from radio to checkboxes so multiple
hashfiles can be selected. - On submit with 2+ selections, create a new
Hashfilesrecord and populate it
by unioning theHashfileHashesrows of the selected files, then assign it as
the job'shashfile_id. - Name is auto-generated (e.g.
combined-<timestamp>or derived from the
source names) to avoid collisions — the user does not name it. - Single selection keeps today's behavior (assign existing
hashfile_id
directly, no new record).
Constraints
- Mixed-customer combining is blocked. The job-creation flow is already
scoped to a single customer, so the "Use existing" list only shows that
customer's hashfiles — combining across customers is not reachable in the
current UI and must remain so. The combinedHashfilesrecord inherits that
singlecustomer_id.
Deduplication
Hash dedup infrastructure already exists and should be reused:
import_hash_only()dedupes by(hash_type, MD5(ciphertext))
(hashview/utils/utils.py:544-555).HashfileHashesis already many-to-many, so one hash can belong to the
combined file and its sources.
Combining should produce a distinct set ofhash_ids (respectingusername
where present) — no duplicateHashfileHashesrows in the combined file.
No schema changes
The combined hashfile is a normal saved Hashfiles record — no new columns and
no Alembic migration needed. Jobs still references a single hashfile_id.
Affected files
hashview/templates/jobs_assigned_hashfiles.html.j2hashview/jobs/routes.py(jobs_assigned_hashfile)hashview/utils/utils.py(newcombine_hashfiles()helper)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in hashview/templates/jobs_assigned_hashfiles.html.j2 and hashview/jobs/routes.py at the picker and POST handling, then read import_hash_only() in hashview/utils/utils.py and the HashfileHashes relationships. Confirm how selected hash IDs, usernames, customer IDs, and auto-generated names should be represented; done means single selections still assign directly and multiple selections create one deduplicated combined Hashfiles record assigned to the job.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, python
- Domain
- backend, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100