Ir al contenido

Detect It Easy

Detect It Easy (DIE) is a comprehensive binary analysis tool that identifies compilers, packers, protectors, and linkers used to build executables. It supports PE (Windows), ELF (Linux), Mach-O (macOS), and other executable formats, making it essential for malware analysis and reverse engineering workflows.

# Windows - Download binary
# https://github.com/horsicq/Detect-It-Easy/releases

# Linux build from source
git clone --recursive https://github.com/horsicq/Detect-It-Easy.git
cd Detect-It-Easy
mkdir build && cd build
qmake ..
make
sudo make install

# Debian/Ubuntu (if available)
sudo apt-get install detect-it-easy

# macOS
brew install detect-it-easy
# Basic syntax
diec [OPTIONS] <file>

# GUI launch
diec-gui [file]
OptionDescription
-h, --helpShow help message
-v, --versionDisplay version
-a, --allShow all information
-j, --jsonOutput results as JSON
-x, --xmlOutput results as XML
-t, --textPlain text output
-c, --colorColorized output
-d, --deepDeep scan mode
--debugEnable debug output
--engine <file>Use custom database
# Analyze executable for compiler signatures
diec -a malware.exe

# Output shows:
# Microsoft Visual C++ 6.0
# Compiler: MSVC v12.0 (Visual Studio 2013)
# Runtime: MSVC Runtime 120
CompilerSignatures
MSVC (Microsoft)Recognizable entry points, heap markers
GCC/MinGW.gnu_debuglink, exception tables
ClangSpecific exception handling structures
Borland DelphiVCL signatures, BDE libraries
Visual BasicVB runtime libraries (MSVBVM*.dll)
DelphiBorland library signatures
GoLangRuntime strings, pclntab
# Visual Studio 2015 (MSVC v19.0)
diec vs2015_app.exe

# Visual Studio 2019 (MSVC v19.28)
diec vs2019_app.exe

# Visual Studio 2022 (MSVC v19.3+)
diec vs2022_app.exe
# Scan for known packers
diec -a packed.exe

# Output examples:
# UPX v3.96
# PECompact v2.x
# ASPack 2.x
# Themida 2.x
# VMProtect 3.x
PackerSignatureCategory
UPXUPX header sectionsCompression
PECompactPECompact markersCompression
ASPackASPack stubCompression
ThemidaThemida runtimeAnti-analysis
VMProtectVM bytecodeAnti-analysis
Code VirtualizerVirtual machineAnti-analysis
kkrunchykk stubGame protection
RLPackRL signatureCompression
PETitePETite sectionsCompression
QuickPackQK sectionsCompression
# Analyze suspected polymorphic sample
diec --deep suspicious.exe

# Look for:
# - Encrypted sections
# - Entry point redirection
# - Stub code patterns
# - Unusual section names
# Detect code virtualization and obfuscation
diec --deep malware.exe

# May indicate:
# VMProtect - Virtual machine protection
# Themida - Code obfuscation
# Code Guard - Runtime protection
# SafeEngine - Anti-debugging
ProtectionIndicator
IsDebuggerPresentAPI imports section
Hardware breakpointsException handling setup
RDTSC checksTimestamp instructions
INT 2D/3Interrupt handlers
NtSetInformationFileKernel mode detection
# Scan for anti-RE features
diec --deep protected.exe

# Look for:
# - Custom exception handlers
# - API redirection tables
# - Encrypted IAT (Import Address Table)
# - Self-modifying code markers
# - Integrity check routines
# Step 1: Quick packer detection
diec malware.exe | grep -i "packer\|packed"

# Step 2: Compiler identification
diec malware.exe | grep -i "compiler\|runtime"

# Step 3: Protection mechanisms
diec --deep malware.exe | grep -i "protect\|anti"

# Step 4: Library detection
diec malware.exe | grep -i "library\|framework"
# Check for unusual compiler combinations
diec sample.exe

# Flag suspicious indicators:
# - Old/vulnerable compiler versions
# - Mismatched runtime libraries
# - Conflicting compiler signatures
# - Non-standard build options
# Export findings for analysis
diec --json malware.exe > findings.json

# Extract compiler version
jq '.compiler.name' findings.json

# Extract all detected software
jq '.detects[] | .name' findings.json
diec malware.exe

# Example output:
DIE v3.08
File: malware.exe
Size: 1024000 bytes
Type: PE32 executable

Detects:
  Compiler: Microsoft Visual C++ 2015
  Protector: Themida 2.4
  Library: Standard C Library
  Tool: Resource Editor
diec --json malware.exe

