All Projects → alessandrodd → Apk_api_key_extractor

alessandrodd / Apk_api_key_extractor

Licence: apache-2.0
Automatically extracts API Keys from APK files

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Apk api key extractor

Coolapk Kotlin
酷安开源版.....
Stars: ✭ 141 (-5.37%)
Mutual labels:  api, apk
Googleplay Api
Google Play Unofficial Python API
Stars: ✭ 278 (+86.58%)
Mutual labels:  api, apk
Sneaks Api
A StockX, FlightClub, Goat, and Stadium Goods API all in one. This sneaker API allows users to search sneakers and track and compare prices while providing additional info such as product links and images
Stars: ✭ 146 (-2.01%)
Mutual labels:  api
Customstage
A JavaFX UI framework to create fully customized undecorated windows
Stars: ✭ 148 (-0.67%)
Mutual labels:  api
Cr Api
Clash Royale Public API that provides real-time data about players, clans, tournaments and more.
Stars: ✭ 147 (-1.34%)
Mutual labels:  api
Node Express Mongoose Passport Jwt Rest Api Auth
Node, express, mongoose, passport and JWT REST API authentication example
Stars: ✭ 146 (-2.01%)
Mutual labels:  api
Magic Api
magic-api 是一个接口快速开发框架,通过Web页面编写脚本以及配置,自动映射为HTTP接口,无需定义Controller、Service、Dao、Mapper、XML、VO等Java对象
Stars: ✭ 146 (-2.01%)
Mutual labels:  api
Stelace
Open-source marketplace backend in Node.js, empowering Web platforms with Search API, Automation, Auth, Headless CMS… ⚡ 💻
Stars: ✭ 144 (-3.36%)
Mutual labels:  api
Google Translate Api
A free and unlimited API for Google Translate 💵🚫
Stars: ✭ 1,996 (+1239.6%)
Mutual labels:  api
Branca
🔑 Secure alternative to JWT. Authenticated Encrypted API Tokens for Go.
Stars: ✭ 147 (-1.34%)
Mutual labels:  api
Alize
Visualize Your Github Profile
Stars: ✭ 148 (-0.67%)
Mutual labels:  api
Graphql Genie
Simply pass in your GraphQL type defintions and get a fully featured GraphQL API with referential integrity, inverse updates, subscriptions and role based access control that can be used client side or server side.
Stars: ✭ 147 (-1.34%)
Mutual labels:  api
Mojo Webqq
【重要通知:WebQQ将在2019年1月1日停止服务,此项目目前已停止维护,感谢大家四年来的一路陪伴】使用Perl语言(不会没关系)编写的smartqq/webqq客户端框架(非GUI),可通过插件提供基于HTTP协议的api接口供其他语言或系统调用
Stars: ✭ 1,755 (+1077.85%)
Mutual labels:  api
Acnhapi
Data in JSON format from https://acnhapi.com
Stars: ✭ 147 (-1.34%)
Mutual labels:  api
Grafanajsondatasource
Grafana datasource to load JSON data over your arbitrary HTTP backend
Stars: ✭ 146 (-2.01%)
Mutual labels:  api
Sp Rest Proxy
🌐 SharePoint REST API Proxy for local Front-end development tool-chains
Stars: ✭ 147 (-1.34%)
Mutual labels:  api
Kitsu Server
🚂 Rails API server for Kitsu
Stars: ✭ 145 (-2.68%)
Mutual labels:  api
Streaming
r/freemediaheckyeah
Stars: ✭ 147 (-1.34%)
Mutual labels:  apk
Api Guidelines
adidas group API design guidelines
Stars: ✭ 147 (-1.34%)
Mutual labels:  api
Bicing Api
Get statistics and locations of bicycle stations through REST API
Stars: ✭ 149 (+0%)
Mutual labels:  api

apk_api_key_extractor

Automatically extracts API Keys from APK (Android Package) files

For technical details, check out my thesis (Automatic extraction of API Keys from Android applications) and, in particular, Chapter 3 and 4 of the work.

