text stringlengths 0 1.99k |
|---|
There are, however, some things I overlooked calculating these estimations: |
1. As bits of randomization grow, I assume that the libraries are big |
enough to contain the randomization range. Because the range grows |
exponentially, this assumption very quickly becomes unrealistic. |
This depends heavily on the executable and the libraries it requires. |
2. Similarly, as bits of randomization decrease, we are not bound to |
look just at one executable range of memory. We can find the range |
that produces the largest number of quantum gadgets. |
3. When using more than one library for gadgets, there are actually |
non-executable memory regions between the libraries' executable, which |
makes approximating a general case even harder. Some libraries may |
contain bigger non-executable regions, and some bigger executable |
regions. A rough estimate can be deducted from the probability of a |
valid address being a usable gadget. |
4. Not all libraries have the same probability of finding a usable gadget. |
5. The more quantum gadgets you try to use, the more unrealistically |
capable and flexible the initial BOF must be. |
Which means that the estimates are very optimistic, especially as we go |
up in bits of randomization. |
6 Technique potential |
~~~~~~~~~~~~~~~~~~~~~~~ |
To examine the potential of this method we need to look at a few things. |
@ Relevance |
QROP is only relevant in the following circumstances: |
- In cases of stack-based buffer overflow |
- In 32-bit executables (for realistic probabilities) |
- When stack canaries are not an issue |
Although not extremely common and in constant decline as 64-bit and stack |
canaries are the default nowadays, it is not rare to encounter such |
scenarios. |
@ Vulnerability strength |
The vulnerability strength is determined by the controllability of the |
overflowed data, and the maximum length of the overflowed data. The longer |
it can be, the more room it will have to realize the potential of QROP. |
There could be more specific constraints like blacklisted characters, |
like we showed in the example above. |
@ Bits of randomization |
The default for 32-bit is 8 bits of randomization in x86_64. This has |
changed, at least in Ubuntu, due to ASLRn't [4][5], and is now 16 bits. |
This setting may vary depending on the architecture, distribution, kernel |
compilation flags, kernel configuration and version. |
@ Libraries loaded |
The more libraries loaded, the more executable regions there are to search |
for qgadgets. |
@ Architecture |
I only examined the x86_64 architecture with a modern libc build. |
The technique might need to change completely for other environments. |
@ Chances of finding usable gadgets |
There are plenty of gadgets. The chances a gadget will be usable as a |
qgadget depends on the libraries loaded and architecture. Looking into libc |
on x86_64 I estimate that around 16 gadgets is approximately the maximum |
with 8 bits of randomization. I presented a deeper analysis on this topic |
earlier. |
@ Execution time and latency |
In certain scenarios, this technique might be more feasible than in others. |
For example when exploiting a vulnerability locally, the difference between |
8 bits and 4 bits of randomization might not be significant. However, in |
remote exploitation with latency and a program that takes relatively long to |
reach the vulnerable code, this could be a game-changer. |
7 Conclusions |
~~~~~~~~~~~~~~~ |
QROP is a method of maximizing time efficiency when exploiting stack-based |
buffer overflows without stack canaries, but with NX and ASLR on 32-bit |
systems. |
The method is generic in concept and can be abused on the simplest of |
programs, but its potential, effectiveness and practical implementation are |
highly context dependent. This article summarizes every aspect of this |
method I saw worth analyzing. |
There might be more to it - which I will be happy to hear and discuss. |
8 References |
~~~~~~~~~~~~~ |
[1] The advanced return-into-lib(c) exploits |
Nergal |
ERROR: type should be string, got " https://phrack.org/issues/58/4" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.