A Crypto Trick That Makes Software Harder to Reverse-Engineer
wired.com
wired.com
I have heard this phrase repeated so many times in the advertisements for protectors/packers that it's become almost cliche. Such techniques have been around for over 20 years. Using the debug registers to store the decryption key is relatively well-known - and defeatable (this is 5+ years ago):
http://reversinglabs.com/newsroom/blog/lockpicking-telock.ht...
On the other hand, I like how the article presents the negative aspect too - that security features can be used to make systems secure against their owners is a point that I definitely believe needs to be more prominent among the public.
We do have nowadays non-executable stack, and heap by default. In fact, only the marked read only segments can contain runnable code, unless if you use specific workarounds. What happens if the code you are protecting and running is more complex, requiring calls where you would usually use position independence and stuff like ASLR to full extend? Do you lose these the benefits or those features, or is there necessary information leak (take a look at plt for instance)?
To add to this that in the end of the day if you can access both the data and the key it is just highly complex obfuscation, I am hardly impressed.
Of course, reporting that would require actual research, as opposed to the breathless rehashing of wired. About 30 seconds of it, but clearly too much.
[1] http://opencfp.immunityinc.com/talks/64/ [2] https://www.usenix.org/legacy/event/sec11/tech/full_papers/M...
EDIT: Nevermind. Got it:
The idea is probably to make sure D-TLB is pointed at the encrypted code so that the decrypted code (switched to I-TLB after decryption) can't be read, only executed.
* https://www.blackhat.com/docs/us-14/materials/us-14-Torrey-M...
* http://www.cse.iitd.ernet.in/~sbansal/csl865/readings/self-c...
Causing a TLB-Split requires ring 0, too.
Debug registers are used for debugging, to set hardware breakpoints. They aren't really needed, as most debuggers use software breakpoints anyways.
In a curious design decision, SGX allows the code in the enclave to access all the memory of the process it's associated with so it can do whatever ugly stuff it wants.
Can we have proof carrying encrypted code? Or perhaps a trusted code verifier that's not encrypted that runs in an enclave too?
https://software.intel.com/en-us/blogs/2013/09/26/protecting... http://theinvisiblethings.blogspot.co.uk/2013/08/thoughts-on...
Reading RAM in a running system (even a "hardened" one) is easier than most think. Micah Elizabeth Scott's work on the Nintendo DSi [1] is an excellent example: with a budget of just $500 and a month or two of work [2] she could read a video stream out of RAM as it was being DMAed to/from the camera [3].
I can't even begin to describe how impressed I am with Micah's work, but cloning her FPGA tool from GitHub [4] and repeating the feat for a relatively static segment of executable code on a system that's less physically hardened against tampering, that seems trivial to me in comparison. Certainly doable with $500 and a couple of weeks time.
1. http://scanlime.org/2009/09/dsi-ram-tracing/
2. https://twitter.com/scanlime/status/562925122106191873
There are numerous ways to pack, and unpack code. It's really going nowhere tbh. It is mostly a meta-game between you and the person you'd expect to be RE your code. You think he's going to use a vm to RE? Then you prevent your code from running in that vm. You leave red herrings - like obscuring control flow, disabling ability to set breakpoints, delay unpacking, and phantom unpacking (where it only truly unpacks a certain percentage of the time)
There will NEVER be a way to prevent RE, and there will never be true polymorphic code. The world is still flock with people fluent in ASM and low level debugging, and all code will revel itself. Commercial protection suites aren't even where the real tricks come into play, malware and 'anti anti-virus' packers, are at the forefront of ingenuity. Even when the hardware is a part of the protection (a la Xbox) it still means nothing. I've seen some nasty stuff done to electronic payment devices by rather unsophisticated people, and those are some of the most hardened systems available (think self destruct if the casings are opened, or if JTAG is conntected)
"Reverse engineers hate him!"
"One weird crypto trick to burn reverse engineers"
-"Of course not, why would a DRM vendor lie about whether the DRM can be cracked of not?"
-"A good point!"
Mostly they have to do with abusing the debug registers.
http://en.wikipedia.org/wiki/TRESOR
I cant find any specifics for this implementation though.
As for blocking GDB and its ilk, the knowledge of how to disable ptrace blocking in executables is already fairly broadly disseminated on the internet.
I also don't see it working around the VM problem (short of saying "I don't run in VMs, period", which would severely limit the reach of such binaries).
Interesting idea in theory, but without significant changes to the underlying hardware or kernels, I don't see it functioning in practice (yet). It has the capability of blocking your casual user from accessing the application, but the folks they seem to really want to defend against would have few problems working around these limitations.
The question is how broken relative to other DRM.
The second, and this is the one that kills half the stuff people think a TPM would be good for, is that it assumes every TPM implementation everywhere is secure. Reverse engineer finds one device with one vulnerability and you lose. Someone who finds a vulnerability doesn't even need to disclose what it is so you can fix it, they just start selling TPM keys for Bitcoin that anyone can use to emulate a device with a TPM.
You don't need an expensive JTAG device when the virtual machine gives you that ability for free.
People have been hiding crypter variables in debug registers since… the early 90s was the first I saw it? Sure it might have tripped up those who thought SoftICE was the bee's knees, but those of us who had access to (or wrote) emulating debuggers - which had "debug registers" and a functioning "MMU" just fine - sailed right through this sort of thing and could just read the obfuscation code and adapt it to dump the unencrypted code right out.
Hell, with this, we wouldn't even have to translate/recompile bytecode, the MMU did all the work.
Competitive advantage from tool exclusivity.
The techniques used in FHE have been applied to obtain Indistinguishability Obfuscation, but that's not the intuitive notion of obfuscation, and the intuitive black box obfuscation for general functions was proven to be impossible over a decade ago.
Huh?
Do CPUs come with persistent storage now?
http://www.networkworld.com/article/2243700/security/black-h...
But I don't see any actual details.
Let me adjust your expectations accordingly. I will not be sticking your software on my computer, at least willingly.
[1] - http://www.woodmann.com/forum/showthread.php?4027-Armadillo-...
Note that reverse engineering is also used for very legitimate reasons. For example for interoperability. In a lot of jurisdictions it is absolutely legal to reverse engineer for such purposes.
Also this article sucks
This way, when you are a normal user on a computer, you could get system permissions (higher than admin!) by running their exploit. It wasn't quite changing a single bit as they claimed, you had to develop (or run) a program that exploited the bug, but scroll bars were the key. That's the joke here I think ;)