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()
댓글 달기