Advanced malware analysis tool using radare2 and r2pipe
Project description
r2inspect
Advanced malware analysis tool powered by radare2 and r2pipe
Overview
r2inspect is a professional malware analysis framework that automates deep static inspection for PE, ELF, and Mach-O binaries using the radare2 ecosystem. It combines format parsing, detection heuristics, and rich reporting to support reverse engineers, incident responders, and threat analysts.
Key Features
| Feature | Description |
|---|---|
| Multi-format Support | PE, ELF, Mach-O format detection and analysis |
| String Analysis | ASCII/Unicode extraction with filtering and decoding |
| Packer Detection | Evidence-based scoring with entropy and signature checks |
| Crypto Detection | API and constant analysis with confidence scoring |
| Anti-Analysis | Anti-debug/VM/sandbox indicators with evidence |
| Hashing Suite | MD5/SHA, SSDeep, TLSH, MACHOC, RichPE, Telfhash, SimHash |
| Metadata Analysis | Sections, imports, exports, resources, overlays |
| YARA Integration | Built-in and custom rule scanning |
| Rich Output | Console tables, JSON, and CSV exports |
Supported Formats
Windows PE32 / PE32+ / DLL
Linux ELF32 / ELF64
macOS Mach-O / Universal
Installation
From PyPI (Recommended)
pip install r2inspect
From Source
git clone https://github.com/seifreed/r2inspect.git
cd r2inspect
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -e .
Requirements
- Python 3.8+
- radare2 installed and in PATH
- libmagic (for file type detection)
Quick Start
# Basic analysis with rich console output
r2inspect samples/fixtures/hello_pe.exe
# JSON output
r2inspect -j samples/fixtures/hello_pe.exe
# CSV output
r2inspect -c samples/fixtures/hello_pe.exe
Usage
Command Line Interface
# Full analysis
r2inspect malware.exe
# Save output to file
r2inspect -j malware.exe -o analysis.json
# Analyze a directory (batch mode)
r2inspect --batch ./samples -j -o ./out
# Custom YARA rules
r2inspect --yara /path/to/rules malware.exe
Available Options
| Option | Description |
|---|---|
-i, --interactive |
Interactive analysis shell |
-j, --json |
Output in JSON format |
-c, --csv |
Output in CSV format |
-o, --output |
Output file or directory |
--batch |
Batch mode for directories |
--extensions |
Filter batch by extensions |
--yara |
Custom YARA rules directory |
-x, --xor |
XOR search string |
-v, --verbose |
Verbose output |
--quiet |
Suppress non-critical output |
--threads |
Parallel threads for batch mode |
Python Library
from r2inspect import R2Inspector
from r2inspect.config import Config
config = Config()
with R2Inspector("malware.exe", config=config) as inspector:
results = inspector.analyze()
pe_info = inspector.get_pe_info()
imports = inspector.get_imports()
Examples
Analyze Multiple Samples
r2inspect --batch ./samples --extensions "exe,dll" -j -o ./out
Interactive Mode
r2inspect> analyze
r2inspect> strings
r2inspect> imports
r2inspect> quit
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Support the Project
If you find r2inspect useful, consider supporting its development:
License
GNU General Public License v3.0
Attribution Required:
- Author: Marc Rivero | @seifreed
- Repository: github.com/seifreed/r2inspect
Made with dedication for the reverse engineering and threat intelligence community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file r2inspect-2.0.0.tar.gz.
File metadata
- Download URL: r2inspect-2.0.0.tar.gz
- Upload date:
- Size: 836.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0d9785f65d8a53016037e4c6cbd3ec186a62a8c5d360c8c1a5527efc41ec992
|
|
| MD5 |
11a8368c7467cd442fe7deb7e41f9ef0
|
|
| BLAKE2b-256 |
2d409e61887acc2654f09349c6ecd09ecc42f4f4b67bca84b22f14c16f61fabc
|
File details
Details for the file r2inspect-2.0.0-py3-none-any.whl.
File metadata
- Download URL: r2inspect-2.0.0-py3-none-any.whl
- Upload date:
- Size: 896.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da73a00d82f9eba8f89d93a62eaec801644e8a9c2a89842f9d3684718b6514c3
|
|
| MD5 |
77cbc539f6e60801f1171775f8a55f78
|
|
| BLAKE2b-256 |
e17211e90f605c07127781cbcbdfa661dbfa160655ec8ce66e5754401ea567d2
|