This repository creates educational binary executables with intentionally hardcoded secrets for the OWASP WrongSecrets project. These binaries are used in CTF (Capture The Flag) challenges to teach security professionals about reverse engineering and binary analysis.
- Primary Goal: Generate cross-platform binaries with embedded secrets for security education
- Target Audience: Security professionals, CTF participants, reverse engineering students
- Supported Platforms: Linux (x64/ARM), macOS (Intel/ARM), Windows (x64), Musl Linux
- Output: Static executables that can be analyzed to discover hardcoded secrets
c/- C implementations with basic, advanced, and challenge52 variantscplus/- C++ implementationsgolang/- Go implementations with CLI structurerust/- Rust implementations with Cargo workspacedotnet/- .NET/C# implementationsswift/- Swift implementations
generate_ctf_secrets.sh- Generates randomized secrets for CTF versionsquickbuild.sh- Local multi-platform build script (requires macOS with GCC)test_ctf_generation.sh- Tests CTF secret generation functionality.pre-commit-config.yaml- Automated code formatting configuration
- Install pre-commit hooks:
pip install pre-commit && pre-commit install - Test basic compilation:
gcc c/main.c -o test-binary - Check existing workflows: Review
.github/workflows/for language-specific builds
- Rust: Automatically formatted with
cargo fmtvia pre-commit - Go: Automatically formatted with
gofmtvia pre-commit +go mod tidy - C/C++: Follow existing style, no automatic formatting configured
- All code: Must pass pre-commit hooks before committing
- Local builds: Use appropriate language tools (make, cargo build, go build, dotnet build)
- Cross-platform: Use
quickbuild.sh(macOS) or GitHub Actions - CTF testing: Run
./test_ctf_generation.shto verify CTF secret generation - CI/CD: Each language has dedicated GitHub Actions workflow
- By Design: Hardcoded secrets are INTENTIONAL - this is educational software
- Secret Formats: Regular secrets use descriptive text, CTF secrets use format
this is the secret in <language> : <random_hex> - Never: Remove or "fix" the intentional vulnerabilities - they're the educational content
- CTF Generation: Use the provided script to generate randomized secrets for competitions
- Keep hardcoded secrets clearly educational (not real credentials)
- Maintain consistent secret formats across languages
- Preserve the ability to analyze binaries with common reverse engineering tools
- Document any new secret hiding techniques for educational purposes
# Build basic version
cd c && make
# Build with custom flags
cd c && make CFLAGS+='-target x86_64-apple-macos12'
# Build advanced version
cd c/advanced && make# Format code (required before commit)
cargo fmt
# Build all targets
cargo build --release
# Run tests
cargo test# Format code (required before commit)
gofmt -w .
go mod tidy
# Build binary
go build -o wrongsecrets-go
# Test compilation
go build ./...# Build solution
dotnet build
# Publish for specific runtime
dotnet publish -r linux-x64 --self-contained
# Run tests (if present)
dotnet testThe repository uses dockcross for cross-compilation:
# Example ARM Linux compilation
./dockcross-linux-arm64-lts bash -c '$CC c/main.c -o target/wrongsecrets-c-linux-arm'- Linux x64/ARM64
- Windows x64 (static linking)
- macOS Intel/ARM
- Musl Linux (Alpine-compatible)
- Regular: Human-readable secrets like "This is a hardcoded secret in C"
- CTF: Randomized format: "this is the secret in c : a1b2c3d4e5f6"
# Generate CTF secrets (modifies source files)
./generate_ctf_secrets.sh generate
# Build CTF versions
# ... perform builds ...
# Restore original secrets
./generate_ctf_secrets.sh restore
# Test the entire process
./test_ctf_generation.sh# Install dependencies
pip install pre-commit
pre-commit install
# Format code
pre-commit run --all-files
# Test basic compilation
gcc c/main.c -o test-binary
cd rust && cargo build
cd golang && go build
# Generate and test CTF versions
./test_ctf_generation.sh- Create directory with source files containing hardcoded secrets
- Add GitHub Actions workflow in
.github/workflows/compile_<language>.yml - Update
generate_ctf_secrets.shto handle the new language's secret patterns - Add build commands to
quickbuild.sh - Test both regular and CTF compilation
- Build failures: Check GitHub Actions logs for specific platform issues
- Secret generation: Ensure backup files exist before running CTF generation
- Cross-compilation: Verify dockcross containers are available
- Pre-commit: Run
pre-commit run --all-filesto fix formatting issues
- Do NOT deploy these binaries in production environments
- Secrets are hardcoded by design - this is NOT a security bug
- The repository is for learning about binary analysis and reverse engineering
- Always restore original files after CTF generation testing