PayPay のリバースエンジニアリングに関するメモたち
-
-
Save Nerahikada/895e1435c9e5b21047f98e3249ef7d21 to your computer and use it in GitHub Desktop.
JADX というツールを使うとある程度 java のコードに直してくれる
apk ファイルを読み込ませるだけなので難しくない
Ctrl + Shift + F で特定の単語をapk全体から検索
- Windows 11
- 使うツールは全部 Linux 系の OS にも対応しているので Windows に縛る必要はない
- root 化済みの Android 端末
- 私が使用している環境については: https://gist.github.com/Nerahikada/4f13ca1b9fc99891a83e0ca7e1989748
Windows なら Android SDK Platform-Tools をダウンロードして PATH を通すのが楽
mitmproxy は一度起動しておく(CA 証明書を生成するため)
https://frida.re/docs/installation/
pip install frida-tools
Windows の場合は %Appdata%\Python\Python3XX\Scripts
に PATH を通す必要がある(XX はバージョン)
公式ドキュメント: https://frida.re/docs/android/
リリースページ から Android 用の frida-server をダウンロード、解凍して、ファイルの名前を frida-server
に変えておく
https://github.com/frida/frida/releases/download/16.2.1/frida-server-16.2.1-android-arm64.xz
PC と Android 端末を接続し以下のコマンドを実行
adb push <frida-server があるパス> /data/local/tmp/
adb shell "su -c chmod 755 /data/local/tmp/frida-server"
adb shell "su -c /data/local/tmp/frida-server &"
frida-ps -U
を実行してパッケージ一覧のようなものがいっぱい出てくれば正常に動作している
公式ドキュメント: https://github.com/httptoolkit/frida-interception-and-unpinning#android-getting-started-guide
- リポジトリ (https://github.com/httptoolkit/frida-interception-and-unpinning) をダウンロードもしくはクローン
config.js
ファイルを開き編集するCERT_PEM
は~/.mitmproxy/mitmproxy-ca-cert.pem
の内容に置き換えるPROXY_HOST
は PC のローカル IP アドレスPROXY_PORT
は8080
に変更
mitmproxy を起動してから次のコマンドを実行する
cd frida-interception-and-unpinning
frida -U -l ./config.js -l ./native-connect-hook.js -l ./native-tls-hook.js -l ./android/android-proxy-override.js -l ./android/android-system-certificate-injection.js -l ./android/android-certificate-unpinning.js -l ./android/android-certificate-unpinning-fallback.js -f jp.ne.paypay.android.app
図解 PAR : OAuth 2.0 Pushed Authorization Requests https://qiita.com/TakahikoKawasaki/items/97563be46b62a0e02fe6
Auth0を利用してOAuth 2.0のPKCEを理解する https://dev.classmethod.jp/articles/oauth-2-0-pkce-by-auth0/
OAuth2.0拡張仕様のPKCE実装紹介 〜 Yahoo! ID連携に導入しました https://techblog.yahoo.co.jp/entry/20191219790463/