메뉴 건너뛰기

app

[FRIDA] MicroTrend – Android – VirusClicker

lispro062016.10.31 23:25조회 수 1861댓글 0

  • 1
    • 글자 크기

http://0xecute.com/index.php/2015/11/11/microtrend-android-virusclicker/


Xposed 로 해결한 예제를 보고 FRIDA 를 이용했다.


조건문으로 해결하려 했으나, 잘 되지 않아, 수동으로 클릭 수를 바꾸며 임계치 까지는 도달했다.


그런데 assertion 이 발생하여, 답이 보이지 않는다.


if ((3769 == this.g) || (10007 == this.g) || (59239 == this.g) || (100003 == this.g) || (495221 == this.g) || (1000003 == this.g) || (9999999 == this.g))


파일 중에 위와 같이 중간 값을 체크하여 SCORE 인텐트를 실행하는 부분이 있어, 해당 값을 배열로 하여 접근 했는데, MainPreferences.xml 파일에 DATA 태그 값으로 특정 내용이 저장된다.


base64decode 로 나중에 조합하는데, 


  public b(Context paramContext, String paramString)

  {

    super(paramContext);

    this.b.addCallback(this);

    this.g = (paramString + "MT");

  }

    

  public void a()

  {

    this.f = (this.g + "BN" + com.tm.ctf.clicker.a.a.e());

    this.f = com.tm.ctf.clicker.b.a.a(this.f);

  }

  


위 두개의 함수에서 MTBN 이 앞에 붙는다. MainPreferences.xml 파일에 저장되어 있는 Q2xpY2tz 값과 합쳐서 base64decode 하면 문제에서 요구하는 10MClicks 까지는 찾을 수 있다.


write_up 에서는  String str2 = "TMCTF{" + this.f + "}"; 에 대한 결과로 TMCTF{Congratus_10MClicks} 인데, Congratus 는 어디서 concat 되는지 모르겠다.



import frida,sys

 

def print_result(message):

            print ("")

 

def on_message(message, data):

    if message['type'] == 'send':

        print("1")

    else:

        print("2")

 

jscode = """

 

Java.perform(function () {

    // Function to hook is defined here

    var MainActivity = Java.use('com.tm.ctf.clicker.activity.c');

var l=0;

var i=0;

var arr=[0, 3768,10006, 59238,100002, 495220, 1000002, 9999998,9999999,10000000];

    // Whenever button is clicked

    MainActivity.onTouchEvent.implementation = function (v) {

        // Show a message to know that the function got called

        send('onTouchEvent');

        // Call the original onClick handler

        this.onTouchEvent(v);


this.g.value = arr[7];

/* if(i%2){

this.g.value = this.g.value+1;

}else{

this.g.value = arr[l];

l++;

}

i++;*/

console.log('Done:' + JSON.stringify(this.g));

    };

});

"""

 

process = frida.get_usb_device().attach('com.tm.ctf.clicker')


script = process.create_script(jscode)

script.on('message', on_message)

 

print ("[*] clicker")

 

script.load()

sys.stdin.read()

lispro06 (비회원)
  • 1
    • 글자 크기
[FRIDA] return 값 출력하기 (by lispro06) [FRIDA] 외부 접근 경로 및 메소드 추출 예제 (by lispro06)

댓글 달기

suritam9
2021.12.15 조회 321
suritam9
2019.04.05 조회 2069
suritam9
2019.03.07 조회 311
suritam9
2019.03.06 조회 750
lispro06
2018.03.21 조회 855
lispro06
2018.03.16 조회 1955
lispro06
2017.11.27 조회 6512
lispro06
2017.07.16 조회 1736
lispro06
2017.06.22 조회 1931
lispro06
2016.11.02 조회 1712
lispro06
2016.11.01 조회 7492
lispro06
2016.10.27 조회 4214
lispro06
2016.10.27 조회 3009
lispro06
2016.10.27 조회 4007
lispro06
2016.10.27 조회 2667
lispro06
2015.11.20 조회 1627
첨부 (1)
VirusClicker.apk
231.2KB / Download 53
위로