rednaga/APKiD

GitHub: rednaga/APKiD

APKiD 是一款用于识别 Android 应用中编译器、加壳器、混淆器及保护机制的指纹识别工具,被誉为移动端的 PEiD。

Stars: 2456 | Forks: 332

# APKiD [![构建状态](https://app.travis-ci.com/rednaga/APKiD.svg?branch=master)](https://app.travis-ci.com/rednaga/APKiD) [![PyPI](https://img.shields.io/pypi/v/apkid.svg)](https://pypi.org/project/apkid/) [![PyPI - Python 版本](https://img.shields.io/pypi/pyversions/apkid.svg)](https://pypi.org/project/apkid/) [![PyPI - 格式](https://img.shields.io/pypi/format/apkid.svg)](https://pypi.org/project/apkid/) [![PyPI - 许可证](https://img.shields.io/pypi/l/apkid.svg)](https://pypi.org/project/apkid/) APKiD 提供有关 APK 构建方式的信息。它可以识别许多编译器、加壳器、混淆器以及其他奇怪的东西。它是 Android 版的 [_PEiD_](https://www.aldeid.com/wiki/PEiD)。 ![Screen Shot 2019-05-07 at 10 55 00 AM](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/5be4a2664a023048.png) 有关此工具用途的更多信息,请查看: * [Android 编译器指纹识别](http://hitcon.org/2016/CMT/slide/day1-r0-e-1.pdf) * [使用 APKiD 检测盗版和恶意 Android 应用](http://rednaga.io/2016/07/31/detecting_pirated_and_malicious_android_apps_with_apkid/) * [APKiD: Android 应用的 PEiD (BlackHat EU/UK Arsenal 2018)](https://github.com/enovella/cve-bio-enovella/blob/master/slides/bheu18-enovella-APKID.pdf) * [APKiD: 应用加固产品的快速识别](https://github.com/enovella/cve-bio-enovella/blob/master/slides/APKiD-NowSecure-Connect19-enovella.pdf) * [APKiD: 移动端 RASP SDK 的快速识别 (BlackHat USA Arsenal 2023)](https://github.com/enovella/cve-bio-enovella/blob/master/slides/bheu23-enovella-APKID.pdf) ## 安装 ``` pip install apkid ``` ### Docker 你也可以使用 [Docker](https://www.docker.com/community-edition) 运行 APKiD!当然,这要求你已经安装了 git 和 Docker。 以下是使用 Docker 的方法: ``` git clone https://github.com/rednaga/APKiD cd APKiD/ docker build . -t rednaga:apkid docker/apkid.sh ~/reverse/targets/android/example/example.apk [+] APKiD 2.1.0 :: from RedNaga :: rednaga.io [*] example.apk!classes.dex |-> compiler : dx ``` ## 用法 ``` usage: apkid [-h] [-v] [-t TIMEOUT] [-r] [--scan-depth SCAN_DEPTH] [--entry-max-scan-size ENTRY_MAX_SCAN_SIZE] [--typing {magic,filename,none}] [-j] [-o DIR] [FILE [FILE ...]] APKiD - Android Application Identifier v2.1.2 positional arguments: FILE apk, dex, or directory optional arguments: -h, --help show this help message and exit -v, --verbose log debug messages scanning: -t TIMEOUT, --timeout TIMEOUT Yara scan timeout (in seconds) -r, --recursive recurse into subdirectories --scan-depth SCAN_DEPTH how deep to go when scanning nested zips --entry-max-scan-size ENTRY_MAX_SCAN_SIZE max zip entry size to scan in bytes, 0 = no limit --typing {magic,filename,none} method to decide which files to scan output: -j, --json output scan results in JSON format -o DIR, --output-dir DIR write individual results here (implies --json) ``` ## 提交新的 Packer / 编译器 / 混淆器 如果你遇到一个 APKiD 无法识别的 APK 或 DEX 文件,请提出一个 GitHub issue 并告诉我们: * 你认为它是什么 —— 被混淆、被加壳等 * 文件哈希值(MD5、SHA1 或 SHA256) 我们乐意接受你可能拥有的关于检测“有趣事物”的任何概念,因此不要仅限于 packer、编译器或混淆器。如果有有趣的反反汇编、反虚拟机、反* 技巧,请提交一个 issue。 欢迎提交 Pull request。如果你正在提交一个新规则,请务必包含 APK / DEX 的文件哈希,以便我们检查该规则。 ## 许可证 此工具采用双重许可证提供:一种适用于闭源项目的商业许可证,以及一种可用于开源软件的 GPL 许可证。 根据你的需求,你必须选择其中之一并遵循其政策。每种许可证类型的政策和协议详情可在 [LICENSE.COMMERCIAL](LICENSE.COMMERCIAL) 和 [LICENSE.GPL](LICENSE.GPL) 文件中找到。 ## 开发 如果你想安装最新版本以进行更改、开发自己的规则等,只需克隆此仓库,编译规则,并以可编辑模式安装该软件包: ``` git clone https://github.com/rednaga/APKiD cd APKiD python prep-release.py pip install -e .[dev,test] ``` 如果上述操作因权限错误(取决于你的本地机器和 Python 的安装位置)而无法工作,请尝试指定 `--user` 标志。如果你没有使用虚拟环境,这很可能是必需的: ``` pip install -e .[dev,test] --user ``` 如果你更新了任何规则,请务必运行 `prep-release.py` 重新编译它们。 如果你使用的是 Windows,请在编译前安装 Yara 3.11.0 和 yara-python-dex ``` pip install yara-python==3.11.0 pip install wheel pip wheel --wheel-dir=yara-python-dex git+https://github.com/MobSF/yara-python-dex.git pip install --no-index --find-links=yara-python-dex yara-python-dex ``` ## 给软件包维护者 发布新版本时,请确保 [apkid/__init__.py](apkid/__init__.py) 中的版本已更新。 关于运行测试,请查看 [.travis.yml](.travis.yml) 以了解开发和测试环境的设置方式以及测试的运行方式。 更新编译后的规则、readme,构建软件包并上传到 PyPI: ``` ./prep-release.py readme rm -f dist/* python setup.py sdist bdist_wheel twine upload --repository-url https://upload.pypi.org/legacy/ dist/* ``` 更多信息请参阅 [打包项目](https://packaging.python.org/tutorials/packaging-projects/)。
标签:Android, APKiD, APK分析, AppShielding识别, DAST, Docker, DSL, PEiD for Android, RASP识别, 云安全监控, 云资产清单, 加壳检测, 安全防御评估, 恶意软件分析, 无服务器架构, 混淆识别, 目录枚举, 移动安全, 编译器指纹, 脱壳, 请求拦截, 逆向工具, 逆向工程, 静态分析