Manalyze 是一款针对 PE 文件的静态分析工具,可用于对可执行文件(或一组可执行文件)进行初步评估。它收集可能指示恶意行为的微弱信号,并显示有助于后续手动分析的信息。
如果您想查看该工具生成的示例报告,请随意试用我为其创建的网络服务:manalyzer.org。
Manalyze 使用 C++ 编写,支持 Windows 和 Linux,并根据 GPLv3 许可证 发布。它是一款健壮的 PE 文件解析器,具有灵活的插件架构,允许用户深入静态分析文件。Manalyze...
WriteProcessMemory + CreateRemoteThread)没有什么比签出开源项目然后花两个小时试图构建它更让我讨厌的了。因此,我尽最大努力使 Manalyze 尽可能容易构建。如果下面几行对您不起作用,那么我失败了,您应该给我留言,以便我修复这个问题。
$> [sudo or as root] apt-get install libboost-dev libboost-system-dev libssl-dev build-essential cmake git
$> [alternatively, also sudo or as root] pkg install boost libressl cmake git
$> git clone https://github.com/JusticeRage/Manalyze.git && cd Manalyze
$> cmake .
$> make -j5
$> cd bin && ./manalyze --version
注意:VirusTotal 插件是可选的,并且需要 Boost.System 库。
最后,如果您希望从机器的任何目录访问 Manalyze,请从项目的根文件夹使用 $> make install 进行安装。
cd boost_1_XX_0 && ./bootstrap.bat && ./b2.exe --build-type=complete --with-systemBOOST_ROOT,其中包含您的 boost_1_XX_0 文件夹的路径。git clone https://github.com/JusticeRage/Manalyze.git && cd Manalyze && cmake .manalyze.sln 应该出现在 Manalyze 文件夹中!# 如果您已经有正常的构建环境,请跳过这两行
user$ xcode-select --install
user$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
user$ git clone https://github.com/JusticeRage/Manalyze.git && cd Manalyze
user$ brew install openssl boost
user$ cmake . -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ && make -j5
user$ bin && ./manalyze --version
如果您需要在没有互联网连接的机器上构建 Manalyze,您必须手动签出以下项目:
将这两个文件夹分别放入 external 文件夹中,作为 external/yara 和 external/hash-library。然后运行 cmake . -DGitHub=OFF,并像往常一样继续。
社区提供了 Manalyze 的 Docker 镜像。运行 docker pull evanowe/manalyze 并获取更多信息 这里。
由于 ClamAV 签名体积庞大且定期更新,因此从 GitHub 或二进制文件分发它们没有多大意义。当您首次尝试使用 ClamAV 插件时,您很可能会遇到以下错误消息:[!] Error: Could not load yara_rules/clamav.yara。为了生成它们,请运行位于 bin/yara_rules(源代码树)或 ${CMAKE_INSTALL_DATADIR}/manalyze/yara_rules(安装后,通常为 /usr/share/manalyze/yara_rules 或 /usr/local/share/manalyze/yara_rules)中的 update_clamav_signatures.py Python 脚本。
每当您想要刷新签名时,请运行该脚本。编译后的 Yara 缓存存储在 $XDG_CACHE_HOME/manalyze/yara_rules 或 ~/.cache/manalyze/yara_rules 中,并可以通过 MANALYZE_CACHE_DIR 覆盖。
默认安装位置(遵循 CMAKE_INSTALL_PREFIX)为:
${CMAKE_INSTALL_SYSCONFDIR}/manalyze/manalyze.conf(通常为 /etc/manalyze/manalyze.conf 或 /usr/local/etc/manalyze/manalyze.conf)${CMAKE_INSTALL_DATADIR}/manalyze/yara_rules(通常为 /usr/share/manalyze/yara_rules 或 /usr/local/share/manalyze/yara_rules)${CMAKE_INSTALL_LIBDIR}/manalyze/plugins您可以使用环境变量覆盖这些路径:
MANALYZE_CONFIG_DIR、MANALYZE_DATA_DIR、MANALYZE_PLUGIN_DIR、MANALYZE_CACHE_DIR。
$ ./manalyze.exe --help
Usage:
-h [ --help ] Displays this message.
-v [ --version ] Prints the program's version.
--pe arg The PE to analyze. Also accepted as a positional
argument. Multiple files may be specified.
-r [ --recursive ] Scan all files in a directory (subdirectories will be
ignored).
-o [ --output ] arg The output format. May be 'raw' (default) or 'json'.
-d [ --dump ] arg Dump PE information. Available choices are any
combination of: all, summary, dos (dos header), pe (pe
header), opt (pe optional header), sections, imports,
exports, resources, version, debug, tls, config, delay, rich
--hashes Calculate various hashes of the file (may slow down the
analysis!)
-x [ --extract ] arg Extract the PE resources to the target directory.
-p [ --plugins ] arg Analyze the binary with additional plugins. (may slow
down the analysis!)
Available plugins:
- clamav: Scans the binary with ClamAV virus definitions.
- compilers: Tries to determine which compiler generated the binary.
- peid: Returns the PEiD signature of the binary.
- strings: Looks for suspicious strings (anti-VM, process names...).
- findcrypt: Detects embedded cryptographic constants.
- packer: Tries to structurally detect packer presence.
- imports: Looks for suspicious imports.
- resources: Analyzes the program's resources.
- mitigation: Displays the enabled exploit mitigation techniques (DEP, ASLR, etc.).
- overlay: Analyzes data outside of the PE's boundaries.
- authenticode: Checks if the digital signature of the PE is valid.
- virustotal: Checks existing AV results on VirusTotal.
- all: Run all the available plugins.
Examples:
manalyze.exe program.exe
manalyze.exe -dresources -dexports -x out/ program.exe
manalyze.exe --dump=imports,sections --hashes program.exe
manalyze.exe -r malwares/ --plugins=peid,clamav --dump all
Python 绑定位于 manapy/ 目录下,并作为 manalyze 导入。
从仓库根目录:
cd manapy
python -m pip install .
示例: manalyze.exe program.exe manalyze.exe -dresources -dexports -x out/ program.exe manalyze.exe --dump=imports,sections --hashes program.exe manalyze.exe -r malwares/ --plugins=peid,clamav --dump all
## 使用 Manalyze 的用户
- [ANY.RUN](https://any.run/)
- [CinCan](https://cincan.io/)
- [DFN-CERT](https://www.dfn-cert.de/)
- [The Hive](https://blog.thehive-project.org/tag/manalyze/)
- [Yomi](https://yomi.yoroi.company)
- [Threat.Zone](https://threat.zone)
如果您希望被添加到这个列表中,请联系我或打开一个 pull request!
## 联系方式
[](mailto:justicerage@manalyzer[.]org)
[](https://twitter.com/JusticeRage)
[](https://pgp.mit.edu/pks/lookup?op=vindex&search=0x40E9F0A8F5EA8754)