{"id":995,"date":"2017-11-13T16:51:33","date_gmt":"2017-11-13T15:51:33","guid":{"rendered":"http:\/\/www.greyhathacker.net\/?p=995"},"modified":"2022-04-12T12:25:53","modified_gmt":"2022-04-12T11:25:53","slug":"ikarus-anti-virus-and-its-9-exploitable-kernel-vulnerabilities","status":"publish","type":"post","link":"https:\/\/www.greyhathacker.net\/?p=995","title":{"rendered":"IKARUS anti.virus and its 9 exploitable kernel vulnerabilities"},"content":{"rendered":"<p>Here is a list of the 9 kernel vulnerabilities I discovered over a month ago in an antivirus product called IKARUS anti.virus which has finally been fixed. Most of the vulnerabilities were due to the inputted output buffer address (Irp-&gt;UserBuffer) being saved on the stack which is later used without being validated when using as an argument. The table below lists the ioctls, related CVE and type of vulnerability<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"168\"><strong>IOCTL<\/strong><\/td>\n<td width=\"180\"><strong>CVE ID<\/strong><\/td>\n<td width=\"189\"><strong>Vulnerability Type<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"168\">0x8300000c<\/td>\n<td width=\"180\">CVE-2017-14961<\/td>\n<td width=\"189\">Arbitrary Write<\/td>\n<\/tr>\n<tr>\n<td width=\"168\">0x83000058<\/td>\n<td width=\"180\">CVE-2017-14962<\/td>\n<td width=\"189\">Out of Bounds Write<\/td>\n<\/tr>\n<tr>\n<td width=\"168\">0x83000058<\/td>\n<td width=\"180\">CVE-2017-14963<\/td>\n<td width=\"189\">Arbitrary Write<\/td>\n<\/tr>\n<tr>\n<td width=\"168\">0x8300005c<\/td>\n<td width=\"180\">CVE-2017-14964<\/td>\n<td width=\"189\">Arbitrary Write<\/td>\n<\/tr>\n<tr>\n<td width=\"168\">0x830000cc<\/td>\n<td width=\"180\">CVE-2017-14965<\/td>\n<td width=\"189\">Arbitrary Write<\/td>\n<\/tr>\n<tr>\n<td width=\"168\">0x830000c0<\/td>\n<td width=\"180\">CVE-2017-14966<\/td>\n<td width=\"189\">Arbitrary Write<\/td>\n<\/tr>\n<tr>\n<td width=\"168\">0x83000080<\/td>\n<td width=\"180\">CVE-2017-14967<\/td>\n<td width=\"189\">Arbitrary Write<\/td>\n<\/tr>\n<tr>\n<td width=\"168\">0x830000c4<\/td>\n<td width=\"180\">CVE-2017-14968<\/td>\n<td width=\"189\">Arbitrary Write<\/td>\n<\/tr>\n<tr>\n<td width=\"168\">0x83000084<\/td>\n<td width=\"180\">CVE-2017-14969<\/td>\n<td width=\"189\">Arbitrary Write<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Fixed version numbers (<a href=\"https:\/\/www.ikarussecurity.com\/about-ikarus\/security-blog\/vulnerability-in-windows-antivirus-products-ik-sa-2017-0002\" target=\"_blank\" rel=\"noopener\">vendors advisory<\/a> <del>soon to be released<\/del>)<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"161\"><\/td>\n<td width=\"161\"><strong>Vulnerable version<\/strong><\/td>\n<td width=\"170\"><strong>Fixed version<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"161\">Software<\/td>\n<td width=\"161\">2.16.7<\/td>\n<td width=\"170\">2.16.18<\/td>\n<\/tr>\n<tr>\n<td width=\"161\">ntguard.sys<\/td>\n<td width=\"161\">0.18780.0.0<\/td>\n<td width=\"170\">0.43.0.0<\/td>\n<\/tr>\n<tr>\n<td width=\"161\">ntguard_x64.sys<\/td>\n<td width=\"161\">0.18780.0.0<\/td>\n<td width=\"170\">0.43.0.0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>I&#8217;m exploiting the vulnerable subroutine used by ioctl 0x8300000c by overwriting the _SEP_TOKEN_PRIVILEGES structure where arg_20 is our inputted output buffer address.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium\" src=\"\/images\/8300000c-64.png\" width=\"593\" height=\"351\" \/><\/p>\n<p>In our process _SEP_TOKEN_PRIVILEGES structure I&#8217;m overwriting a byte in the &#8220;Present&#8221; field and a byte in the &#8220;Enabled&#8221; field with the hardcoded value of 0x11 by calling the vulnerable subroutine twice.<\/p>\n<pre>DeviceIoControl(hDevice, 0x8300000c, NULL, 0, (LPVOID)PresentByteOffset, 0, &amp;dwRetBytes, NULL);\r\nDeviceIoControl(hDevice, 0x8300000c, NULL, 0, (LPVOID)EnableByteOffset, 0, &amp;dwRetBytes, NULL);<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium\" src=\"\/images\/cve-2017-14961.png\" width=\"654\" height=\"712\" \/><\/p>\n<p>The exploit can be downloaded from here [<a href=\"\/docs\/cve-2017-14961.zip\" target=\"_blank\" rel=\"noopener\">zip<\/a>] (pass &#8220;ghh&#8221;) or from Exploit-DB when it gets published.<\/p>\n<p><a href=\"https:\/\/twitter.com\/parvezghh\" target=\"_blank\" rel=\"noopener\">@ParvezGHH<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a list of the 9 kernel vulnerabilities I discovered over a month ago in an antivirus product called IKARUS anti.virus which has finally been fixed. Most of the vulnerabilities were due to the inputted output buffer address (Irp-&gt;UserBuffer) being saved on the stack which is later used without being validated when using as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,8,7,6],"tags":[21,46],"class_list":["post-995","post","type-post","status-publish","format-standard","hentry","category-all","category-bugs","category-exploits","category-vulnerabilities","tag-elevate","tag-kernel"],"_links":{"self":[{"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/posts\/995","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=995"}],"version-history":[{"count":7,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/posts\/995\/revisions"}],"predecessor-version":[{"id":1111,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=\/wp\/v2\/posts\/995\/revisions\/1111"}],"wp:attachment":[{"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greyhathacker.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}