Skip to content

Stegcracker

Stegcracker is a Python-based brute-force tool designed to crack steghide-encrypted images by testing passwords from wordlists in parallel.

Installation

Linux/Ubuntu

# Install via pip
pip install stegcracker

# Or clone from GitHub
git clone https://github.com/Paradoxis/StegCracker.git
cd StegCracker
pip install -r requirements.txt

Dependencies

# Requires steghide
sudo apt install steghide

# Requires Python 3.6+
python3 --version

Basic Commands

CommandDescription
stegcracker image.jpg wordlist.txtCrack image with wordlist
stegcracker image.jpg wordlist.txt -o output.txtSave output to file
stegcracker image.jpg wordlist.txt -t 4Use 4 threads
stegcracker --helpDisplay help information
stegcracker --versionShow version

Usage Examples

Basic Cracking

# Simple brute-force attack
stegcracker stego.jpg rockyou.txt

# With output file
stegcracker stego.jpg rockyou.txt -o results.txt

# Verbose output
stegcracker stego.jpg rockyou.txt -vv

Thread Control

# Single-threaded (more stable)
stegcracker image.jpg wordlist.txt -t 1

# Multi-threaded (faster)
stegcracker image.jpg wordlist.txt -t 8

# Maximum threads (default)
stegcracker image.jpg wordlist.txt -t 0

Wordlist Management

# Use common wordlists
stegcracker image.jpg /usr/share/wordlists/rockyou.txt

# Use rockyou.txt (top 100k)
head -100000 /usr/share/wordlists/rockyou.txt > common.txt
stegcracker image.jpg common.txt

# Generate custom wordlist with crunch
crunch 6 8 abcdefghijklmnopqrstuvwxyz0123456789 > custom.txt
stegcracker image.jpg custom.txt

# Pipe from custom generator
python3 -c "for i in range(1000, 9999): print(i)" | stegcracker image.jpg -

# Use multiple wordlists
cat wordlist1.txt wordlist2.txt | stegcracker image.jpg -

Attack Strategies

Dictionary Attack

# Standard wordlist attack
stegcracker suspicious.jpg /usr/share/wordlists/rockyou.txt

# Save extracted data on success
stegcracker image.jpg wordlist.txt -o extracted_data.txt

Brute-Force with Patterns

# Generate numeric passwords 1000-9999
seq 1000 9999 > numbers.txt
stegcracker image.jpg numbers.txt

# Generate alphabetic passwords (6-8 chars)
crunch 6 8 abcdefghijklmnopqrstuvwxyz > alpha.txt
stegcracker image.jpg alpha.txt

# Generate common patterns
python3 << 'EOF'
import itertools
chars = "abcdefghijklmnopqrstuvwxyz0123456789"
for length in range(6, 9):
    for combo in itertools.combinations_with_replacement(chars, length):
        print(''.join(combo))
EOF > patterns.txt
stegcracker image.jpg patterns.txt -t 8

Hybrid Attacks

# Use john the ripper wordlist transformations
john --wordlist=/usr/share/wordlists/rockyou.txt --stdout | stegcracker image.jpg -

# Generate variants with rules
stegcracker image.jpg wordlist.txt

# Try common passwords first
echo -e "password\n123456\nadmin\ntest\nqwerty" > common.txt
cat common.txt /usr/share/wordlists/rockyou.txt | stegcracker image.jpg -

Troubleshooting

Installation Issues

# Verify steghide is installed (required)
which steghide
steghide --version

# If missing, install steghide
sudo apt install steghide

# Verify Python 3
python3 --version

# Check pip installation
pip list | grep stegcracker

Performance Optimization

# Adjust thread count based on CPU cores
cat /proc/cpuinfo | grep processor | wc -l

# For 4-core system, use 4-8 threads
stegcracker image.jpg wordlist.txt -t 8

# For heavy CPU usage, reduce threads
stegcracker image.jpg wordlist.txt -t 2

# Monitor during attack
watch -n 1 'ps aux | grep steghide'

Success Indicators

# Successful crack shows:
# "Password found: 'yourpassword'"
# Extracted file is saved (usually extracted_*_from_*.txt)

# Check for output files
ls -la extracted_*

# Verify extraction succeeded
file extracted_image_from_stego.jpg

Failed Attacks

# If no password found:
# 1. Check wordlist quality
wc -l wordlist.txt

# 2. Verify image is steghide-encrypted
steghide info image.jpg

# 3. Try with larger wordlist
stegcracker image.jpg /usr/share/wordlists/rockyou.txt

# 4. Check CPU/memory availability
free -h
top -n 1

Integration

Scripting

#!/bin/bash
# Example script using stegcracker

set -euo pipefail

# Configuration
CONFIG_FILE="config.yaml"
LOG_FILE="stegcracker.log"

# Check if stegcracker is available
if ! command -v stegcracker &> /dev/null; then
    echo "Error: stegcracker is not installed" >&2
    exit 1
fi

