s1d9e/winpe-scan

GitHub: s1d9e/winpe-scan

一个零依赖的 Python 工具包,用于对 Windows PE 文件进行静态分析,包括头信息解析、字符串提取、哈希计算和可疑模式检测。

Stars: 0 | Forks: 0

# WinPE-Scan

Python License Platform Tools

WinPE-Scan Logo

**WinPE-Scan** 是一个用于分析 Windows PE 文件(.exe、.dll、.sys)的多工具工具包。这是进行恶意软件分析和安全研究的完整工具。 ## ⚠️ 法律声明 ## ✨ 功能 | 工具 | 描述 | |-------|-------------| | 📊 **info** | PE 文件完整分析 | | 🔍 **strings** | 提取 ASCII/Unicode 字符串 | | 🔐 **hash** | 计算哈希值(MD5、SHA1、SHA256、SHA512) | | 📋 **headers** | 查看 PE 头信息 | | 📦 **sections** | 详细分析节区 | | 📥 **imports** | 导入/导出表列表 | | ⚖️ **compare** | 比较两个 PE 文件 | | ✓ **sig** | 签名信息 | ## 📦 安装 ``` # 克隆 repo git clone https://github.com/s1d9e/winpe-scan.git cd winpe-scan # 无需依赖 - 仅需 Python 3.8+ python3 winpe-scan.py ``` ## 🚀 使用 ``` # 完整分析 python3 winpe-scan.py info malware.exe # 提取 strings python3 winpe-scan.py strings sample.dll python3 winpe-scan.py strings file.exe -m 6 -f "http" # 计算 hashes python3 winpe-scan.py hash suspicious.exe # 查看 headers python3 winpe-scan.py headers file.exe # 分析 sections python3 winpe-scan.py sections malware.dll # 列出 imports/exports python3 winpe-scan.py imports sample.exe # 比较两个文件 python3 winpe-scan.py compare file1.exe file2.exe # 签名信息 python3 winpe-scan.py sig file.exe ``` ## 🛠️ 详细工具 ### info - 完整分析 ``` python3 winpe-scan.py info malware.exe [ BASIC INFO ] File: malware.exe Size: 45,232 bytes MD5: d41d8cd98f00b204e9800998ecf8427e SHA256: e3b0c44298fc1c149afbf4c8996fb924... [ SECTIONS ] Name VirtAddr Entropy .text 0x1000 6.87 ⚠️ .data 0x6000 3.21 ``` ### strings - 字符串提取 ``` # 最小长度为 6 的 strings python3 winpe-scan.py strings malware.exe -m 6 # 按 regex 过滤 python3 winpe-scan.py strings file.exe -f "http" ``` ### hash - 哈希计算 ``` python3 winpe-scan.py hash sample.dll MD5 d41d8cd98f00b204e9800998ecf8427e SHA1 da39a3ee5e6b4b0d3255bfef95601890afd80709 SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 SHA512 cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce... ``` ### compare - 比较 ``` python3 winpe-scan.py compare file1.exe file2.exe Hashes: File 1: a1b2c3d4... File 2: e5f6g7h8... Match: NO Imports: File 1: 12 DLLs File 2: 15 DLLs Common: kernel32.dll, ntdll.dll, ws2_32.dll ``` ## 📊 完整示例 ``` ╔══════════════════════════════════════════════════════════╗ ║ WINPE-SCAN v1.0 ║ ║ Windows PE Multi-Tool Analyzer ║ ╚══════════════════════════════════════════════════════════╝ Tools: info | strings | hash | headers | sections | imports | compare | sig $ python3 winpe-scan.py info suspicious.exe [ BASIC INFO ] ────────────────────────────────────────────────── File: suspicious.exe Size: 45,232 bytes MD5: d41d8cd98f00b204e9800998ecf8427e SHA256: e3b0c44298fc1c149afbf4c8996fb924... [ PE HEADERS ] ────────────────────────────────────────────────── Machine: x64 Sections: 4 Subsystem: Windows GUI Entry Point: 0x1000 [ SECTIONS ] ────────────────────────────────────────────────── Name VirtAddr Entropy Flags .text 0x1000 6.87 ⚠️ CODE READ EXEC .data 0x6000 3.21 READ WRITE [ SUSPICIOUS ] ────────────────────────────────────────────────── 🚨 HIGH [NETWORK] http://malicious-domain.com 🚨 HIGH [COMMAND] cmd.exe /c powershell... ``` ## 🏗️ 结构 ``` winpe-scan/ ├── winpe-scan.py # Multi-tool principal ├── README.md ├── LICENSE ├── LEGAL.md ├── .gitignore └── .assets/ └── logo.svg ``` ## 🔧 技术 - **Python 3.8+** - 100% Python,零依赖 - **Colorama** - 终端彩色输出 - **Struct** - 原生二进制解析 - **Regex** - 模式检测 ## 📜 许可证 MIT 许可证 - 详见 [LICENSE](LICENSE)

s1d9e 用 🛡️ 制作 | 仅供教育用途

标签:AMSI绕过, Cybersecurity, DAST, DLL分析, DNS 反向解析, IMP_HASH, imports, IP 地址批量处理, PE头部解析, Python, -sections, Windows PE, 二进制分析, 云安全监控, 云安全运维, 云资产清单, 可执行文件, 哈希计算, 威胁检测, 字符串提取, 安全教育, 恶意软件分析, 数据展示, 文件格式, 无后门, 红队, 网络信息收集, 网络安全, 网络安全审计, 逆向工具, 逆向工程, 隐私保护, 静态分析