Gocrack
Gocrack is a distributed password cracking management framework for orchestrating GPU-accelerated hash cracking operations at scale. It provides REST API management, worker coordination, hashcat backend integration, and support for multiple attack methodologies (dictionary, mask, rules, hybrid).
Installation
# Install dependencies (Ubuntu/Debian)
sudo apt install git golang-go nvidia-cuda-toolkit
# Clone and build
git clone https://github.com/fireeye/gocrack
cd gocrack
make build
# Or use Docker
docker pull fireeye/gocrack:latest
docker run -d -p 8080:8080 -v /var/lib/gocrack:/opt/data fireeye/gocrack
Server Setup
Start API Server
# Basic server startup
./bin/gocrack server --listen 0.0.0.0:8080 --db-path /opt/gocrack/db
# With database persistence
./bin/gocrack server \
--listen 0.0.0.0:8080 \
--db-path /opt/gocrack/db \
--max-tasks 100
# Enable debug logging
./bin/gocrack server --listen 0.0.0.0:8080 --db-path /opt/gocrack/db --debug
Start Worker Nodes
# Basic GPU worker
./bin/gocrack worker \
--api-url http://server:8080 \
--gpu-type nvidia
# Multi-GPU worker
./bin/gocrack worker \
--api-url http://server:8080 \
--gpu-type nvidia \
--gpu-count 4
# With CPU fallback
./bin/gocrack worker \
--api-url http://server:8080 \
--gpu-type nvidia \
--enable-cpu \
--cpu-threads 8
Hash Type Support
| Hash Type | Hashcat Code | Example |
|---|---|---|
| MD5 | 0 | 5f4dcc3b5aa765d61d8327deb882cf99 |
| SHA-1 | 100 | e99a18c428cb38d5f260853678922e03 |
| SHA-256 | 1400 | d8e8fca2dc0f896fd7cb4cb0031ba249 |
| SHA-512 | 1700 | Long hash string |
| bcrypt | 3200 | $2a$12$hash... |
| NTLM | 1000 | Windows hash format |
| LM | 3000 | Legacy Windows |
| MySQL | 300 | mysqld password format |
| PostgreSQL | 12 | PostgreSQL hash |
| Oracle | 3100 | Oracle format |
| WPA/WPA2 | 22000 | WiFi handshake |
Task Management
Create Cracking Task
# Basic dictionary attack
curl -X POST http://localhost:8080/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"name": "MD5 Dictionary",
"hash_type": "md5",
"hashes_file": "hashes.txt",
"wordlist": "rockyou.txt",
"attack_mode": "dictionary"
}'
# Get task status
curl http://localhost:8080/api/v1/task/{task_id}
# Cancel task
curl -X DELETE http://localhost:8080/api/v1/task/{task_id}
# Get results
curl http://localhost:8080/api/v1/task/{task_id}/results
Prepare Hash File
# Create hash file with newline-separated hashes
cat > hashes.txt << 'EOF'
5f4dcc3b5aa765d61d8327deb882cf99
e99a18c428cb38d5f260853678922e03
d8e8fca2dc0f896fd7cb4cb0031ba249
EOF
# Upload to Gocrack
curl -F "file=@hashes.txt" http://localhost:8080/api/v1/task/upload
Attack Methods
Dictionary Attack
# Basic dictionary attack
curl -X POST http://localhost:8080/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"name": "Dictionary Attack",
"hash_type": "md5",
"hashes_file": "hashes.txt",
"wordlist": "rockyou.txt",
"attack_mode": "dictionary"
}'
# Multiple wordlists
curl -X POST http://localhost:8080/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"name": "Multi-Wordlist",
"hash_type": "md5",
"hashes_file": "hashes.txt",
"wordlists": ["rockyou.txt", "passwords.txt", "common.txt"],
"attack_mode": "dictionary"
}'
Mask Attack (Pattern-Based)
# Mask attack for pattern cracking
curl -X POST http://localhost:8080/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"name": "Mask Attack",
"hash_type": "md5",
"hashes_file": "hashes.txt",
"attack_mode": "mask",
"mask": "?u?l?l?d?d?d",
"increment": true
}'
# Mask character sets reference
# ?l = lowercase a-z
# ?u = uppercase A-Z
# ?d = digit 0-9
# ?s = special !@#$%^&*()
# ?a = all characters
# ?h = hex 0-9a-f
Combination Attack
# Combine two wordlists
curl -X POST http://localhost:8080/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"name": "Combination Attack",
"hash_type": "md5",
"hashes_file": "hashes.txt",
"attack_mode": "combination",
"wordlist1": "passwords.txt",
"wordlist2": "usernames.txt"
}'
Hybrid Attack (Dictionary + Mask)
# Hybrid attack
curl -X POST http://localhost:8080/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"name": "Hybrid Attack",
"hash_type": "md5",
"hashes_file": "hashes.txt",
"attack_mode": "hybrid",
"wordlist": "passwords.txt",
"mask": "?d?d?d?d",
"dictionary_first": true
}'
Rule-Based Cracking
Apply Hashcat Rules
# Run with rules
curl -X POST http://localhost:8080/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"name": "Rules Attack",
"hash_type": "md5",
"hashes_file": "hashes.txt",
"wordlist": "passwords.txt",
"attack_mode": "rules",
"rules_file": "best64.rule"
}'
# Common hashcat rule files
# best64.rule - 64 best rules
# d3ad0ne.rule - D3ad0ne set
# dive.rule - Dive rules
# facebook.rule - Facebook patterns
Custom Rules
# Create custom rule file
cat > custom.rule << 'EOF'
# Capitalize first letter
c
# Append numbers
$0 $1 $2 $3
# Append special chars
$! $@ $#
# Duplicate word
d
# Reverse
r
EOF
# Apply custom rules
curl -X POST http://localhost:8080/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"rules_file": "custom.rule",
"wordlist": "base.txt"
}'
GPU Optimization
Configure GPU Settings
# Set GPU utilization
./bin/gocrack worker \
--gpu-type nvidia \
--gpu-utilization 100 \
--workload-profile 4
# Check GPU status
nvidia-smi
# Workload profiles
# 1 = Low (laptop)
# 2 = Default
# 3 = High
# 4 = Maximum (needs cooling)
Multi-GPU Coordination
# Specify multiple GPUs
./bin/gocrack worker \
--api-url http://server:8080 \
--gpu-type nvidia \
--gpu-devices 0,1,2,3
# Use specific GPU device
./bin/gocrack worker \
--api-url http://server:8080 \
--gpu-device 0
Monitoring Progress
Task Status
# Get task progress
curl http://localhost:8080/api/v1/task/{task_id}/status
# Monitor worker status
curl http://localhost:8080/api/v1/workers
# Get cracking speed
curl http://localhost:8080/api/v1/task/{task_id}/speed
# Estimate completion time
curl http://localhost:8080/api/v1/task/{task_id}/eta
# Export results
curl http://localhost:8080/api/v1/task/{task_id}/results -o cracked.txt
Real-World Workflow
Complete Cracking Job
#!/bin/bash
# Setup and execute password cracking task
SERVER="http://localhost:8080"
HASHES_FILE="captured_hashes.txt"
WORDLIST="rockyou.txt"
HASH_TYPE="md5"
# 1. Create task
TASK_ID=$(curl -s -X POST "$SERVER/api/v1/task" \
-H "Content-Type: application/json" \
-d "{
\"name\": \"Captured Hashes\",
\"hash_type\": \"$HASH_TYPE\",
\"hashes_file\": \"$HASHES_FILE\",
\"wordlist\": \"$WORDLIST\"
}" | jq -r '.task_id')
echo "[+] Created task: $TASK_ID"
# 2. Monitor progress
while true; do
STATUS=$(curl -s "$SERVER/api/v1/task/$TASK_ID/status")
PROGRESS=$(echo "$STATUS" | jq -r '.progress')
CRACKED=$(echo "$STATUS" | jq -r '.cracked')
echo "[*] Progress: $PROGRESS% - Cracked: $CRACKED"
if [ "$PROGRESS" == "100" ]; then
break
fi
sleep 5
done
# 3. Export results
curl -s "$SERVER/api/v1/task/$TASK_ID/results" > cracked_passwords.txt
echo "[+] Cracking complete"
echo "[+] Results saved to cracked_passwords.txt"
Batch Processing Multiple Hash Types
#!/bin/bash
# Process multiple hash files
for hashtype in md5 sha1 sha256; do
echo "[*] Processing $hashtype hashes..."
TASK_ID=$(curl -s -X POST http://localhost:8080/api/v1/task \
-H "Content-Type: application/json" \
-d "{
\"name\": \"${hashtype}_crack\",
\"hash_type\": \"$hashtype\",
\"hashes_file\": \"${hashtype}_hashes.txt\",
\"wordlist\": \"rockyou.txt\"
}" | jq -r '.task_id')
echo "[+] Created task: $TASK_ID for $hashtype"
done
Best Practices
- Store hashes securely during processing
- Use unique salt values for new passwords
- Implement rate limiting on cracking operations
- Monitor GPU temperature during operation
- Use queue management for resource allocation
- Document all cracking attempts
- Securely delete intermediate files
- Test wordlists before large deployments
- Verify cracked passwords against original hashes
References
Last updated: 2026-03-30