SSL Pinning Bypass

SSL Pinning Bypass yapmak için aşağıdaki depodan android için yapılmış olan frida-serverx86-64 dosyasını buluyoruz.

Frida: https://github.com/frida/frida

İndirdiğimiz dosyanın ismini frida-server yapıyoruz ve aşağıdaki komutları çağırıyoruz. Bu komutlar ile frida-server dosyası android üzerine kopyalanmış oldu.

adb push frida-server /data/local/tmp
adb push cert-der.crt /data/local/tmp/cert-der.crt

adb shell chmod 777 /data/local/tmp/frida-server
adb shell chmod 777 /data/local/tmp/cert-der.crt

Şimdi aşağıdaki komutlar ile frida-server dosyasını çalıştırıyoruz.

adb shell
su
./data/local/tmp/frida-server&

Frida-server'ı çalıştırdıktan sonra aşağıdaki araçları yüklüyoruz. Eğer python yüklü değilse yüklememiz gerekiyor.

pip install frida-tools objection
frida-ps -Uia
frida -U -f <identifier> -l ssl.js -l root.js

Aynı işlemi objection ile de yapabilirsiniz.

objection -g <identifier> explore
objection -g 20769 explore
import ssl.js
android hooking list activities
android intent launch_activity

Global Proxy

# Aktif
adb shell settings put global http_proxy 192.168.1.6:8080
adb shell settings put global https_proxy 192.168.1.6:8080

# Kapalı
adb shell settings put global http_proxy :0

Frida Hook

Java.perform(function() {
    var Log = Java.use("android.util.Log");
    Log.d.overload('java.lang.String', 'java.lang.String', 'java.lang.Throwable').implementation = function(a, b, c) {
        console.log("The application reports Log.d(" + a.toString() + ", " + b.toString() + ")");
        return this.d(a, b, c);
    };
    Log.v.overload('java.lang.String', 'java.lang.String', 'java.lang.Throwable').implementation = function(a, b, c) {
        console.log("The application reports Log.v(" + a.toString() + ", " + b.toString() + ")");
        return this.v(a, b, c);
    };

    Log.i.overload('java.lang.String', 'java.lang.String', 'java.lang.Throwable').implementation = function(a, b, c) {
        console.log("The application reports Log.i(" + a.toString() + ", " + b.toString() + ")");
        return this.i(a, b, c);
    };
    Log.e.overload('java.lang.String', 'java.lang.String', 'java.lang.Throwable').implementation = function(a, b, c) {
        console.log("The application reports Log.e(" + a.toString() + ", " + b.toString() + ")");
        return this.e(a, b, c);
    };
    Log.w.overload('java.lang.String', 'java.lang.String', 'java.lang.Throwable').implementation = function(a, b, c) {
        console.log("The application reports Log.w(" + a.toString() + ", " + b.toString() + ")");
        return this.w(a, b, c);
    };
    Log.d.overload('java.lang.String', 'java.lang.String').implementation = function(a, b) {
        console.log("The application reports Log.d(" + a.toString() + ", " + b.toString() + ")");
        return this.d(a, b);
    };
    Log.v.overload('java.lang.String', 'java.lang.String').implementation = function(a, b) {
        console.log("The application reports Log.v(" + a.toString() + ", " + b.toString() + ")");
        return this.v(a, b);
    };

    Log.i.overload('java.lang.String', 'java.lang.String').implementation = function(a, b) {
        console.log("The application reports Log.i(" + a.toString() + ", " + b.toString() + ")");
        return this.i(a, b);
    };
    Log.e.overload('java.lang.String', 'java.lang.String').implementation = function(a, b) {
        console.log("The application reports Log.e(" + a.toString() + ", " + b.toString() + ")");
        return this.e(a, b);
    };
    Log.w.overload('java.lang.String', 'java.lang.String').implementation = function(a, b) {
        console.log("The application reports Log.w(" + a.toString() + ", " + b.toString() + ")");
        return this.w(a, b);
    };

});
am start -n com.example.myapplication/com.example.myapplication.AccountPage

Last updated

Was this helpful?