Google CTF 2018 - Shall We Play a Game?

Google CTF 2018 - 게임을 할까요?

htARTE (HackTricks AWS Red Team Expert)를 통해 제로에서 영웅까지 AWS 해킹을 배우세요 htARTE (HackTricks AWS Red Team Expert)!

HackTricks를 지원하는 다른 방법:

APK를 여기서 다운로드하세요:

APK를 https://appetize.io/ (무료 계정)에 업로드할 것입니다. APK가 어떻게 작동하는지 확인해보겠습니다:

플래그를 얻으려면 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?


Challenge description

The challenge was an Android APK file. The app presents you with a login screen, and after logging in, you are greeted with a screen that says "Shall we play a game?". There is a button to start the game, which when clicked, opens a new screen with a grid of numbers from 1 to 9.


Vulnerability

The vulnerability in this app was that the game screen allowed you to input any number, and when you clicked the "Check" button, it would tell you if the number was correct or not. By intercepting the traffic between the app and the server, you could see that the response from the server contained the flag.


Solution

To solve this challenge, you needed to intercept the traffic using a proxy tool like Burp Suite, send a request with a specific number, intercept the response, and extract the flag from the response. The flag was in the format CTF{...}.

if-eq v0, v9, :cond_2

Android 팬테스트 단계를 따라 APK를 다시 컴파일하고 서명합니다. 그런 다음 https://appetize.io/에 업로드하고 결과를 확인해 봅시다:

완전히 해독되지 않은 채로 플래그가 작성된 것으로 보입니다. 아마도 m() 함수를 100만 번 호출해야 할 것입니다.

이를 수행하는 다른 방법은 명령을 변경하지 않고 비교 명령을 변경하는 것입니다:

또 다른 방법은 1000000과 비교하는 대신 값이 1로 설정되도록 하여 this.o가 1과 비교되도록 하는 것입니다:

네 번째 방법은 v9(1000000)의 값을 v0 _(this.o)_로 이동하는 명령을 추가하는 것입니다:

해결책

첫 번째로 이기면 응용 프로그램이 루프를 100,000번 실행하도록 만듭니다. 이를 위해 :goto_6 루프를 생성하고 응용 프로그램이 **this.o**가 100,000이 아닌 경우 거기로 점프하도록 만들어야 합니다:

이것은 물리적 장치 내에서 수행해야 합니다(왜인지는 모르겠습니다) 가상 장치에서는 작동하지 않습니다.

Last updated