Hmm... #define PAYLOADSIZE 0x2000 code += PAYLOADSIZE - 1024; memcpy((void*)code, &kernel_payload, 1024); Does anybody know if it's possible to find out the size of a function during run time? Could you like say, put a return at the end of the function then do a for-loop with memcpy() for each byte until you run into the OPCODE for RET? I guess I could do a test.
Of course, functions commonly have multiple rets, jump tables at the end, etc. I don't think theres a robust way sans symbols.
Linux local root exploit for CVE-2014-0038
21–30 of 36 posts
Re: Linux local root exploit for CVE-2014-0038
#22Earlier quoted context omitted.
Hmm... so after looking at http://ref.x86asm.net/coder32.html apparently 0xC2 and 0xC3 are RET. On my 32bit Linux machine, the following code printed "Okay! c2 found @ 174" Is this code correct in any way??? I guess the fact that I'm assuming every byte is a whole instruction; not even accounting for the operands is already a problem. But am I even reading the bytes properly at all? #include void rightmeow() { int q;…
You probably mean *(((unsigned char *)rightmeow)+i) but just change the "q < 10" line to "q < 195" and you should see the output change, since that immediate constant is going to be present at least once before the final ret. For me, changing that changes the output from c3 being found at 47 to it being found at 25.
Re: Linux local root exploit for CVE-2014-0038
#23Doesn't work, but DID crash the kernel, so it's vulnerable.
Re: Linux local root exploit for CVE-2014-0038
#24Hmm... #define PAYLOADSIZE 0x2000 code += PAYLOADSIZE - 1024; memcpy((void*)code, &kernel_payload, 1024); Does anybody know if it's possible to find out the size of a function during run time? Could you like say, put a return at the end of the function then do a for-loop with memcpy() for each byte until you run into the OPCODE for RET? I guess I could do a test.
A function may have the RET in the middle of it. Or use a jmp instead of ret (tail optimization), etc.
Re: Linux local root exploit for CVE-2014-0038
#25Earlier quoted context omitted.
why is it "vastly irresponsibly-constructed" ? I mean major hosting providers like rackspace use it... so ??
Here's why the Fedora maintainers rejected request to enable it: https://bugzilla.redhat.com/show_bug.cgi?id=854317 * It's new and unanalyzed for security flaws. * It's useless without the right userland tools, which don't exist. Ubuntu switched it on either because they have no clues, or because they wanted a checkbox to say "look, we have features no-one else does!!!!".
Re: Linux local root exploit for CVE-2014-0038
#26the program did not get the root privilege. Kernel did not crash either. Strange.
Re: Linux local root exploit for CVE-2014-0038
#27Earlier quoted context omitted.
Here's why the Fedora maintainers rejected request to enable it: https://bugzilla.redhat.com/show_bug.cgi?id=854317 * It's new and unanalyzed for security flaws. * It's useless without the right userland tools, which don't exist. Ubuntu switched it on either because they have no clues, or because they wanted a checkbox to say "look, we have features no-one else does!!!!".
The main problem with Fedora is that it usually doesn't work. At all.
Re: Linux local root exploit for CVE-2014-0038
#28Earlier quoted context omitted.
You probably mean *(((unsigned char *)rightmeow)+i) but just change the "q < 10" line to "q < 195" and you should see the output change, since that immediate constant is going to be present at least once before the final ret. For me, changing that changes the output from c3 being found at 47 to it being found at 25.
Nice! For me it changed from being found at 38, to 34. I wonder why you get C3 while I get C2.
Then again, it could be something else and not the actual return you found.
Re: Linux local root exploit for CVE-2014-0038
#29Re: Linux local root exploit for CVE-2014-0038
#30Just patched it to 3.8 kernel and it works.