Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Hash & Token Analyzer

A comprehensive, professional-grade tool for identifying and analyzing hash formats, authentication tokens, and encoded data. Enhanced with Blackploit HashID detection patterns for superior accuracy and coverage.

Designed for penetration testers, red team operators, security researchers, and developers.

Python Version License Blackploit Enhanced GitHub Issues GitHub Stars

Features

Hash Detection & Analysis (Enhanced with Blackploit HashID)

  • 110+ Hash Algorithms: MD5, SHA variants (1/224/256/384/512), BLAKE2, bcrypt, scrypt, PBKDF2
  • Exotic Hash Support: Haval, RipeMD, Tiger, SNEFRU, Whirlpool, GOST R 34.11-94
  • Windows/Unix Formats: NTLM, LM, Unix crypt variants ($1$, $5$, $6$), DES(Unix)
  • Database Hashes: MySQL (old/new), PostgreSQL, Oracle formats
  • Application-Specific: phpBB3, Wordpress, Joomla, Django framework hashes
  • Gaming Hashes: Lineage II C4, MaNGOS variants
  • Advanced Pattern Recognition: Blackploit-style confidence ranking system
  • Multi-Algorithm Cracking: Tests against multiple hash algorithms simultaneously

Token & API Key Analysis

  • JWT (JSON Web Token): Complete parsing, security vulnerability detection, expiration checks
  • API Keys: GitHub, AWS, OpenAI, Slack, Google OAuth2 tokens
  • Session Tokens: Base64 encoded session data analysis
  • Security Assessment: Algorithm weakness detection, signature validation

Encoding & Decoding

  • Base64 Variants: Standard and URL-safe Base64 encoding
  • Character Encodings: Hex, URL encoding, HTML entities, Unicode escapes
  • XOR Analysis: Single-byte XOR key detection with meaningful text filtering
  • Nested Encoding: Multi-layer encoding detection and decoding

Cryptocurrency Support

  • Bitcoin: P2PKH, P2SH, and Bech32 address formats
  • Ethereum: Standard address validation
  • Altcoins: Litecoin, Dogecoin, Ripple, Monero addresses
  • Blockchain Integration: Ready for transaction history analysis

Advanced Analysis

  • Shannon Entropy: Randomness and pattern detection
  • Pattern Analysis: Repeating substrings, structural elements
  • Online Lookups: Integration with hash databases (respectful rate limiting)
  • Smart Recommendations: Context-aware security suggestions

Installation

Requirements

  • Python 3.7+
  • pip (Python package manager)

Basic Installation

git clone https://github.com/username/hash-token-analyzer.git
cd hash-token-analyzer
pip install -r requirements.txt

Optional Dependencies

# For enhanced JWT support
pip install PyJWT

# For bcrypt analysis
pip install bcrypt

# For advanced hash operations
pip install hashlib-compat

Usage

Command Line Interface

Single Hash/Token Analysis

# Analyze an MD5 hash
python hash_analyzer.py 5d41402abc4b2a76b9719d911017c592

# Analyze a JWT token
python hash_analyzer.py eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiYWRtaW4ifQ.signature

# Analyze with quiet output
python hash_analyzer.py -q 5d41402abc4b2a76b9719d911017c592

# Quick analysis (skip intensive operations)
python hash_analyzer.py --quick 5d41402abc4b2a76b9719d911017c592

Batch Analysis

# Analyze multiple hashes from file
python hash_analyzer.py --file hashes.txt

# Export batch results
python hash_analyzer.py --file hashes.txt --export json

Interactive Mode

# Interactive analysis session
python hash_analyzer.py --interactive

Export Results

# Export to JSON
python hash_analyzer.py <hash> --export json

# Export to CSV
python hash_analyzer.py <hash> --export csv --output my_analysis.csv

# Export to text report
python hash_analyzer.py <hash> --export txt

Python Library Usage

from hash_analyzer import HashTokenAnalyzer

# Initialize analyzer
analyzer = HashTokenAnalyzer("5d41402abc4b2a76b9719d911017c592")

# Run comprehensive analysis
analyzer.comprehensive_analysis()

# Access results
print(f"Detected formats: {analyzer.results['detected_formats']}")
print(f"Entropy: {analyzer.results['entropy']}")

# Export results
analyzer.export_results('json', 'my_analysis.json')

Output Examples

Enhanced Hash Analysis with Blackploit Ranking

[*] Analyzing input: 5d41402abc4b2a76b9719d911017c592
[*] Input length: 32 characters
[+] Detected potential formats: MD5, MD4, NTLM, Haval-128, Tiger-128...
[*] Shannon entropy: 3.480 bits
[*] Character frequency analysis:
  Digits: 23/32 (71.9%)
  Letters: 9/32 (28.1%)
  Symbols: 0/32 (0.0%)

Blackploit-style confidence ranking:
  Most likely: MD5
  Alternative: MD4  
  Less likely: NTLM, Domain Cached Credentials, Haval-128
[!!!] Password found using MD5: 'hello'

JWT Analysis

[*] JWT Analysis - Algorithm: HS256, Type: JWT
[!] WARNING: Token expired on 2024-01-01T00:00:00
[*] Payload: {'user': 'admin', 'exp': 1704067200}

Cryptocurrency Address

[+] Detected potential formats: Bitcoin Address (P2PKH/P2SH)
[*] Recommendations: Cryptocurrency address detected - check blockchain explorers

Security Features

Responsible Disclosure

  • Rate Limited: Online lookups use respectful rate limiting
  • Privacy Focused: No data logging or external transmission without consent
  • Defensive Only: Designed for legitimate security testing

Security Checks

  • JWT algorithm validation (detects none algorithm attacks)
  • Token expiration verification
  • Weak algorithm detection
  • Entropy-based randomness assessment

Advanced Features

Pattern Recognition

  • Detects repeating substrings and structural patterns
  • Identifies low-entropy data suggesting weak randomness
  • Character frequency analysis for anomaly detection

Multi-Format Detection

  • Simultaneous analysis across multiple potential formats
  • Context-aware recommendations based on detected types
  • Nested encoding detection (Base64 within URL encoding, etc.)

Extensible Architecture

  • Modular design for easy addition of new hash types
  • Plugin-style pattern detection system
  • Configurable analysis depth and timeout settings

File Formats

Input File Format (for --file option)

# Comments start with #
5d41402abc4b2a76b9719d911017c592
098f6bcd4621d373cade4e832627b4f6
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiYWRtaW4ifQ.signature
1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2

Export Formats

  • JSON: Complete analysis results with metadata
  • CSV: Tabular format for spreadsheet analysis
  • TXT: Human-readable report format

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

git clone https://github.com/username/hash-token-analyzer.git
cd hash-token-analyzer
python -m venv venv
source venv/bin/activate  # On Windows: venv\\Scripts\\activate
pip install -r requirements-dev.txt

Running Tests

python -m pytest tests/
python -m pytest --cov=hash_analyzer tests/

Known Issues

  • NTLM cracking requires additional dependencies on some systems
  • Online lookups may timeout with poor network connectivity
  • Large batch files (>10MB) may require increased memory

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This tool is intended for legitimate security testing and educational purposes only. Users are responsible for ensuring they have proper authorization before analyzing any data. The authors are not responsible for any misuse of this software.

Acknowledgments

  • Hash algorithm implementations from Python's hashlib library
  • JWT specification from RFC 7519
  • Cryptocurrency address formats from respective blockchain documentation
  • Security research community for vulnerability patterns and recommendations

Support

Stats

GitHub Contributors GitHub Last Commit GitHub Repo Size


Full credit to Blackploit HashID project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages