依赖 jadx 反编译器,系统未安装时会提示下载;不指定 -o 时也会自动生成结果文件;自定义 --args 需注意与默认反编译参数冲突
apkleaks
dwisiswant0Apache-2.0长期未更新扫描 APK 文件,提取其中的 URI、接口端点和硬编码密钥,方便做移动端安全审计和漏洞赏金排查。
Scanning APK file for URIs, endpoints & secrets.
pip3 install apkleaks
apkleaks -f ~/path/to/file.apkREADME 未说明
扫描 APK 文件,提取其中的 URI、接口端点和敏感密钥
扫描 APK 文件,提取其中的 URI、接口端点和硬编码密钥,方便做移动端安全审计和漏洞赏金排查。
核心能力
- 用 jadx 反编译 APK 后正则匹配敏感信息
- 内置默认规则集,支持自定义 JSON 规则
- 结果可输出为文本或 JSON 格式
- 可透传 jadx 反编译参数如 --deobf
容易踩的坑
- v2.6.3最新正式版2024-10-21 · 2024-10-21 01:54 UTC
What's Changed
- fix: replace pipes for python 3.13 by @branchvincent in https://github.com/dwisiswant0/apkleaks/pull/92
- build: migrate to pyproject.toml @branchvincent in https://github.com/dwisiswant0/apkleaks/pull/92
Full Changelog: https://github.com/dwisiswant0/apkleaks/compare/v2.6.2...v2.6.3
- v2.6.22024-05-17 · 2024-05-17 12:27 UTC
查看更新说明
What's Changed
- :bug: Fix can't work in kali using relative path by @pad0van in https://github.com/dwisiswant0/apkleaks/pull/57
- support python3.12 by @branchvincent in https://github.com/dwisiswant0/apkleaks/pull/81
New Contributors
- @pad0van made their first contribution in https://github.com/dwisiswant0/apkleaks/pull/57
- @branchvincent made their first contribution in https://github.com/dwisiswant0/apkleaks/pull/81
Full Changelog: https://github.com/dwisiswant0/apkleaks/compare/v2.6.1...v2.6.2
- v2.6.12021-08-10 · 2021-08-10 16:12 UTC
查看更新说明
Changelog
Patch
- Remove trailing comma (hotfix #52)
- v2.6.02021-08-09 · 2021-08-09 13:21 UTC
查看更新说明
Changelog
Minor
77a3fa49d3c3145d8f7e467fab8a102205082f33 Added patterns:
- GitHub Access Token
- Discord BOT Token
- JSON Web Token
- MAC Address
- CTF Flags:
- DEF CON (Order Of the Overflow)
- HackerOne
- TryHackMe
- HackTheBox
- v2.5.22021-06-27 · 2021-06-27 15:32 UTC
查看更新说明
Changelog
Patch
- Fix incompatible issue on Windows (#40)
- Replace all inline-flags PCRE pattern
- Remove Vault Token pattern due to false-positive
- Add kotlin to blacklist LinkFinder as class name
- Stripping secrets result of LinkFinder
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
APKLeaks
Scanning APK file for URIs, endpoints & secrets.
Installation
It's fairly simple to install APKLeaks:
from PyPi
$ pip3 install apkleaks
from Source
Clone repository and install requirements:
$ git clone https://github.com/dwisiswant0/apkleaks
$ cd apkleaks/
$ pip3 install -r requirements.txt
from Docker
Pull the Docker image by running:
$ docker pull dwisiswant0/apkleaks:latest
Dependencies
The APKLeaks utilizes the jadx disassembler to decompile APK files. If jadx is not present in your system, it will prompt you to download it.
Usage
Simply,
$ apkleaks -f ~/path/to/file.apk
# from Source
$ python3 apkleaks.py -f ~/path/to/file.apk
# or with Docker
$ docker run -it --rm -v /tmp:/tmp dwisiswant0/apkleaks:latest -f /tmp/file.apk
Options
Here are all the options it supports.
| Argument | Description | Example |
|---|---|---|
| -f, --file | APK file to scanning | apkleaks -f file.apk |
| -o, --output | Write to file results (random if not set) | apkleaks -f file.apk -o results.txt |
| -p, --pattern | Path to custom patterns JSON | apkleaks -f file.apk -p custom-rules.json |
| -a, --args | Disassembler arguments | apkleaks -f file.apk --args="--deobf --log-level DEBUG" |
| --json | Save as JSON format | apkleaks -f file.apk -o results.json --json |
Output
In general, if you don't provide -o argument, then it will generate results file automatically.
[!TIP] By default it will also save the results in text format, use
--jsonargument if you want JSON output format.
Pattern
Custom patterns can be added with the following argument to provide sensitive search rules in the JSON file format: --pattern /path/to/custom-rules.json. If no file is set, the tool will use the default patterns found in regexes.json file.
Here's an example of what a custom pattern file could look like:
// custom-rules.json
{
"Amazon AWS Access Key ID": "AKIA[0-9A-Z]{16}",
// ...
}
To run the tool using these custom rules, use the following command:
$ apkleaks -f /path/to/file.apk -p rules.json -o ~/Documents/apkleaks-results.txt
Arguments (disassembler)
We give user complete discretion to pass the disassembler arguments. For example, if you want to activate threads in jadx decompilation process, you can add it with -a/--args argument, example: --args="--threads-count 5".
$ apkleaks -f /path/to/file.apk -a "--deobf --log-level DEBUG"
[!WARNING] Please pay attention to the default disassembler arguments we use to prevent collisions.
License
apkleaks is distributed under Apache 2.
Acknowledments
Since this tool includes some contributions, and I'm not an asshole, I'll publically thank the following users for their helps and resources:
- @ndelphit - for his inspiring
apkurlgrep, that's why this tool was made. - @dxa4481 and y'all who contribute to
truffleHogRegexes. - @GerbenJavado & @Bankde - for awesome pattern to discover URLs, endpoints & their parameters from
LinkFinder. - @tomnomnom - a
gfpatterns. - @pxb1988 - for awesome APK dissambler
dex2jar. - @subho007 for standalone APK parser.
SHA2048#4361(Discord user) that help me porting code to Python3.- @Ry0taK because he had reported an OS command injection bug.
- @dee__see - for curated potentially sensitive tokens,
NotKeyHacks. - All contributors.