The following tweet popped up in my feed recently and for some reason it piqued my interest. Hey don't judge me :)
Tweet Behind This Post |
Environment
My environment was as follows:
- Jailbroken iPhone 5S running iOS 9.3.3
- IDA Pro
- BurpSuite
- Frida
Jailbreak Detection
I installed the app and launched it on my jailbroken device at which point I was presented with the following screen:
Jailbreak Detection |
Obtaining The Binary via Dumpdecrypted |
Jailbreak artefacts |
isValid Snippet |
Jailbreak Bypass
Bypassing the check is trivial. The function returns a boolean value - bool __cdecl -[BMDevice isValid](BMDevice *self, SEL) - so whatever it returns we just need to flip it. For this we turn to Frida. The next step is to determine the app identifier and for that you issue frida-ps -Uai
Process List via Frida |
Determining Return Value |
if(ObjC.available){
var auth = ObjC.classes.BMDevice["- isValid"];
Interceptor.attach(auth.implementation, {
onLeave: function onLeave(retval) {
console.log("\t[-] Type of return value: " + typeof retval);
console.log("\t[-] Original Return Value: " + retval);
}
});
}
The bypass then is simply to flip the return value from 0 to 1:
if(ObjC.available){
var auth = ObjC.classes.BMDevice["- isValid"];
Interceptor.attach(auth.implementation, {
onLeave: function onLeave(retval) {
console.log("\t[-] Type of return value: " + typeof retval);
console.log("\t[-] Original Return Value: " + retval);
newretval = ptr("0x1")
retval.replace(newretval)
console.log("\t[-] New Return Value: " + newretval)
}
});
}
And with that the jailbreak detection is bypassed.
Authorization
With the jailbreak detection bypassed the next step was to examine the traffic. The app presents the following login screen:
Login |
Sample Requests |
Basic Authorization |
This brings up an interesting observation, apart from redirecting you to the login screen, the logout functionality shown below really doesn't do much, does it?
Logout |
Another interesting thing was that if the app didn't recognize the device you were logging in from you would be sent a confirmation a code. Fair enough. Now let's say I somehow captured someone's credentials and attempted to log in from my own device. The victim would receive an SMS message with the code and since I as the attacker don't have access to their device, the victim would simply ignore it and carry on, because after all whoever is trying to access their account doesn't have the 6 digit pin.
Confirm Flow |
Server Response Incorrect Code |
Forged Success |
Connected Device Bypass
Another feature of Privates! is that it doesn't allow you to view messages if the device is connected(read connected via usb). If the device is connected, trying to read a message results in the following message:
Device Connected Error |
updateWithUSBMessage Responsible For Displaying Message |
handleConnectionChange Method |
Checking Battery State |
var device = ObjC.classes.BMMessageConnectionViewController["isDeviceDiconnected"];
Interceptor.attach(device.implementation, {
onLeave: function onLeave(retval) {
console.log("\t[-] DeviceConnected Type of return value: " + typeof retval);
console.log("\t[-] DeviceConnected Original Return Value: " + retval);
newretval = ptr("0x1")
retval.replace(newretval)
console.log("\t[-] DeviceConnected New Return Value: " + newretval)
}
});
And with that the check is bypassed and we can carry on. One thing to note here is that the isDeviceDiconnected method is a class method(+ class method, - instance method).
Viewing Timer Bypass
So I hinted at this earlier. The sender of the message has the option of specifying the Viewing Period of the message:
Setting Viewing Period |
Setting Viewing Duration |
Extended Viewing |
Even more interesting is that the sender can specify the actions the recipient has to take before being able to view the message. These actions are defined as Security Options - security_options": ["touch", "motion", "camera"]. Camera means a picture is taken, motion means you have to hold the device a particular way and touch is exactly that - you have to tap the screen. Again you can edit this list and remove the actions you don't want to perform and the sender would be none the wiser.
Unhandled Exceptions
In some instances, the app returned some rather, dare I say "helpful" error messages:
Verbose Errors |
Conclusion
In the end you use these apps at your own risk. The app definitely has areas that it needs to improve on. I didn't even bother getting into the crypto because this was just some weekend fun(the real reason is crypto is hard). I am sure there are other areas to look at - as I said earlier this was by no means an in-depth review - and if you are so inclined this post should have provided enough information for you to go further. At the very least it should have provided some food for thought.
Until next time....Happy Hacking!!!
Disclaimer: This blog is intended for educational purposes only. Any actions and or activities related to the material contained within this Website is solely your responsibility.The misuse of the information in this website can result in criminal charges brought against the persons in question. This author will not be held responsible in the event any criminal charges be brought against any individuals misusing the information in this website to break the law.
"Exposing your privates" is a phrase that highlights the critical importance of online privacy. Godaddy Coupon Code In today's digital age, it is crucial to safeguard personal information and sensitive data from unauthorized access and misuse.
ReplyDelete