The library responsible for identifying the API Keys is a standalone project.

Searches for API Keys embedded in Android String Resources, Manifest metadata, Java code (included Gradle's BuildConfig), Native code.

Requirements

  • Java 7+
  • Python 3.5+
  • Modules in requirements.txt (use pip3 to install)
pip3 install -r requirements.txt

Installation

$ git clone --recursive https://github.com/alessandrodd/apk_api_key_extractor.git
$ cd apk_api_key_extractor
$ cp config.example.yml config.yml
$ pip3 install -r requirements.txt
$ python3 main.py

Test

$ git clone https://github.com/alessandrodd/ApiKeyTestApp.git
$ cd apk_api_key_extractor
$ python3 main.py --analyze-apk ../ApiKeyTestApp/apk/apikeytestapp_obfuscated.apk

Usage

usage: main.py [-h] [--debug] [--analyze-apk APK_PATH] [--monitor-apks-folder]

A python program that finds API-KEYS and secrets hidden inside strings

optional arguments:
  -h, --help            show this help message and exit
  --debug               Print debug information
  --analyze-apk APK_PATH
                        Analyze a single apk to find hidden API Keys
  --monitor-apks-folder
                        Monitors the configured apks folder for new apks. When
                        a new apk is detected, the file is locked and analysis
                        starts.

Let's say you want to find any API Key hidden inside a set of Android apps.

Using the default settings:

  • Copy all the desired .apk files to the apks folder
  • Start apk_api_key_extractor with the monitor-apks-folder argument, i.e. : python3 main.py --monitor-apks-folder
  • Check the apikeys.json file for detected API Keys
  • As soon as an apk is analyzed, it gets moved from the apks to the apks_analyzed folder

Note that this software is process-safe, meaning that you can start multiple instances of the same script without conflicts. You can also configure the apks folder as a remote folder in a Network File System (NFS) to parallelize the analysis on multiple hosts.

Run in a docker container

NOTE: make sure your .APK file is in the 'apks' folder.

$ git clone --recursive https://github.com/alessandrodd/apk_api_key_extractor.git
$ cd apk_api_key_extractor
$ docker build -t apk_key_extractor:latest .
$ docker run -it apk_key_extractor:latest

Rebuild your image when you've added other .apk's in your 'apks' folder.

Config File Explained

config.yml

apks_dir => The folder containing the .apk files to be analyzed

apks_decoded_dir => The folder that will temporarily contain the decompiled apk files

apks_analyzed_dir => The folder that will contain the already analyzed .apk files. Each time an APK is analyzed, it gets moved from the apks_folder to this folder

save_analyzed_apks => If false, the .apk files gets removed instead of being moved to the apks_analyzed folder

apktool => Path of the main apktool jar file, used to decode the apks

lib_blacklists => Txt files containing names of the native libraries (one for each line) that should be ignored during the analysis

shared_object_sections => When analyzing native libraries, all the ELF sections listed here will be searched for API Keys

dump_all_strings => If true, the script dumps not only API Keys but also every other string found in the APK. Useful to make a dataset of common not-api-key strings that can be used to train the model itself.

dump_location => Where to dump the API Keys found (as well as every other strin, if dump_all_strings is set to true). Possible values are console (stdout), jsonlines (text files in the jsonlines format), mongodb.

jsonlines.dump_file => Path of the jsonlines file where the API Keys will be dumped

jsonlines.strings_file => Path of the jsonlines file where the every string will be dumped, if dump_all_strings is true

mongodb.name => Used if key_dump is set to mongodb; name of the MongoDB database

mongodb.address => Address of the MongoDB database

mongodb.port => Port to which to contact the MongoDB database (default 27017)

mongodb.user => MongoDB database credentials

mongodb.password => MongoDB database credentials

Notes

I'm a curious guy; if you make something cool with this and you want to tell me, drop me an email at didiego.alessandro+keyextract (domain is gmail.com)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].