Live data from Hacker News

Remote Kernel Code Execution Via HTTP Request In IIS On Windows

ma.ttias.be

21–30 of 201 posts

Re: Remote Kernel Code Execution Via HTTP Request In IIS On Windows

#21
post #7

>A remote code execution vulnerability exists in the HTTP protocol stack [...] could execute arbitrary code in the context of the System account. SYSTEM is higher than admin. Using IIS on windows is like running a webserver as root on linux.

Only at the HTTP parsing stage.. Once you get into ASP.net you'll have dropped privileges.

Typical Linux servers drop privileges before accepting any connections from clients, precisely to limit the scope of this sort of vulnerability.

Re: Remote Kernel Code Execution Via HTTP Request In IIS On Windows

#22
post #18
post #4

Here the Microsoft Security Bulletin: https://technet.microsoft.com/library/security/ms15-034 I think the title is downplaying the severity of the bug. It's a remote code execution vulnerability in http.sys which is a webserver component running inside the kernel (yea right, great idea!) so you can get remote root via HTTP request. The blog quotes this correctly but I get the feeling the author didn't communicate it…

> webserver component running inside the kernel (yea right, great idea!) Actually an idea shared among many OS, including GNU/Linux. http://en.wikipedia.org/wiki/In-kernel_web_server

Well, of course you can make such a web server on any OS where you can modify or extend the kernel, but TUX is not exactly a popular or recommended solution. There's a reason the reference manual is dated 2001.

Re: Remote Kernel Code Execution Via HTTP Request In IIS On Windows

#23
post #4

Here the Microsoft Security Bulletin: https://technet.microsoft.com/library/security/ms15-034 I think the title is downplaying the severity of the bug. It's a remote code execution vulnerability in http.sys which is a webserver component running inside the kernel (yea right, great idea!) so you can get remote root via HTTP request. The blog quotes this correctly but I get the feeling the author didn't communicate it…

To be fair, http://en.wikipedia.org/wiki/TUX_web_server . Having said that, this is huge. This is way worse than Heartbleed for the IIS crowd.

From the linked page: "TUX has never been an integrated part of the official Linux kernel, although it has been shipped in some distributions, notably Red Hat, SuSE and Fedora."

Re: Remote Kernel Code Execution Via HTTP Request In IIS On Windows

#24
post #4

Here the Microsoft Security Bulletin: https://technet.microsoft.com/library/security/ms15-034 I think the title is downplaying the severity of the bug. It's a remote code execution vulnerability in http.sys which is a webserver component running inside the kernel (yea right, great idea!) so you can get remote root via HTTP request. The blog quotes this correctly but I get the feeling the author didn't communicate it…

To be fair, http://en.wikipedia.org/wiki/TUX_web_server . Having said that, this is huge. This is way worse than Heartbleed for the IIS crowd.

And how much internet-facing web content is served with this toy webserver exactly?

That's what I thought, none (except maybe the author's blog? wild guess).

Re: Remote Kernel Code Execution Via HTTP Request In IIS On Windows

#25
post #15
post #11

Earlier quoted context omitted.

It would allow the same privileges as the user which is running IIS, usually a "system" account - which equals Administrative privileges.

You two seem to not understand still, please re-read my comment. The point is this is allowing code execution within the kernel of windows. It doesn't even reach the IIS userland process.

I actually don't because I have no clue how Windows Server works. So this attack hits the kernel and the context is low level, right?

Re: Remote Kernel Code Execution Via HTTP Request In IIS On Windows

#26
post #18
post #4

Here the Microsoft Security Bulletin: https://technet.microsoft.com/library/security/ms15-034 I think the title is downplaying the severity of the bug. It's a remote code execution vulnerability in http.sys which is a webserver component running inside the kernel (yea right, great idea!) so you can get remote root via HTTP request. The blog quotes this correctly but I get the feeling the author didn't communicate it…

> webserver component running inside the kernel (yea right, great idea!) Actually an idea shared among many OS, including GNU/Linux. http://en.wikipedia.org/wiki/In-kernel_web_server

That you can write a module to serve HTTP from kernel space is a given.

That people actually use it is another topic.

Re: Remote Kernel Code Execution Via HTTP Request In IIS On Windows

#27
post #15
post #11

Earlier quoted context omitted.

It would allow the same privileges as the user which is running IIS, usually a "system" account - which equals Administrative privileges.

You two seem to not understand still, please re-read my comment. The point is this is allowing code execution within the kernel of windows. It doesn't even reach the IIS userland process.

My windows knowledge is rusty and outdated but... do you mean that code runs in ring 0? that "kernel space"?

Re: Remote Kernel Code Execution Via HTTP Request In IIS On Windows

#28
post #12

From the exploit code: memset(&serv_addr, '0', sizeof(serv_addr)); That doesn't seem to be correct. The digit character 0 is not the same as the null character ('\0'). Just write 0 or use `struct sockaddr_in serv_addr = { 0 };`.

It is common for code which is designed to trigger security bugs in systems to be published with several errors, so that skiddies can't just compile and run.

Re: Remote Kernel Code Execution Via HTTP Request In IIS On Windows

#29
I tried to send the bad curl request to our servers (test env, obviously) and I didn't get any error. It seems I should be getting "Requested Range Not Satisfiable" if the server is vulnerable and "The request has an invalid header name" if it's patched. I'm getting neither, simply a normal response HTTP 200 with the requested page. Anyone knows how to really test it?

EDIT : It is indeed related to "Output Cache" setting in IIS as I said I was suspecting in another comment. I managed to crash our servers by going to IIS Management, select the website I wanted to test, go to Output Caching, enable the feature AND also add a rule (I added a rule for .png just to test). If you have NO rules it is the same as having the feature disabled so you are safe. If you add a rule and check "Enable Kernal Caching" you are vulnerable!

EDIT 2 : As some have asked, this is the command I used to crash our test server. I tested it after having created a new Output Caching rule to cache all .png files in kernel mode.

curl -v http://example.com/image.png -H "Range: bytes=18-18446744073709551615"

I didn't take a screenshot of the BSOD and I don't plan on crashing our test env a second time today because people are using it (I tested it early enough that not a lot of people were at the office yet).

Re: Remote Kernel Code Execution Via HTTP Request In IIS On Windows

#30
post #11
post #8

Earlier quoted context omitted.

That's a good point, because in the example we can clearly see how to check if a system is or not patched and that, using this attack, we can crash a Windows Server. The remote execution part is completely missing (fortunately), but I was wondering if this gives the admin rights on machine (I have absolutely no experience on Windows Server machines, so I don't know how it works in terms of services, permissions and r…

It would allow the same privileges as the user which is running IIS, usually a "system" account - which equals Administrative privileges.

IIS has several components. One of them, the vulnerable part here, is running in kernel space. In kernel space you have access to everything.

As far as I know, IIS is the only(bar embedded devices running a single address space OS and various ancient/obsolete toys servers on linux) used in production that handles part of HTTP in kernel space (or ring 0 if you will).

Post reply on HN