android ssl pinning bypass
1.0.0
一个Python脚本(以前的bash ),该脚本为HTTPS交通检查准备了Android APK(或AAB,XAPK)。
该脚本允许通过重建APK文件并使用户凭证存储信任通过重建Android> = 7绕过SSL固定。处理后,输出APK文件已准备好进行HTTPS流量检查。
如果AAB文件提供的脚本会创建通用APK并对其进行处理。如果XAPK文件提供了脚本并将其解压缩并处理每个APK文件。
在MacOS,Linux和Windows上工作。
[需要测试]窗口上的性能可能比MacOS / Linux低几次(〜3.5)( apktool需要更长的时间来解码APK)。
它:
java除外);bundletool (如果提供的AAB文件)或解开XAPK文件(如果XAPK);apktool解码APK文件;network_security_config.xml以使用户凭证存储保持信任;apktool编码新的APK文件;uber-apk-signer签名修补的APK文件。(可选)脚本允许:
adb将修补的APK文件直接安装到设备上;不需要根访问。
从下面的列表中安装工具:
adb的路径添加到路径环境变量)下面的工具将由脚本下载,以防其缺失:
前提:
pip3 install -r requirements.txt以安装所需的python模块脚本可以像
python3 /path/to/the/script/apk-rebuild.py
执行python3 apk-rebuild.py -h (或python3 apk-rebuild.py --help )以打印使用手册。
usage: apk-rebuild.py [-h] [-v] [-i] [--pause] [-p] [-r] [-o OUTPUT] [--no-src] [--only-main-classes] [--ks KS]
[--ks-pass KS_PASS] [--ks-alias KS_ALIAS] [--ks-alias-pass KS_ALIAS_PASS]
file
The script allows to bypass SSL pinning on Android >= 7 via rebuilding the APK file
and making the user credential storage trusted. After processing the output APK file
is ready for HTTPS traffic inspection.
positional arguments:
file path to .apk, .aab or .xapk file for rebuilding
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-i, --install install the rebuilded .apk file(s) via adb
--pause pause the script execution before the building the output .apk
-p, --preserve preserve the unpacked content of the .apk file(s)
-r, --remove remove the source file (.apk, .aab or .xapk) after the rebuilding
-o OUTPUT, --output OUTPUT
output .apk file name or output directory path (for .xapk source file)
--no-src use --no-src option when decompiling via apktool
--only-main-classes use --only-main-classes option when decompiling via apktool
--ks KS use custom .keystore file for .aab decoding and .apk signing
--ks-pass KS_PASS password of the custom keystore
--ks-alias KS_ALIAS key (alias) in the custom keystore
--ks-alias-pass KS_ALIAS_PASS
password for key (alias) in the custom keystore
为了重建APK文件,请使用参数。示例如下:
修补AAB文件,不要删除未包装的APK文件内容
python3 apk-rebuild.py input.aab --preserve
修补APK文件,修补后删除源APK文件,然后在Android设备上安装修补的APK文件
python3 apk-rebuild.py input.apk -r -i
源文件的路径必须指定为第一个参数。
<debug-overrides>元素添加到the network_security_config.xml (并添加android:networkSecurityConfig属性中的AndroidManifest.xml中的application元素) https://developer.android.com/training/articles/security-config#debug-overrides。对于错误报告,功能请求或讨论一个想法,请在此处打开问题。
非常感谢: