Objection Tutorial
Bug bounty tip: sign up for Intigriti, a premium bug bounty platform created by hackers, for hackers! Join us at https://go.intigriti.com/hacktricks today, and start earning bounties up to $100,000!
Introduction
objection - Runtime Mobile Exploration
Objectionは、Fridaによって動作するランタイムモバイル探索ツールキットです。これは、脱獄またはルート化されたモバイルデバイスを必要とせずに、モバイルアプリケーションとそのセキュリティ姿勢を評価するのを助けることを目的に構築されました。
注意: これは脱獄/ルートバイパスの一形態ではありません。objection
を使用することで、直面している適用可能なサンドボックスによって課せられたすべての制限に依然として制約されます。
Resume
objectionの目標は、ユーザーがFridaが提供する主要なアクションを呼び出すことを可能にすることです。**そうでなければ、ユーザーはテストしたい各アプリケーションのために単一のスクリプトを作成する必要があります。
Tutorial
このチュートリアルでは、ここからダウンロードできるAPKを使用します:
またはそのオリジナルリポジトリから(app-release.apkをダウンロード)
Installation
Connection
通常のADB接続を行い、デバイスでfridaサーバーを起動します(クライアントとサーバーの両方でfridaが動作していることを確認します)。
ルート化されたデバイスを使用している場合は、_--gadget_オプション内でテストしたいアプリケーションを選択する必要があります。この場合:
基本アクション
このチュートリアルでは、objectionのすべてのコマンドはリストされず、私がより便利だと感じたものだけが含まれます。
環境
パスワードやパスなどの興味深い情報は、環境内に見つけることができます。
Fridaに関する情報
アップロード/ダウンロード
frida スクリプトのインポート
SSLPinning
ルート検出
Exec Command
スクリーンショット
静的分析を動的に
実際のアプリケーションでは、静的分析のおかげで、この部分で発見されたすべての情報を知っておくべきです。それでも、この方法では、クラス、メソッド、およびエクスポートされたオブジェクトの完全なリストのみが表示されるため、新しい何かを見ることができるかもしれません。
これは、アプリの読みやすいソースコードを取得できない場合にも役立ちます。
アクティビティ、レシーバー、およびサービスのリスト
Fridaが見つからない場合、エラーを発生させます
現在のアクティビティを取得する
クラスの検索
アプリケーション内のクラスを探し始めましょう。
クラスのメソッドを検索する
では、クラス MainActivity: 内のメソッドを抽出しましょう。
クラスの宣言されたメソッドとそのパラメータのリスト
クラスのメソッドが必要とするパラメータを確認しましょう:
クラスのリスト
現在のアプリケーション内で読み込まれたすべてのクラスをリストすることもできます:
これは、クラスのメソッドをフックしたいが、クラスの名前しか知らない場合に非常に便利です。この関数を使用して、クラスを所有するモジュールを検索し、そのメソッドをフックできます。
フックが簡単
メソッドのフック(監視)
アプリケーションのソースコードから、MainActivityの関数_sum()_が毎秒実行されていることがわかります。関数が呼び出されるたびに、すべての可能な情報(引数、戻り値、バックトレース)をダンプしてみましょう:
クラス全体をフックする(監視する)
実際、クラス MainActivity のすべてのメソッドが非常に興味深いと思いますので、すべてフックしましょう。注意してください、これによりアプリケーションがクラッシュする可能性があります。
If you play with the application while the class is hooked you will see when 各関数が呼び出されるか, its 引数 and the 戻り値.
関数のブール戻り値を変更する
From the source code you can see that the function checkPin gets a String as argument and returns a boolean. Lets make the function 常にtrueを返す:
Now, If you write anything in the text box for the PIN code you will see tat anything is valid:
クラスインスタンス
Search for and print 特定のJavaクラスのライブインスタンス, specified by a fully qualified class name. Out is the result of an attempt at getting a string value for a discovered objection which would typically オブジェクトのプロパティ値を含む.
Keystore/Intents
キーストアとインテントを使用して遊ぶことができます:
メモリ
ダンプ
リスト
リストの下部にはfridaが表示されています:
fridaが何をエクスポートしているか確認しましょう:
検索/書き込み
objectionを使用してメモリ内を検索および書き込むこともできます:
SQLite
SQLiteデータベースと対話するには、コマンドsqlite
を使用できます。
Exit
Objectionでの不足点
フッキングメソッドは時々アプリケーションをクラッシュさせます(これはFridaの影響でもあります)。
クラスのインスタンスを使用してインスタンスの関数を呼び出すことができません。また、新しいクラスのインスタンスを作成して関数を呼び出すこともできません。
アプリケーションで使用されている一般的な暗号メソッドをフックして、暗号化されたテキスト、平文、キー、IV、および使用されているアルゴリズムを見るためのショートカット(sslpinningのようなもの)がありません。
バグバウンティのヒント: ハッカーによって、ハッカーのために作られたプレミアム バグバウンティプラットフォーム Intigritiにサインアップしましょう!今日、https://go.intigriti.com/hacktricksに参加して、最大**$100,000**のバウンティを獲得し始めましょう!
Last updated