| Crates.io | binhards |
| lib.rs | binhards |
| version | 0.1.0 |
| created_at | 2025-07-25 03:01:07.195745+00 |
| updated_at | 2025-07-25 03:01:07.195745+00 |
| description | A CLI tool to inspect compiled binaries (ELF, PE, Mach-O) for security mitigations and insecure patterns. |
| homepage | https://github.com/100percentibrahim/binhards |
| repository | https://github.com/100percentibrahim/binhards |
| max_upload_size | |
| id | 1767143 |
| size | 42,139 |
A CLI tool to inspect compiled binaries (ELF, PE, Mach-O) for security mitigations and insecure patterns.
The Binary Hardening Scanner is a developer-facing security tool designed to inspect compiled binaries for critical security mitigations and insecure coding patterns. It directly addresses the common issue of typos or omissions in compiler flags that can silently disable essential protections.
This tool helps developers and security engineers:
gets, strcpy) that could lead to vulnerabilities.The scanner operates on the final compiled binary, making it language-agnostic and suitable for any development workflow.
__chk variants)gets, strcpy, etc.)git clone https://github.com/100percentibrahim/binhards.git
cd binhards
cargo build --release
The binary will be available at target/release/binhards.
cargo install binhards
After building:
# Analyze a binary
./target/release/binhards /path/to/binary
# Get JSON output for CI/CD
./target/release/binhards --json /path/to/binary
# Verbose output
./target/release/binhards --verbose /path/to/binary
# Analyze a Linux ELF binary
binhards /bin/ls
# Analyze a Windows PE binary (on Windows or with Wine)
binhards myapp.exe
# Analyze a macOS Mach-O binary (on macOS)
binhards /Applications/MyApp.app/Contents/MacOS/MyApp
# In a CI script, fail if critical mitigations are missing
if ! binhards --json myapp | jq -e '.nx.enabled == true and .pie.enabled == true' > /dev/null; then
echo "Critical security mitigations are missing!"
exit 1
fi
BinHardS Scanner Report
File: /bin/ls
Format: ELF
Security Mitigations:
NX (No-eXecute): ENABLED
Note: Stack is marked as non-executable
PIE (Position Independent Executable): ENABLED
Note: Binary is position independent (PIE enabled)
Stack Canary: ENABLED
Note: Stack canaries detected: __stack_chk_fail
RELRO (RELocation Read-Only): FULL
Note: Full RELRO: GOT is read-only after relocation
Fortified Functions:
Fortified functions detected: 5
Unprotected functions detected: 0
Detailed documentation is available in the project repository:
For information on how security mitigations work, see:
We welcome contributions from the community!
cargo testcargo buildcargo run -- /path/to/binaryPlease open an issue first to discuss significant changes.
Planned enhancements:
See GitHub Issues for current development tasks and enhancements.
We take security seriously. If you discover a security vulnerability within this project, please follow our Security Policy to report it responsibly.
hello@ibrahimstudio.comThis project is licensed under the MIT License.