Design and Architecture
Binary checks
Security hardening, third-party libraries and dangerous imports of your compiled ELF and PE files.
Overview
Binary Insights reads the compiled program, not the source. It answers the questions an attacker asks first: is the file protected against memory-corruption exploits, which third-party libraries are inside it, which dangerous functions does it import, and does it contain secrets or weak cryptography.
It works on ELF (Linux, embedded) and PE (Windows) files: executables, shared libraries (.so, .dll) and firmware images. Managed .NET assemblies are only checked for signature. Mach-O is not supported yet.
Quick start
- Open Settings > Binary Analysis.
- Press Add a file... or Add a folder... and choose the executables and libraries you ship. A folder is scanned for binaries.
- Leave Analyse the binaries when the analysis runs on and run the analysis.
- Open Binary Insights > Binary Overview to read the result.
Settings
Page Settings > Binary Analysis. Saved in the project file (.cdproj), element BinarySettings.
| Setting | Default | Effect |
|---|---|---|
| Analyse the binaries when the analysis runs | On | Switches the whole check on or off (attribute Enabled). |
| Report issues | On | Each failed check becomes an issue of the tool Binary (attribute ReportIssues). Switch off to keep only the page. |
| Binary files | empty | Files to analyse (Files / File). |
| Binary folders | empty | Folders to scan for ELF and PE files (Folders / Folder). |
What is checked
Hardening
For every file the page shows a matrix of protections. A green cell means the protection is present, a red one that it is missing, a grey one that it does not apply to this format.
| Protection | Formats | Why it matters |
|---|---|---|
| ASLR / PIE, high-entropy ASLR | ELF, PE | The program is loaded at a random address, so exploits cannot rely on fixed addresses. |
| NX / DEP | ELF, PE | Data and the stack cannot be executed. |
| Stack protector (canary) | ELF, PE (/GS) | A stack overflow is detected before the function returns. |
| RELRO (full) | ELF | The global offset table is read-only after start-up. |
| Control Flow Guard, CET / BTI | PE, ELF | Indirect calls and returns are validated. |
| SafeSEH | PE 32-bit | Protects the exception handler chain. |
| Text relocations, embedded library path (RPATH/RUNPATH) | ELF | Code patched at load time; library search path inside the file. |
| Writable and executable memory | ELF, PE | Memory where injected code could run. |
| Packed or encrypted code | ELF, PE | High-entropy sections typical of packers. |
Content
- Third-party components: the version banner of well-known libraries, compared with maintained versions (see below).
- Unsafe imports: functions with a safer replacement (
gets,strcpy,strcat,sprintf,vsprintf,wcscpy,lstrcpy,mktemp,tmpnam,scanf,system...). The severity depends on the function. - Hard-coded secrets: keys, tokens and passwords found in the strings. Only the kind and place are kept, never the value.
- Weak cryptography: references to MD5, SHA-1, DES, RC4, RC2, ECB mode, SSLv2/v3, TLS 1.0 and predictable random generators. The page shows whether a strong crypto library is present as well.
- Risky Windows API: combinations of process injection, remote-thread creation, file download, debug privilege and Run-key APIs, with anti-debug and downloader groups.
- Unsafe DLL search order:
LoadLibrarywith a bare name, which searches the current folder.
Libraries recognised inside a binary
The version is read from the banner each library embeds, or from the name of the shared library it ships as.
| Library | Found from |
|---|---|
| OpenSSL | OpenSSL 1.1.1k banner |
| zlib | deflate / inflate copyright line |
| libpng | libpng version |
| libcurl | libcurl/x.y.z |
| SQLite | version and timestamp string |
| expat | expat_x.y.z |
| mbed TLS | mbed TLS x.y.z |
| libssh2 | libssh2_x.y.z |
| libtiff | LIBTIFF, Version |
| bzip2 | Version 1.0.x, date |
| Boost | libboost_*.so.x.y.z or boost_*-vc* names |
| Qt | libQt5Core.so.x.y.z / Qt6 |
| ICU | libicuuc.so.x.y |
| Lua | $LuaVersion / copyright line |
These components are the ones passed to Vulnerability checks.
Rules and how to fix
Each finding is an issue with a rule id. Severity can be raised or lowered by the cell state (for example RELRO is Medium when missing and Low when partial).
| Rule | Severity | What it means | How to fix |
|---|---|---|---|
BIN-ASLR-01 | Medium | No ASLR / PIE The program is loaded at a fixed address, so an attacker knows where the code is and exploits become reliable. | GCC/Clang: compile with -fPIE and link executables with -pie (-fPIC for shared libraries). MSVC: link with /DYNAMICBASE. Then rebuild every object, not only the final link. |
BIN-ASLR-02 | Low | No high-entropy ASLR On 64-bit Windows a small random range makes the address easier to guess. | MSVC: link with /HIGHENTROPYVA together with /DYNAMICBASE (the image must not need addresses below 4 GB). |
BIN-DEP-01 | High | No NX / DEP Data and the stack can be executed, so injected code runs directly. | Linux: remove -z execstack and give every assembly file a .note.GNU-stack section (.section .note.GNU-stack,"",@progbits). Windows: link with /NXCOMPAT. |
BIN-STACK-01 | Medium | No stack protector A stack buffer overflow can overwrite the return address without being detected. | GCC/Clang: -fstack-protector-strong. MSVC: /GS (on by default: check that no file is compiled with /GS-). |
BIN-RELRO-01 | Medium | RELRO is not full The global offset table stays writable, so a memory bug can redirect function calls. | Link with -Wl,-z,relro,-z,now (full RELRO). |
BIN-CFG-01 | Low | No Control Flow Guard Indirect calls are not validated, so a corrupted function pointer can jump anywhere. | MSVC: compile with /guard:cf and link with /GUARD:CF. |
BIN-SEH-01 | Low | No SafeSEH A corrupted exception handler chain can be used to take control (32-bit). | MSVC: link with /SAFESEH, or build with only DYNAMICBASE and no SEH handlers outside the image. |
BIN-TEXTREL-01 | Medium | Text relocations The code is patched at load time: it cannot be shared and the code pages must be writable. | Build all objects with -fPIC, and replace absolute addresses in assembly with PC-relative ones. |
BIN-RPATH-01 | Low | Embedded library path A library search path inside the binary can load a planted library from a writable folder. | Remove -rpath / RUNPATH, or use $ORIGIN with a folder only the installer can write. |
BIN-CRYPTO-01 | Medium | Weak cryptography Broken or obsolete algorithms (MD5, SHA-1, DES, RC4, ECB mode, SSLv3, TLS 1.0) let an attacker forge data, read protected data or downgrade a connection; predictable random numbers (rand) make keys and tokens guessable. | Use SHA-256 or SHA-3 for hashes, AES-GCM or ChaCha20-Poly1305 for encryption, TLS 1.2 or 1.3 only, and a cryptographic random source (getrandom, /dev/urandom, BCryptGenRandom, RAND_bytes) for anything secret. If the algorithm is only needed to read old data, keep it out of new data and document it. |
BIN-WINAPI-01 | Medium | Risky Windows API Process injection, file download, debug privilege or Run-key APIs are the building blocks of malware and of post-exploitation tools. Legitimate programs (debuggers, installers, updaters, security software) use them too, so this is a question to answer, not always a bug. | Confirm each use is intended. Remove injection APIs from normal applications, download over HTTPS and verify a signature before running anything, request privileges only when needed, and keep persistence under user control. |
BIN-DLLSEARCH-01 | Medium | Unsafe DLL search order LoadLibrary with a bare name searches several folders, including the current one. An attacker who can drop a DLL there gets code execution, and with administrator rights if the program runs elevated. | Call SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_DEFAULT_DIRS) at start-up, load with full paths or LOAD_LIBRARY_SEARCH_SYSTEM32, link with /DEPENDENTLOADFLAG:0x800, and never run elevated from a user-writable folder. |
BIN-UNSAFE-01 | High | Unsafe functions These functions do not check the size of the destination, a classic source of buffer overflows and command injection. | Replace each function by its bounded version (see the list). |
BIN-WX-01 | Medium | Writable and executable memory Memory that can be written and executed is where injected code runs. | Separate code and data in the linker script (no RWX region), do not link with -N / --omagic, and avoid self-modifying code or JIT pages that stay writable. |
BIN-PACK-01 | Medium | Packed or encrypted code A code section with a random-looking content is typical of a packer or an encrypted payload, and hides what the program does. | Check that the build is the one you expect (compare with a clean build). If a protector is intended, document it and accept the finding. |
BIN-CET-01 | Low | No CET / BTI protection Without shadow stack and branch tracking, return-oriented attacks are easier. | x86: -fcf-protection=full. AArch64: -mbranch-protection=standard. Windows: link with /CETCOMPAT. |
BIN-SECRET-01 | High | Hard-coded secret A key or password inside the file is readable by anyone who has the binary. | Remove it from the source, revoke and rotate the exposed secret now, and load secrets at run time from the environment or a secret store. |
BIN-COMP-01 | Medium | Outdated third-party component The version string of a library shows a release with known vulnerabilities or without support. | Upgrade the library to a maintained version, rebuild, and confirm the result in Dependencies & SBOM. |
Where to see results
- Binary Insights > Binary Overview: summary, hardening matrix per file, libraries, unsafe imports, secrets, weak cryptography, risky APIs and the fix for each rule.
- Issues: the tool name is Binary; they follow the usual issue filters and baseline.
- File on disk:
<analysis result>.binary.json, next to the analysis result (plain JSON, read by the page).
How it works
During the analysis each listed file is opened read-only and parsed (ELF headers, program and dynamic sections, PE optional header, DLL characteristics, imports, sections). The printable strings are scanned once for banners, secrets, crypto names and API names; the results are written to the sidecar file and, if Report issues is on, appended to the issue list. The page only reads the sidecar, so it opens instantly and works without the binaries present.
Limits
- Mach-O files are not analysed. .NET assemblies: signature only.
- Banners must be present in the file; a stripped or custom-built library may not be recognised.
- String-based checks can report false positives (a string that mentions an algorithm without using it).
- The tool reports what is in the files you list; it does not know how they were built or deployed.
Questions
The page is empty.
No file or folder is set in Settings > Binary Analysis, the feature is switched off, or the analysis was not run after the change.
A rule is a false alarm for my product.
Switch Report issues off for the project to keep only the page, or use the usual issue suppression. Rules cannot be switched off one by one.
Does it need the sources?
No. Only the compiled files.
Thanks for your feedback. Tell us more or request a feature.
