apk-mitm

授权协议 MIT License
开发语言 JavaScript
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 程沛
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

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:

You can also use apk-mitm to patch apps using Android App Bundle and rooting your phone is not required.

Installation

If you have an up-to-date version of Node.js (14+) and Java (8+), you can install apk-mitm by running:

$ npm install -g apk-mitm

Usage

Once installed, you can run this command to patch an app:

$ apk-mitm <path-to-apk>

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

$ apk-mitm example.apk

  ✔ Decoding APK file
  ✔ Modifying app manifest
  ✔ Replacing 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.

Patching App Bundles

You can also patch apps using Android App Bundle with apk-mitm by providing it with a *.xapk file (for example from APKPure) or a *.apks file (which you can export yourself using SAI). If you're doing this on Linux, make sure that both zip and unzip are installed.

Making manual changes

Sometimes you'll need to make manual changes to an app in order to get it to work. In these cases the --wait option is what you need. Enabling it will make apk-mitm wait before re-enconding the app, allowing you to make changes to the files in the temporary directory.

If you want to experiment with different changes to an APK, then using --wait is probably not the most convenient option as it forces you to start from scratch every time you use it. In this case you might want to take a look at APKLab. It's an Android reverse engineering workbench built on top of VS Code that comes with apk-mitm support and should allow you to iterate much more quickly.

Allowing specific certificates

On some devices (like Android TVs) you might not be able to add a new certificate to the system's root certificates. In those cases you can still add your proxy's certificate directly to the app's Network Security Config since that will work on any device. You can accomplish this by running apk-mitm with the --certificate flag set to the path of the certificate (.pem or .der file) used by your proxy.

Caveats

  • 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 run apk-mitm with the --wait option to be able to replace the com.google.android.geo.API_KEY value 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. If you happen to find an Apktool version that's not affected by the issue, you can instruct apk-mitm to use it by specifying the path of its JAR file through the --apktool option.

Thanks

License

MIT © Niklas Higi

  • 我们在开发Android App时,会签名打包Apk,然后上传到市场。在这个过程中,必然会有一些值得留意的安全性问题来让我们避免自己的App里的关键信息泄露。 1、API安全性 现在不管是XX云还是XX云,都提供了443端口以及免费证书的签发,即便没有使用他们的证书,也可以使用Let's Encrypt来为我们签发一个域名对应的数字证书,作为TLS加密用证书,因此我们可以方便的升级接口为HTTPS

  • 前言 不能使用电视盒子的adb等,只好通过在电视盒子下载apk时动脑筋。原打算arpspoof+wireshark分析电视盒子下载apk的uri,然后想办法在途中替换掉apk文件,后来发现可以直接用ettercap进行arp毒害和替换所有apk。 过程 9.8 Arpspoof工具 arpspoof是dsniff的一部分,该工具用于ARP毒害,未能满足需求 第八章 中间人攻击主要讲了etterca

 相关资料
  • Backdoor-apk可以看成是一个shell脚本程序,它简化了在Android APK文件中添加后门的过程。安全研究人员在使用该工具前应该对Linux、Bash、Metasploit、Apktool、Android SDK 、smali有所了解,同时原作者表示该工具仅仅供研究和学习使用。 制作好的apk文件应该在original/dist目录下找到,将其安装在测试设备上,然后设置好IP以及端口

  • chromeos-apk 可以让你的 Android 的 APK 文件在 Chrome OS 和 Chrome 下运行。

  • 一步到位反编译apk工具(onekey decompile apk) 功能 集成apktool/dex2jar/jd-gui 只需执行一步即可反编译出apk所有文件(资源文件和jar等等) 打开jd-gui反编译jar文件 使用方法 在Downloads中下载onekey-decompile-apk.zip, 解压缩到类似D:\downloads\onekey-decompile-apk 将apk

  • 这是一个使用gradle的Android应用程序。点击运行后,我找到了APP_V1。3.4_2016-02-22