Skip to main content

APKLeaks

version contributions

Scanning APK file for URIs, endpoints & secrets.

APKLeaks

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 --json argument 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:

Release files for apkleaks 2.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apkleaks 2.6.3
File Size Uploaded
apkleaks-2.6.3.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for apkleaks 2.6.3
File Interpreter ABI Platform
apkleaks-2.6.3-py3-none-any.whl Python 3 none any Details

Total release size: 27.1 kB

Release files / apkleaks-2.6.3.tar.gz

Download URL apkleaks-2.6.3.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e247b59acf4448f3c2e45449bc7564bc5b7a216ebfb166236baf602d625b1df5
BLAKE2b-256 checksum
How to use checksums
1ee6203661abe151dbc59096de65d6f0cf392d1aad3acba32f4e9f3f389acad0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / apkleaks-2.6.3-py3-none-any.whl

Download URL apkleaks-2.6.3-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bdc02e65f98ca13a17c8fc83709d7f78dc451e36b7895e581d0254bb9c6f17d
BLAKE2b-256 checksum
How to use checksums
0c200eb37ed2d4adab6eaff10ab0a531112fc3bf3e49efb29a3db310d6b01737
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

2.6.3 This release

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.6.0

1 release file

2.5.2

1 release file

2.5.1

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.2

1 release file

2.3.1

1 release file

2.3.0

1 release file

2.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page