Skip to content
Back to skills

Hashing And Fingerprinting Files

ASecurity

'Computes cryptographic and fuzzy fingerprints for malware samples: MD5/SHA-1/SHA-256

  • 22 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 11, 2026
securitypythonrustbashgitapisecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add meltedinhex/analyst-ai-pack --skill hashing-and-fingerprinting-files --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Hashing And Fingerprinting Files?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Hashing And Fingerprinting Files
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/meltedinhex-hashing-and-fingerprinting-files/badge)](https://www.skillsdirectory.com/skills/meltedinhex-hashing-and-fingerprinting-files)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: hashing-and-fingerprinting-files
description: 'Computes cryptographic and fuzzy fingerprints for malware samples: MD5/SHA-1/SHA-256
  for exact identity, plus import hashing (imphash), section hashing, and fuzzy hashes (ssdeep,
  TLSH) to cluster related variants. Activates for requests to hash a sample, compute imphash,
  or fingerprint files for similarity clustering.'
domain: cybersecurity
subdomain: lab-foundations
tags:
  - lab-foundations
  - hashing
  - fingerprinting
  - imphash
  - fuzzy-hashing
  - clustering
version: 1.0.0
author: analyst-ai-pack
license: Apache-2.0
mitre_attack:
  - T1027
d3fend:
  - D3-FH
references:
  - 'ssdeep fuzzy hashing — https://ssdeep-project.github.io/ssdeep/'
  - 'TLSH locality-sensitive hashing — https://github.com/trendmicro/tlsh'
---

# Hashing and Fingerprinting Files

## When to Use

- You need a stable identity for a sample to look up, deduplicate, or share as an IOC.
- You want to cluster related variants that differ slightly using fuzzy/similarity hashes.
- You are computing imphash or section hashes to pivot across a malware family.

**Do not use** cryptographic hashes alone to judge similarity — a single byte change yields a
completely different SHA-256; use fuzzy/import hashing for relatedness.

## Prerequisites

- Python with `hashlib` (stdlib); optionally `ssdeep`/`python-tlsh` for fuzzy hashes and
  `pefile` for imphash.
- Samples handled in the isolated lab per the safe-handling skill.

## Safety & Handling

- Treat every sample as live: never execute it during hashing; operate on the inert file only.
- Store samples encrypted/password-protected and reference them by hash, not by original name.

## Workflow

### Step 1: Compute cryptographic hashes

Generate MD5, SHA-1, and SHA-256. SHA-256 is the canonical identity for sharing; MD5/SHA-1 aid
lookups in legacy feeds.

```bash
python scripts/analyst.py hash sample.bin
```

### Step 2: Compute structural hashes (PE)

For PE files, compute imphash (hash of the import table) and per-section hashes to pivot across
samples built from the same toolchain.

### Step 3: Compute fuzzy/similarity hashes

Generate ssdeep and/or TLSH digests so near-duplicates can be matched even when bytes differ.

### Step 4: Record and cross-reference

Store all digests with the sample metadata; query threat-intel feeds by SHA-256 and cluster by
imphash/fuzzy hash.

## Validation

- The same input always yields identical cryptographic hashes (deterministic).
- Imphash matches across known-related samples; fuzzy hashes score high similarity for variants.
- Digests are recorded alongside sample metadata for later pivoting.

## Pitfalls

- Treating MD5 collisions as identity proof; use SHA-256 as canonical.
- Assuming different cryptographic hashes mean unrelated files; check fuzzy/import hashes.
- Computing imphash on packed samples (imports are stubbed) and over-trusting the result.

## References

- See [`references/api-reference.md`](references/api-reference.md) for the hashing helper.
- ssdeep and TLSH (linked in frontmatter).

Files in this skill

  • LICENSE340 B
  • SKILL.md3 KB
  • references/api-reference.md1.3 KB
  • scripts/analyst.py2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.