Last active
December 19, 2015 07:18
-
-
Save gregoryyoung/5917423 to your computer and use it in GitHub Desktop.
Proof that httplistener does not use http.sys kernel caching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From HttpListener source code | |
http://www.dotnetframework.org/default.aspx/DotNET/DotNET/8@0/untmp/whidbey/REDBITS/ndp/fx/src/Net/System/Net/HttpListenerResponse@cs/2/HttpListenerResponse@cs | |
line 525 | |
UnsafeNclNativeMethods.HttpApi.HttpSendHttpResponse( | |
HttpListenerContext.RequestQueueHandle, | |
HttpListenerRequest.RequestId, | |
(uint)flags, | |
pResponse, | |
null, | |
null, | |
SafeLocalFree.Zero, | |
0, | |
asyncResult==null ? null : asyncResult.m_pOverlapped, | |
null ); | |
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364499(v=vs.85).aspx | |
Argument 5 is the CACHE_POLICY. It is set to null which means no caching. | |
SO NO YOU DO NOT USE KERNEL MODE CACHING WITH HTTP LISTENER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I guess this is nice to know given the discovered vulnerability in http.sys: https://technet.microsoft.com/en-us/library/security/ms15-034.aspx#ID0EXIAC
Disabling kernel mode caching is given as a workaround. Of course if you are using a supported OS you can just patch it.