Google CTF 2018 - Shall We Play a Game?

Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)!

Drugi načini podrške HackTricks-u:

Preuzmite APK ovde:

Nameravam da postavim APK na https://appetize.io/ (besplatan nalog) da vidim kako se apk ponaša:

Izgleda da morate pobediti 1000000 puta da biste dobili zastavu.

Prateći korake iz pentesting Android možete dekompajlirati aplikaciju da biste dobili smali kod i pročitali Java kod koristeći jadx.

Čitanje Java koda:

Izgleda da je funkcija koja će odštampati zastavu m().

Smali promene

Poziv funkcije m() prvi put

Napravimo aplikaciju da pozove m() ako je promenljiva this.o != 1000000, da bismo to uradili, samo promenite uslov:

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 understanding how it works.

Initial analysis

Upon launching the app, we are presented with a simple interface containing a button that says "Play". Tapping on the button triggers a series of actions, which we need to analyze to uncover any potential vulnerabilities.

Reverse engineering

To understand the app's inner workings, we can decompile the APK file using tools like JADX or apktool. By examining the decompiled code, we can identify any suspicious or interesting functions that might lead us to the flag.

Finding the flag

After analyzing the app's code, we discover a hidden function that reveals the flag when called with the correct input. By interacting with the app and triggering this function, we can successfully retrieve the flag and complete the challenge.

Conclusion

Through reverse engineering and careful analysis of the Android application, we were able to uncover the hidden flag and solve the Google CTF 2018 challenge.

if-eq v0, v9, :cond_2

Pratite korake pentest Androida da biste ponovo kompajlirali i potpisali APK. Zatim ga otpremite na https://appetize.io/ i vidimo šta će se desiti:

Izgleda da je zastava napisana bez potpune dešifrovanosti. Verovatno bi trebalo pozvati funkciju m() 1000000 puta.

Drugi način da se ovo uradi je da se ne menja instrukcija već da se promene upoređene instrukcije:

Još jedan način je umesto upoređivanja sa 1000000, postaviti vrednost na 1 tako da se this.o upoređuje sa 1:

Četvrti način je dodavanje instrukcije za premeštanje vrednosti v9(1000000) u v0 (this.o):

Rešenje

Naterajte aplikaciju da izvrši petlju 100000 puta kada pobedite prvi put. Da biste to uradili, samo treba da kreirate :goto_6 petlju i naterate aplikaciju da skoči tamo ako this.o nema vrednost 100000:

Ovo morate uraditi na fizičkom uređaju jer (ne znam zašto) ovo ne funkcioniše na emuliranom uređaju.

Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)!

Drugi načini podrške HackTricks-u:

Last updated