4 ms·
What's the use here? If you want to get anything done you'd have to exit the enclave to do syscalls, at which point antivirus can detect what you're doing. I gu
by gruez 8y ago
What's the use here? If you want to get anything done you'd have to exit the enclave to do syscalls, at which point antivirus can detect what you're doing. I guess you can use it to obfuscate code flow and C2 communications but you already do that with obfuscators, which doesn't require a signing certificate from intel
- tpolzer 8y agoYou cannot do syscalls, but you can read/write all memory, which means you can make some arbitrary (trusted) process your victim, executing code in a ROP manner and antivirus won't see a thing.
- gruez 8y ago>but you can read/write all memory Source? AFAIK programs running inside don't have kernel/DMA access.
- UncleEntity 8y ago> The enclave code does, however, have the ability to read and write anywhere in the unencrypted process memory Source: TFA
- gruez 8y agoStrange, I skimmed through a few SGX code samples[1] and they're all C programs that pass data through an API rather than pointer passing. The article states that they have access to all memory and it doesn't seem like Intel refuted it, so I guess we can assume it's true. That said, I find it strange that enclaves have access to all memory, when all it needs is access to its own protected region. If that's true, that seems like an oversight on Intel's part, especially since they already have well defined interfaces for passing data between trusted/untrusted code. [1] https://github.com/digawp/hello-enclave https://github.com/digawp/hello-enclave [1] https://software.intel.com/en-us/articles/sgx-intro-passing-data-between-app-and-enclave https://software.intel.com/en-us/articles/sgx-intro-passing-... edit: looks like the article might be mistaken. According to an article on SGX internals[2], SGX code may only access enclave memory. A similar diagram can be found in a slide deck [3]. [2] https://blog.quarkslab.com/overview-of-intel-sgx-part-1-sgx-internals.html https://blog.quarkslab.com/overview-of-intel-sgx-part-1-sgx-... [3] http://cwfletcher.net/Content/598/lec04_sgx.pdf http://cwfletcher.net/Content/598/lec04_sgx.pdf page 26
- amluto 8y agoThe SDM is unambiguous: enclaves can access any memory that the host process can access. The enclave can also modify most of its callers registers, including RSP, RBP, and RIP. The Intel SDK uses these ability for reasons that might be considered unwise.
- ENOTTY 8y agoProcess address spaces don't include (nearly all of) the kernel address space anymore thanks to Meltdown.
- amluto 8y agoThis isn’t relevant here. Enclaves can access any memory that the user host process can, plus their own memory. The kernel is off limits, except insofar as the enclave can exploit Meltdown.
- caf 8y agoForget antivirus, you could use this to build ransomware that doesn't need C2 at all. The enclave itself can wait for confirmation of the bitcoin transfer and then release the decryption key. Sure you can stop it talking to the outside world, but you can't force it to give up the key.
- ngneer 8y agoThe paper is interesting in that it shows the extent to which an untrusted enclave is capable of owning its host. This is not an attack within the adversary model of SGX, as the authors state, because an enclave can, by design, write to host memory. Typically, this would be enough for people to assume that arbitrary code execution would be possible, but, these researchers went through the exercise of actually implementing the attack. They highlight a useful property of TSX when invoked inside an enclave, allowing them to determine the accessibility of host memory addresses (termed caves), without incurring exceptions. What is interesting about the paper is the creation of a code reuse attack to robustly subvert control flow and create arbitrary execution in the host context.