Google CTF 2018 - Shall We Play a Game?

Google CTF 2018 - ゲームをしましょうか?

**htARTE (HackTricks AWS Red Team Expert)** から **ゼロからヒーローまでAWSハッキングを学ぶ**!

HackTricks をサポートする他の方法:

APKはこちらからダウンロードできます:

APKをアップロードして、APKの動作を確認するために https://appetize.io/(無料アカウント)にアップロードする予定です:

フラグを取得するには1000000回勝つ必要があるようです。

pentesting Android の手順に従って、アプリケーションを逆コンパイルしてsmaliコードを取得し、jadxを使用してJavaコードを読み取ることができます。

Javaコードを読む:

フラグを印刷する関数は m(). のようです。

Smaliの変更

最初のm()の呼び出し

アプリケーションが this.o != 1000000 の場合にm()を呼び出すようにしましょう。そのために、条件を変更するだけです:

if-ne v0, v9, :cond_2

Google CTF 2018: Shall we play a game?


Introduction

In this challenge, we are provided with an Android application named "Shall we play a game?". The goal is to find the flag by analyzing the app's behavior and identifying any vulnerabilities that can be exploited.

Reconnaissance

APK Analysis

  1. Decompiling the APK: Use tools like JADX or apktool to decompile the APK file and analyze the source code.

  2. Static Analysis: Look for hard-coded secrets, sensitive information, or any suspicious code that could lead to vulnerabilities.

  3. Dynamic Analysis: Run the application in a controlled environment to observe its behavior at runtime.

Exploitation

  1. Identifying Vulnerabilities: Exploit common vulnerabilities like insecure storage, input validation issues, or insecure communication.

  2. Reverse Engineering: Reverse engineer any obfuscated code to understand its functionality and identify potential attack vectors.

  3. Exploiting the Flag: Once a vulnerability is identified, exploit it to retrieve the flag and complete the challenge.

By following these steps and leveraging your hacking skills, you can successfully complete the Google CTF 2018 challenge "Shall we play a game?" and enhance your penetration testing capabilities.

if-eq v0, v9, :cond_2

pentest Androidの手順に従ってAPKを再コンパイルして署名します。その後、https://appetize.io/にアップロードして何が起こるか見てみましょう:

フラグが完全に復号化されずに書かれているようです。おそらくm()関数を1000000回呼び出す必要があります。

これを行う別の方法は、命令を変更せずに比較される命令を変更することです:

別の方法は、1000000と比較する代わりに、値を1に設定してthis.oが1と比較されるようにすることです:

4番目の方法は、v9(1000000)の値をv0 (this.o) に移動する命令を追加することです:

解決策

アプリケーションが最初に勝利したときにループを100000回実行するようにします。これを行うには、:goto_6 ループを作成し、アプリケーションが this.o の値が100000でない場合にそこにジャンプするようにします:

これは物理デバイス内で行う必要があります(なぜかはわかりませんが、エミュレートされたデバイスでは機能しません)。

htARTE (HackTricks AWS Red Team Expert) で **ゼロからヒーローまでのAWSハッキングを学びましょう**!

HackTricks をサポートする他の方法:

Last updated