Skip to main content

OWASP crackme write up version 1 level 1 ∠( ᐛ 」∠)_ (day 9)


Hi guys ! sorry if have to gone for a while, i have to postponed the 100dayspentesing challenge to finished my bachelor thesis report and it took a lot of time to finish it. So because i have spare time before the final thesis test, i decide to do some stretching again with CTF challenge.

This time i take the the owasp crackme challenge level 01 (you can download it in the following link: https://github.com/OWASP/owasp-mstg/tree/master/Crackmes/Android/Level_01)

LET THE GAME BEGIN !

First of all, you need to setup a machine to install the owasp level 01 apk you can use your own devide or vm (just choose the most comfortable one) and after you decide which one to use, install it with adb utility:

~# adb install UnCrackable-Level1.apk






The above figure is the interface when you opened the installed apk. From first glance you can tell that we only need to find a secret string (so no fancy function that we need to explore).

At this point i just straightly reverse engineer the apk to get the source code using enjarify (convert .apk to .jar) and procyon decompiler (convert .jar to source code).

enjarify command:


procyon command:


I suggest you to use the tool that i mentioned earlier, i try to use dex2jar to convert .jar to the source code but its become confusing.

Go to the mainactivity.java file for analyzing the main function of the application. It is pretty cool that the application is equipped with root and debugging feature, the figure below is the code that responsible for those checking.


The mainactivity.java class has 3 function class one of that catch my attention is the verify function and from the below figure we could summarize that this function is responsible for matching the secret string.






let me explain more detail about what the code do. Really simple! it takes the input from the user and it calls the "a" function from "a" class to check whether its the right string. Lets analyze this "a" function.


The above figure is the code for the a function. It takes the user input and before it compare with the secret string, It decrypting the s2 variable (which is the secret string) with AES algorithm by calling the sg.vantagepoint.a.a.a function class. The function took two parameters, the encrypted string (s2) and the key (the decode variable). The result of the function will be decrypted text that will compare with user input.

Because you can tell we already get the key and the encrypted text, all we need to do is simply have to implement the decryption method of the application to any programming language. Well in this case i just straightly create an android application that decrypt the secret text.



 The above two figure is the code that i create to decrypt the secret text you can get the apk from the following link: https://github.com/acaciaworld80/100dayofpentesting/blob/master/level1_solve(day%209).apk. you can tell that i just copy the code from challenge 01 .apk to my application. Because why not ? technically we already get the answer right ?! lol


The above figure show the secret string of the application and when we insert it into the challenge 01 application like show in below figure, we get the right answer.







OK THAT'S ALL for this today post have a nice hacking weekend y'all.





Comments

Popular posts from this blog

Having fun analyzing nginx log to find malicious attacker in the net (ง'̀-'́)ง (day 37)

  What makes you sleepless at night? is it because of a ghost or scary stories? is it because you have an important meeting tomorrow? or is it because you have an exam? For me, what keeps me up all night is that I keep thinking about what happens to a website that I just created, is it safe from an attacker (certainly not) or did I missing some security adjustments that lead to vulnerability? well I'm not the best secure programmer in the world, I'm still learning and there is a big possibility that I can make a mistake but for me, a mistake can be a valuable investment to myself or yourself to be better so from this idea, I want to know more about what attackers casually do when attacking a website. Here in this post, I'm going to show you how I analyzed attack to the website that I have permission to design and also some interesting findings that I could get from the analysis Background: All of this analysis comes from the traffic that is targeted to th

Utilize Pwntools for crafting ROP chain :') (day 69)

who doesn't like pwntools? it is a very versatile tool and can be customized according to our need using the python script but did you need to know that pwntools itself can help us to automatically craft a rop chain for us? so in this post, I will show you how to make rop chain less painful and make pwntools do all the heavy lifting. To demonstrate this I will use the binary challenge callme 64 bit from ropemporium link: https://ropemporium.com/challenge/callme.html Crashing the app: Like any other exploitation process, we need to crash the program by generating a long string pattern to determine the offset. based on the information from the above figure we can see that we required to provide 40 bytes of offset Fun stuff: now this where the fun stuff began write the following python script: as in the guideline of the challenged said we need to chain the function call by first to call the callme_one function, callme_two function and then callme_three funct

WriteUp PWN tarzan ROP UNICTF ಠ_ಠ (day 61)

So in this post, I'm going to talk about how to solve the Tarzan pwn challenge from UNICTF 2019. Back in the day when the competition is still going I couldn't finish it and don't have any clue to solve this but this time I was able to finish it :) Also in this post, we will be going to be heavily focused on how to utilize pwntools to construct a ROP chain. If you kinda confused about my explanation in this post you can refer to this following youtube video, link: https://www.youtube.com/watch?v=gWU2yOu0COk I build the python script based on this video Ok, let's get started! In this challenge, you will get two binary first go with tarzan and libc-2.29.so by providing .so file it tell us what version library that the target machine is using this could help us to do ROP chain. first, we run the Tarzan binary to get the basic idea of the program work and as you can see it just show you some text, newline and when you try to input something it doesn't gi