Coder Social home page Coder Social logo

akshayjaing / apk-mitm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shroudedcode/apk-mitm

0.0 1.0 0.0 36.35 MB

๐Ÿค– A CLI application that prepares Android APK files for HTTPS inspection

License: MIT License

JavaScript 0.51% TypeScript 99.49%

apk-mitm's Introduction

apk-mitm

A CLI application that automatically prepares Android APK files for HTTPS inspection

Inspecting a mobile app's HTTPS traffic using a proxy is probably the easiest way to figure out how it works. However, with the Network Security Configuration introduced in Android 7 and app developers trying to prevent MITM attacks using certificate pinning, getting an app to work with an HTTPS proxy has become quite tedious.

apk-mitm automates the entire process. All you have to do is give it an APK file and apk-mitm will:

Usage

If you have an up-to-date version of Node.js (8.2+) and Java (8+), you can run this command to patch an app:

$ npx apk-mitm <path-to-apk>

So, if your APK file is called example.apk, you'd run:

$ npx apk-mitm example.apk

  โœ” Decoding APK file
  โœ” Modifying app manifest
  โœ” Modifying network security config
  โœ” Disabling certificate pinning
  โœ” Encoding patched APK file
  โœ” Signing patched APK file

   Done!  Patched APK: ./example-patched.apk

You can now install the example-patched.apk file on your Android device and use a proxy like Charles or mitmproxy to look at the app's traffic.

Caveats

  • If you open the patched app on your phone and get a dialog saying The app is missing required components and must be reinstalled from the Google Play Store, then the app is using Android App Bundle. This means that installing it through an APK is not going to work regardless of whether it has been patched by apk-mitm or not.

  • If the app uses Google Maps and the map is broken after patching, then the app's API key is probably restricted to the developer's certificate. You'll have to create your own API key without restrictions and replace it in the app's AndroidManifest.xml file.

  • If apk-mitm crashes while decoding or encoding the issue is probably related to Apktool. Check their issues on GitHub to find possible workarounds.

Installation

The above example used npx to download and execute apk-mitm without local installation. If you do want to fully install it, you can do that by running:

$ npm install -g apk-mitm

Thanks

License

MIT ยฉ Niklas Higi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.