hacktricks/mobile-pentesting/android-app-pentesting/google-ctf-2018-shall-we-play-a-game.md

4.3 KiB
Raw Blame History

Google CTF 2018 - 我们来玩个游戏吧?

从零开始学习AWS黑客技术成为专家 htARTEHackTricks AWS红队专家

支持HackTricks的其他方式

在此下载APK

我将上传APK到https://appetize.io/免费账户以查看APK的行为

看起来您需要赢得1000000次才能获得flag。

按照Android渗透测试中的步骤您可以反编译应用程序以获取smali代码并使用jadx读取Java代码。

阅读Java代码

看起来打印flag的函数是 m().

Smali更改

第一次调用m()

让应用程序在变量 this.o != 1000000 时调用m(),只需更改条件:

if-ne v0, v9, :cond_2

Google CTF 2018: Shall we play a game?


Task 1: Install the APK

  1. Download the APK from the challenge page.
  2. Install the APK on your Android device.

Task 2: Explore the app

  1. Open the app and explore its functionalities.
  2. Use tools like APKTool, JADX, and JEB to analyze the APK.
  3. Look for interesting strings, APIs, and endpoints.

Task 3: Analyze the network traffic

  1. Use tools like Burp Suite or Wireshark to intercept and analyze the app's network traffic.
  2. Look for any sensitive information being transmitted.
  3. Identify any potential security vulnerabilities in the network communication.

Task 4: Reverse engineering

  1. Use tools like JADX, Ghidra, or IDA Pro to reverse engineer the APK.
  2. Analyze the app's code and look for vulnerabilities or backdoors.
  3. Try to understand the app's logic and how it handles user input.

Task 5: Exploit the app

  1. Exploit any vulnerabilities found during the analysis.
  2. Try to bypass any security mechanisms implemented in the app.
  3. Gain unauthorized access or control over the app.

Task 6: Get the flag

  1. Find and extract the flag from the app.
  2. Submit the flag to complete the challenge.

By completing these tasks, you will gain a better understanding of Android app pentesting and hone your skills as a mobile security professional. Good luck!

if-eq v0, v9, :cond_2

之前

之后

按照Android渗透测试的步骤重新编译并签署APK。然后将其上传到https://appetize.io/,看看会发生什么:

看起来旗标是未完全解密就被写入的。可能应该调用m()函数1000000次。

另一种方法是不更改指令,而是更改比较指令:

另一种方法是将值与1000000进行比较将值设置为1以便将this.o与1进行比较

第四种方法是添加一条指令将v9(1000000)的值移动到v0 (this.o)

解决方案

当您第一次获胜时使应用程序运行循环100000次。为此您只需要创建**goto_6循环,并使应用程序跳转到那里,如果this.o**的值不是100000\

您需要在物理设备内执行此操作,因为(我不知道为什么)在模拟设备中无法正常工作。