Live data from Hacker News

Reverse Engineering Snapchat: Obfuscation Techniques

hot3eed.github.io

101–110 of 180 posts

Re: Reverse Engineering Snapchat: Obfuscation Techniques

#102
post #23

Philosophically I never gave much thought to securing app client code. Why not just track usage stats and ban clearly fake/high throughput users?

If an attacker can mess around with their private API, that attacker can find a vulnerability. If an attacker finds a vulnerability, the attacker can steal user data. Consider the average age of the users and then consider what could happen to the company if they have a data breach. Who knows, it may have already happened, and that's why they are so serious about it now.

Re: Reverse Engineering Snapchat: Obfuscation Techniques

#103

This is brilliant work, I'm hoping in part II we get to see it working against the API. I reverse engineered this in a production environment. It took approximately 7 months to build a scalable solution. The investigation on how to create the x-snapchat-client-auth token is brilliant. One day I hope to do a talk on what my old team did to circumvent it. There's a painful gotcha on the homestretch for this token: You…

I think edge node is just checking if x-snapchat-client-auth valid, without checking if x-snapchat-client-auth is valid for this request. The second check is probably done at deeper level.

Re: Reverse Engineering Snapchat: Obfuscation Techniques

#104

I’m surprised that no one has mentioned how this is actually accomplished. The answer is: largely automatically, at the compiler level. Snapchat acquired Obfuscator-LLVM and the people behind it in 2017, which was actually partially open source for a period of time. It is a compiler backend for LLVM that obfuscates your code for you. You can read a bit about some of the techniques used on their old wiki: https://gith…

Funny thing about things like that is that you can likely write tools to automatically deobfuscate, if you know the mechanisms. Of course, this takes time and effort, and is beyond most spammers' capabilities.

That works if the obfuscating patterns are all straightforward like a regular grammar. But if it's not possible to distinguish an obfuscation from genuine code, that could quickly become intractable (NP).

Re: Reverse Engineering Snapchat: Obfuscation Techniques

#105
post #35

This is some pretty heavy-duty obfuscation. What is the business case for this amount of work towards preventing reverse-engineering? Decent rate limiting should be much more effective than making such a herculean effort to obfuscate one's API. Edit: another comment mentions that snap chat uses an existing solution, which makes more sense than the expense of developing this sort of obfuscation in-house: https://news.…

Specifically, Snapchat wants to stop "tweaks" and alternate frontends that allow for bypassing of Snapchat's self destruction controls.

This is especially important given that Snapchat is widely used to trade amateur underaged pornography.

Re: Reverse Engineering Snapchat: Obfuscation Techniques

#106
post #5

Doesn't Snapchat mainly rely upon the iOS or Android platform having some software that prevents screen shots if a 'no screen shots' flag is set? I always thought this was their core defense.

This is also trivially bypassed by the following technique:

1. Open the Snapchat app for a bit so it is downloaded / cached.

2. Turn on Airplane mode.

3. Screenshot and screen record to your desire.

4. Delete the whole app.

5. Turn off Airplane mode and download the app again.

Re: Reverse Engineering Snapchat: Obfuscation Techniques

#107
Seems like hooking the UI layer and intercepting data on the wire would be a much simpler approach. I wouldn't even try to circumvent the UI flow or animations. The more 'user-like' the activity, the more difficult it is to distinguish automation from human traffic. This doesn't scale as well well as many would like, but it can work. You could probably bundle something like this up and resell it as a grey-market API.

There may be some money in standing up a datacenter that is filled almost exclusively with smartphones.

Re: Reverse Engineering Snapchat: Obfuscation Techniques

#110
post #16

Earlier quoted context omitted.

OP here. About half are off the shelf. Joint functions, the breakpoint infinite loop, in-house memmove, the overflowing thing, those I haven’t read about anywhere before.

> the breakpoint infinite loop This is a fairly standard debugging technique. > in-house memmove You sure they didn't just statically link a libc?

> the breakpoint infinite loop

Have seen multiple times in CTFs

Post reply on HN