# Function to log messages
log() \\\\{
    echo "$(date '+%Y-%m-%d %H:%M:%S') - $1"|tee -a "$LOG_FILE"
\\\\}

# Main operation
main() \\\\{
    log "Starting stegcracker operation"

    if stegcracker --config "$CONFIG_FILE" run; then
        log "Operation completed successfully"
        exit 0
    else
        log "Operation failed with exit code $?"
        exit 1
    fi
\\\\}

# Cleanup function
cleanup() \\\\{
    log "Cleaning up"
    stegcracker cleanup
\\\\}

# Set trap for cleanup
trap cleanup EXIT

# Run main function
main "$@"

API Integration

Environment Variables

VariableDescriptionDefault
STEGCRACKER_CONFIGConfiguration file path~/.stegcracker/config.yaml
STEGCRACKER_HOMEHome directory~/.stegcracker
STEGCRACKER_LOG_LEVELLogging levelINFO
STEGCRACKER_LOG_FILELog file path~/.stegcracker/logs/stegcracker.log
STEGCRACKER_CACHE_DIRCache directory~/.stegcracker/cache
STEGCRACKER_DATA_DIRData directory~/.stegcracker/data
STEGCRACKER_TIMEOUTDefault timeout30s
STEGCRACKER_MAX_WORKERSMaximum workers4

Configuration File

# ~/.stegcracker/config.yaml
version: "1.0"

# General settings
settings:
  debug: false
  verbose: false
  log_level: "INFO"
  log_file: "~/.stegcracker/logs/stegcracker.log"
  timeout: 30
  max_workers: 4

# Network configuration
network:
  host: "localhost"
  port: 8080
  ssl: true
  timeout: 30
  retries: 3

# Security settings
security:
  auth_required: true
  api_key: ""
  encryption: "AES256"
  verify_ssl: true

# Performance settings
performance:
  cache_enabled: true
  cache_size: "100M"
  cache_dir: "~/.stegcracker/cache"
  max_memory: "1G"

# Monitoring settings
monitoring:
  enabled: true
  interval: 60
  metrics_enabled: true
  alerts_enabled: true

Examples

Basic Workflow

# 1. Initialize stegcracker
stegcracker init

# 2. Configure basic settings
stegcracker config set port 8080

# 3. Start service
stegcracker start

# 4. Check status
stegcracker status

# 5. Perform operations
stegcracker run --target example.com

# 6. View results
stegcracker results

# 7. Stop service
stegcracker stop

Advanced Workflow

# Comprehensive operation with monitoring
stegcracker run \
  --config production.yaml \
  --parallel \
  --workers 8 \
  --verbose \
  --timeout 300 \
  --output json \
  --log-file operation.log

# Monitor in real-time
stegcracker monitor --real-time --interval 5

# Generate report
stegcracker report --type comprehensive --output report.html

Automation Example

#!/bin/bash
# Automated stegcracker workflow

# Configuration
TARGETS_FILE="targets.txt"
RESULTS_DIR="results/$(date +%Y-%m-%d)"
CONFIG_FILE="automation.yaml"

# Create results directory
mkdir -p "$RESULTS_DIR"

# Process each target
while IFS= read -r target; do
    echo "Processing $target..."

    stegcracker \
        --config "$CONFIG_FILE" \
        --output json \
        --output-file "$RESULTS_DIR/$\\\\{target\\\\}.json" \
        run "$target"

done < "$TARGETS_FILE"

# Generate summary report
stegcracker report summary \
    --input "$RESULTS_DIR/*.json" \
    --output "$RESULTS_DIR/summary.html"

Best Practices

Security

  • Always verify checksums when downloading binaries
  • Use strong authentication methods (API keys, certificates)
  • Regularly update to the latest version
  • Follow principle of least privilege
  • Enable audit logging for compliance
  • Use encrypted connections when possible
  • Validate all inputs and configurations
  • Implement proper access controls

Performance

  • Use appropriate resource limits for your environment
  • Monitor system performance regularly
  • Optimize configuration for your use case
  • Use parallel processing when beneficial
  • Implement proper caching strategies
  • Regular maintenance and cleanup
  • Profile performance bottlenecks
  • Use efficient algorithms and data structures

Operational

  • Maintain comprehensive documentation
  • Implement proper backup strategies
  • Use version control for configurations
  • Monitor and alert on critical metrics
  • Implement proper error handling
  • Use automation for repetitive tasks
  • Regular security audits and updates
  • Plan for disaster recovery

Development

  • Follow coding standards and conventions
  • Write comprehensive tests
  • Use continuous integration/deployment
  • Implement proper logging and monitoring
  • Document APIs and interfaces
  • Use version control effectively
  • Review code regularly
  • Maintain backward compatibility

Resources

Official Documentation

Community Resources

Learning Resources

  • Git - Complementary functionality
  • Docker - Alternative solution
  • Kubernetes - Integration partner

Last updated: 2025-07-06|Edit on GitHub