Elfvulnscan
A simple binary vulnerability scanner module for Linux that statically analyzes ELF binary files to identify potential vulnerabilities.
Install / Use
/learn @CyberGuard-Lab/ElfvulnscanREADME
automated-binary-vuln-scanner
A modular static vulnerability scanner for Linux ELF binaries. It analyzes binary instructions using objdump and identifies unsafe function calls, heap overflows, and potential command injections — all without executing the binary.
Features
Stack-based Vulnerability Detection (UnsafeDetector)
- Disassembles
.textsection and analyzes instructions. - Flags unsafe standard library calls:
gets,strcpy,sprintf,scanf, etc.
- Reports:
- Instruction address (full virtual address)
- Called function
- Risk level (HIGH / MEDIUM)
- Optional function name (if available via demangling)
Heap-based Overflow Detection (HeapOverflowDetector)
- Tracks dynamic memory allocations (
malloc,calloc) - Checks copying instructions (
memcpy,strcpy, etc.) that may exceed allocated size - Detects
rep movsb/rep stosbused on heap buffers - Reports:
- Instruction address
- Number of bytes copied vs. allocation size
- Allocation site address (if available)
Command Injection Detection (CommandInjectionDetector)
- Identifies uses of:
system,popen, and allexec*variants
- Reports:
- Instruction address
- Target function (e.g.,
system) - Risk detail
Prerequisites
- Linux (tested on Ubuntu/Debian)
g++with C++17 supportbinutils(providesobjdumpandc++filt)cmake(optional but recommended)
Build Instructions
Option 1: Using CMake
sudo apt update
sudo apt install build-essential cmake binutils
git clone https://github.com/sondt99/automated-binary-vuln-scanner.git
cd automated-binary-vuln-scanner
mkdir build && cd build
cmake ..
make
Option 2: Manual Compile
g++ -std=c++17 src/*.cpp -Iinclude -o scanner
Usage
./scanner <binary_path>
Sample Output
Analyzing binary: ./bof_vuln
Found 16 functions to analyze.
============================================================
UNSAFE FUNCTION CALLS ANALYSIS
============================================================
[HIGH RISK] Found 1 issues:
--------------------------------------------------
Address : 0x0000000000401215
Calls : gets
Analysis : Risk: HIGH - gets() doesn't check buffer bounds
============================================================
HEAP OVERFLOW ANALYSIS
============================================================
✓ No heap overflow vulnerabilities detected.
============================================================
COMMAND INJECTION ANALYSIS
============================================================
Potential command injection:
Address: 0x0000000000401188
Calls : system
Detail : Call to `system` at 0x0000000000401188 can lead to command injection risks.
============================================================
SUMMARY
============================================================
Total issues found: 2
├─ Unsafe function calls: 1
├─ Heap overflows : 0
└─ Command injections : 1
Review flagged issues carefully — some may be false positives.
Focus on HIGH risk findings first.
Extending
To add your own vulnerability detector:
- Create a new pair of files:
include/MyDetector.handsrc/MyDetector.cpp - Implement:
std::vector<MyDetector::Finding> detect(const std::vector<Function>& funcs) const; - Add your files to
CMakeLists.txtor theg++compile command - Include and invoke your detector from
src/main.cppand print results similar to existing modules
Contributing
Pull requests are welcome. You can contribute by:
- Adding new detectors (e.g., format string, integer overflow)
- Improving disassembly and instruction parsing
- Enhancing reporting formats (e.g., JSON output, IDE integration)
- Performance improvements
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