# Example structure:
{
  "file": "malware.exe",
  "detects": [
    {
      "name": "Microsoft Visual C++",
      "version": "2015",
      "category": "Compiler"
    },
    {
      "name": "Themida",
      "version": "2.4",
      "category": "Protector"
    }
  ]
}
# Analyze multiple files and log results
for file in *.exe; do
    echo "Analyzing $file..." >> analysis.log
    diec "$file" >> analysis.log
    echo "---" >> analysis.log
done
# Compare known malware with suspect sample
diec known_malware.exe > known.txt
diec suspect_sample.exe > suspect.txt

# Compare detections
diff known.txt suspect.txt

# Same compiler/packer = likely variant
# Family characteristics by compiler/packer combination
diec sample1.exe  # WinRAR compiler + UPX = Family A
diec sample2.exe  # MSVC 2013 + Themida = Family B

# Build threat intelligence profile
# Crypters often use known protectors
diec ransomware.exe

# Common findings:
# - VMProtect (high protection cost)
# - Code Virtualizer (complex obfuscation)
# - Themida (anti-analysis features)
# Identify linked libraries
diec executable.exe

# Common findings:
# - MSVC Runtime (CRT)
# - Windows SDK functions
# - OpenSSL (if linked)
# - Crypto++ (if present)
# - Boost libraries (C++)
DetectionIndicates
.NET FrameworkManaged code, CLR runtime
Java RuntimeJVM bytecode
PythonEmbedded interpreter
MonoCross-platform .NET
Qt FrameworkCross-platform GUI
wxWidgetsCross-platform UI
# Windows executable (PE)
diec malware.exe

# Linux executable (ELF)
diec ./malware

# macOS executable (Mach-O)
diec malware.app/Contents/MacOS/malware

# Each format has different signature patterns
# Analysis differences by format:
# PE: MSVC, Borland, direct Win32 APIs
# ELF: GCC, Clang, glibc functions
# Mach-O: Apple Clang, Objective-C, frameworks
# DIE uses a database of known signatures
# Download latest database updates
# Via GUI or official repository

# Verify database version
diec --version
# Load custom detection database
diec --engine custom_sigs.db malware.exe

# Useful for:
# - Custom malware families
# - Proprietary tools
# - Internal threat intelligence
# - Research databases
ToolIntegration
IDA ProIdentify compiler for proper analysis
GhidraPre-analysis for correct architecture
x64dbgUnderstand packer removal strategy
Radare2Obtain compilation metadata
WiresharkCorrelate C&C analysis
#!/bin/bash
# Analyze all .exe files and create report

output_file="malware_analysis.txt"
> "$output_file"

for file in *.exe; do
    echo "=== Analyzing $file ===" >> "$output_file"
    diec -a "$file" >> "$output_file" 2>&1
    echo "" >> "$output_file"
done

echo "Analysis complete: $output_file"
#!/bin/bash
# Export all analyses as JSON for processing

mkdir -p json_results

for file in *.exe; do
    output="json_results/${file%.exe}.json"
    diec --json "$file" > "$output"
    echo "Exported: $output"
done
#!/bin/bash
# Find all samples with specific packer

packer_name="VMProtect"

for file in *.exe; do
    if diec "$file" | grep -q "$packer_name"; then
        echo "Found $packer_name in: $file"
    fi
done
# Detection quality relies on signature database
# DIE may not detect:
# - New/unknown packers
# - Custom/private protectors
# - Modified known signatures
# - Encrypted/obfuscated markers
ScenarioHandling
Unknown packerManual analysis required
Generic compilerMay match multiple versions
Stripped binariesReduced detection accuracy
Mixed toolchainsDisplays all detected components
  • Always use latest DIE version for current threat detection
  • Cross-reference findings with other analysis tools
  • Consider context: legitimate software uses packers too
  • Combine with dynamic analysis for complete picture
  • Document findings for threat intelligence
  • Build custom databases for known malware
  • Use batch processing for large sample sets
  • Verify compiler/packer combinations manually when critical
# Check if file is actually executable
file suspect.exe

# Try deep scan mode
diec --deep suspect.exe

# May indicate custom/unknown toolchain
# Some files show multiple compiler entries
# Often legitimate (linked libraries)
# Focus on primary compilation indicator
# Verify database file integrity
diec --version

# Reinstall or update DIE
# Check file permissions on database files
  • Official DIE GitHub repository
  • Malware analysis frameworks (YARA, SIGMA)
  • MITRE ATT&CK for protector tactics
  • VirusTotal for sample analysis
  • Hybrid Analysis platform integration
  • Academic papers on packer detection
ToolPurpose
PEiDLegacy packer identification
ExeInfo PEAdditional packer detection
StringsExtract compilation metadata
ObjdumpELF/PE structure analysis
YARACustom signature matching
YomiAutomated malware analysis