News for hackers. Stuff that matters.
Re:Reverse Engineering Snapchat: Obfuscation Techniques by zelly on Wednesday June 17, 2020 @08:29PM (#23558500)
Snapchat is notoriously difficult to automate/spam.

The goal is to get the X-Snapchat token. The most elegant solution is to find the secret in the binary and reverse the algorithm to generate tokens. Wouldn't it be easier to MITM the endpoint; set up a dummy server (which collects tokens) in front of a proxy that spoofs the DNS and TLS certs (may be easier on rooted Android than iOS).

In my last attempt I gave up and went for dumb UI automation, but it would be cool (and worth good money) to exploit the private API.

Re:Reverse Engineering Snapchat: Obfuscation Techniques by mox1 on Wednesday June 17, 2020 @08:59PM (#23558671)
Certificate pinning spoils that, no spoofing of certs with pinning.

Cert (or hash of) delivered with app. If server cert doesn't match expected value coded into app, someone is messing with something, terminate connection.

Re:Reverse Engineering Snapchat: Obfuscation Techniques by zelly on Wednesday June 17, 2020 @09:12PM (#23558751)
Yes that complicates things. But if you can find the cert in the binary's data section, maybe you can patch it with your own.
Re:Reverse Engineering Snapchat: Obfuscation Techniques by __float on Wednesday June 17, 2020 @11:39PM (#23559588)
This probably runs into the same issue mentioned in the article, where the checksums are wrong and you end up in an infinite loop.
Re:Reverse Engineering Snapchat: Obfuscation Techniques by brendonjohn on Thursday June 18, 2020 @12:51AM (#23559891)
Assuming this is for Android, the APK would no longer be signed and would cause all login attempts to fail.

Have a read about "SafetyNet Attestion API" for Android.

Re:Reverse Engineering Snapchat: Obfuscation Techniques by IAmLiterallyAB on Thursday June 18, 2020 @01:02AM (#23559937)
You could patch Android and run it in an emulator. Or patch Snap not to care. Not super familiar, but there should be a way. Client side security can only do so much.
Re:Reverse Engineering Snapchat: Obfuscation Techniques by looperhacks on Thursday June 18, 2020 @01:51AM (#23560155)
You can't patch Snap to not care because the safetynet process is (roughly) like that: The App asks the Play libraries whether the phone is okay. This is verified (in part) on the Google servers, so the Snap servers can ask Google whether a call came from a non-tampered phone. The client can't do anything about it, except tricking google into believing the phone is not tampered with. Which is notoriously hard, because nobody knows how the process really works.
Re:Reverse Engineering Snapchat: Obfuscation Techniques by ss3000 on Thursday June 18, 2020 @04:17AM (#23560935)
In my experience, SafeteyNet bypass on rooted devices has been a solved problem for a long time through Magisk Hide.
Re:Reverse Engineering Snapchat: Obfuscation Techniques by pjmlp on Thursday June 18, 2020 @02:09AM (#23560245)
Except not all Android devices have Play Services, for example is Snap available in China?
Re:Reverse Engineering Snapchat: Obfuscation Techniques by amerine on Wednesday June 17, 2020 @09:03PM (#23558700)
Just don’t do something like only trust a specific CA cert. really-really pin to a leaf.
Re:Reverse Engineering Snapchat: Obfuscation Techniques by wallflower on Wednesday June 17, 2020 @09:02PM (#23558696)
My guess is the X-Snapchat is a one-time use token that changes on a per-call basis and may even been hashed to the actual data being sent in the API call. For example, if Snapchat is sending a pic that has a MD5 hash of X, the token somehow encodes that or other information so you cannot reuse that token.

I’m confident the security engineering team at Snap has all kinds of white hat teams to prove and probe the security constantly.

Re:Reverse Engineering Snapchat: Obfuscation Techniques by rvz on Wednesday June 17, 2020 @09:19PM (#23558784)
According to a old AppSec talk, they used a third-party security company to implement this stuff. They are a customer to a company called ‘Arxan Technologies’ that implements these ‘guards’ in their software. They’re very good at not revealing this, but it came up whilst looking at their private API.

These secret keys are there but heavily obfuscated and is nothing more than white-box cryptography which can be bypassed via emulation.

Re:Reverse Engineering Snapchat: Obfuscation Techniques by theincredulousk on Thursday June 18, 2020 @02:07AM (#23560234)
Worked with Arxan before. They are legit - what is described here is the tip of the iceberg. Haven’t even gotten into in-memory instruction and data encryption. If you’re dumping the binary you’re likely not even seeing all of what is executing at runtime