Debian Codegraph @

README.md

raw symbols SCIP
1 ![apkInspector](https://i.imgur.com/hTzyIDG.png)
2 ![PyPI - Version](https://img.shields.io/pypi/v/apkInspector) [![CI](https://github.com/erev0s/apkInspector/actions/workflows/ci.yml/badge.svg)](https://github.com/erev0s/apkInspector/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/erev0s/apkInspector/graph/badge.svg?token=A3YXHGXUXF)](https://codecov.io/gh/erev0s/apkInspector)
3 # apkInspector
4 apkInspector is a tool designed to provide detailed insights into the zip structure of APK files, offering the capability to extract content and decode the AndroidManifest.xml file. What sets APKInspector apart is its adherence to the zip specification during APK parsing, eliminating the need for reliance on external libraries. This independence, allows APKInspector to be highly adaptable, effectively emulating Android's installation process for APKs that cannot be parsed using standard libraries. The main goal is to enable users to conduct static analysis on APKs that employ evasion techniques, especially when conventional methods prove ineffective.
5
6 Please check [this blog post](https://erev0s.com/blog/unmasking-evasive-threats-with-apkinspector/) for more details.
7
8 ## How to install
9 [apkInspector is available through PyPI](https://pypi.org/project/apkInspector/)
10 ~~~~
11 pip install apkInspector
12 ~~~~
13
14 or you can clone this repository and build and install locally:
15 ~~~~
16 git clone https://github.com/erev0s/apkInspector.git
17 cd apkInspector
18 poetry build
19 pip install dist/apkInspector-Version_here.tar.gz
20 ~~~~
21
22 ## Documentation
23 Documentation created based on the docstrings, is available through Sphinx:
24 https://erev0s.github.io/apkInspector/
25
26
27 ## CLI
28 apkInspector offers a command line tool with the same name, with the following options;
29
30 ~~~~
31 $ apkInspector -h
32 usage: apkInspector [-h] [-apk APK] [-f FILENAME] [-ll] [-lc] [-la] [-e] [-x] [-xa] [-m] [-sm SPECIFY_MANIFEST] [-a] [-v]
33
34 apkInspector is a tool designed to provide detailed insights into the zip structure of APK files, offering the capability to extract content and decode the AndroidManifest.xml file.
35
36 options:
37 -h, --help show this help message and exit
38 -apk APK A single APK to inspect or a directory where multiple APKs may reside.
39 -f FILENAME, --filename FILENAME
40 Filename to provide info for
41 -ll, --list-local List all files by name from local headers
42 -lc, --list-central List all files by name from central directory header
43 -la, --list-all List all files from both central directory and local headers
44 -e, --export Export to JSON. What you list from the other flags, will be exported
45 -x, --extract Attempt to extract the file specified by the -f flag
46 -xa, --extract-all Attempt to extract all files detected in the central directory header
47 -m, --manifest Extract and decode the AndroidManifest.xml
48 -sm SPECIFY_MANIFEST, --specify-manifest SPECIFY_MANIFEST
49 Pass an encoded AndroidManifest.xml file to be decoded
50 -a, --analyze Check an APK for static analysis evasion techniques
51 -v, --version Retrieves version information
52 ~~~~
53
54
55 ## Library
56 The library component of apkInspector is designed with extensibility in mind, allowing other tools to seamlessly integrate its functionality. This flexibility empowers developers to leverage the capabilities of apkInspector within their own applications and workflows. To facilitate clear comprehension and ease of use, comprehensive docstrings accompany all primary methods, providing valuable insights into their functionality, expected arguments, and return values. These detailed explanations serve as invaluable guides, ensuring that developers can quickly grasp the inner workings of apkInspector's core features and smoothly incorporate them into their projects.
57
58 ### Features offered
59 - Find end of central directory record
60 - Parse central directory of APK and get details about each entry
61 - Get details local header for each entry
62 - Extract single or all files within an APK
63 - Decode AndroidManifest.xml file
64 - Identify Tampering Indicators:
65 - End of Central Directory record defined multiple times
66 - Unknown compression methods
67 - Compressed entry with empty filename
68 - Filenames/Path collisions
69 - Unexpected starting signature of AndroidManifest.xml
70 - Tampered StringCount value
71 - Strings surpassing maximum length
72 - Invalid data between elements
73 - Unexpected attribute start
74 - Unexpected attribute size
75 - Unexpected attribute names or values
76 - Zero size header for namespace end nodes
77
78
79 The command-line interface (CLI) serves as a practical illustration of how the methods provided by the library have been employed.
80
81 ## Reliability
82 Please take [a look at the results](https://github.com/erev0s/apkInspector/tree/main/tests/top_apps) from testing apkInspector against a set of top Play Store applications
83
84 ## Planned to-do
85 - Improve documentation (add examples)
86 - Improve code coverage
87
88 ## Contributions
89 We welcome contributions from the open-source community to help improve and enhance apkInspector. Whether you're a developer, tester, or documentation enthusiast, your contributions are valuable.
90
91 ## :rocket: apkInspector is being used by :rocket: :
92 - [androguard](https://github.com/androguard/androguard/)
93 - [medusa](https://github.com/Ch0pin/medusa)
94
95 ## Presentation of the tool and the research behind it
96 - Defcon 32 | [PDF](docs/presentation/apkinspector-Defon32-presentation.pdf)
97
98 ## Disclaimer
99 It should be kept in mind that apkInspector is an evolving project, a work in progress. As such, users should anticipate occasional bugs and anticipate updates and upgrades as the tool continues to mature and enhance its functionality. Your feedback and contributions to apkInspector are highly appreciated as we work together to improve and refine its capabilities.