{"id":114,"date":"2018-07-04T15:31:19","date_gmt":"2018-07-04T15:31:19","guid":{"rendered":"https:\/\/int64software.com\/blog\/?p=114"},"modified":"2019-10-25T18:23:37","modified_gmt":"2019-10-25T18:23:37","slug":"free-windows-privilege-escalation-vulnerability-scan-tool","status":"publish","type":"post","link":"https:\/\/int64software.com\/blog\/2018\/07\/04\/free-windows-privilege-escalation-vulnerability-scan-tool\/","title":{"rendered":"Free: Windows Privilege Escalation Vulnerability Scan Tool"},"content":{"rendered":"<p>There exist many actual and potential vulnerabilities in the Windows operating system suite which could leave your systems open to attack. While many of these are patched or mitigated when they are discovered, many still remain as &#8220;features&#8221; of the operating system.<\/p>\n<p>We&#8217;ve isolated four of these vulnerabilities which we feel are the most easily exploitable and written a small scan tool to help identify at risk systems, and are now releasing it for free for anybody to make use of.<\/p>\n<p><!--more--><\/p>\n<h2>Licence<\/h2>\n<p>This Windows Privilege Escalation Vulnerability Scan Tool (<strong>PEVS<\/strong>) is released under the CC BY-NC-ND 3.0 (Attribution-NonCommercial-NoDerivs) licence <a href=\"http:\/\/creativecommons.org\/licenses\/by-nc-nd\/3.0\/\" rel=\"license\"><img decoding=\"async\" style=\"border-width: 0;\" src=\"https:\/\/i.creativecommons.org\/l\/by-nc-nd\/3.0\/80x15.png\" alt=\"Creative Commons License\" \/><\/a>. Meaning that it can be copied and redistributed at will as long as appropriate credit is given, and it is not sold.<\/p>\n<p><a href=\"https:\/\/int64software.com\/overlaps\/\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-276\" src=\"https:\/\/int64software.com\/blog\/wp-content\/uploads\/2018\/11\/overlaps-800-tall.png\" alt=\"OverLAPS is a self-hosted web interface for Microsoft's Local Administrator Password Solution (LAPS)\" width=\"800\" height=\"151\" \/><\/a><\/p>\n<h2>Vulnerabilities<\/h2>\n<h3>1. Always Install Elevated<\/h3>\n<p>When configuring Group Policy, you may have seen the setting &#8220;<em>Always install with elevated privileges<\/em>&#8221; under <em>Computer Configuration -&gt; Policies -&gt; Administrative Templates -&gt; Windows Components -&gt; Windows Installer<\/em>.<\/p>\n<p>If this policy is enabled, it forces the Windows Installer service to always use elevated privileges when running an installation package. Naturally this is incredibly dangerous as it essentially grants administrator rights to any users on the system by crafting a custom MSI which launches a program, or a command prompt, or adds themselves to the Administrators group.<\/p>\n<p>The PEVS tool checks for this by seeing if the policy settings has been applied in the computer&#8217;s registry.<\/p>\n<h3>2. SysPrep Configuration Files<\/h3>\n<p>SysPrep is a tool that comes with Windows and is used when building pre-configured system images for deployment through tools such as Configuration Manager (SCCM). It uses text INF or XML configuration files which specify how the image should deploy to a new machine, and these files could very well contain sensitive information such as usernames and passwords. In most instances, these files are automatically removed when an image is deployed, but we&#8217;ve seen reports of them being left behind, along with their tasty contents.<\/p>\n<h3>3. Unquoted Service Paths<\/h3>\n<p>It&#8217;s an accepted quirk (or feature) of the <em>CreateProcess<\/em> WinAPI function that unquoted executable paths are parsed left to right, and if you path contains a space, matches in parent directories will take priority over your full path.<\/p>\n<p>What does this mean? Consider the path &#8220;<em>C:\\Program Files (x86)\\My Program\\myprogram.exe<\/em>&#8220;. Without the quotes, <em>CreateProcess<\/em> will search for executables in the following order:<\/p>\n<p>1. C:\\Program.exe<br \/>\n2. C:\\Program Files.exe<br \/>\n3. C:\\Program Files (x86)\\My.exe<br \/>\n4. C:\\Program Files (x86)\\My Program\\myprogram.exe<\/p>\n<p>So you see, in this case a user has the opportunity (if they possess the permission to create files there) to inject executables at 3 points which would be run instead of your program.<\/p>\n<p>This is particularly a problem with Windows Services, because services often run as System and therefore have the highest assignable permissions on the computer, and because the Windows uses <em>CreateProcess<\/em> to launch services.<\/p>\n<p>For this reason, PEVS includes a scan to check all services (excluding those located in C:\\Windows\\System32 and C:\\Windows\\SysWOW64) to make sure that their ImagePath properties have quotes.<\/p>\n<h3>4. Service Registry Permissions<\/h3>\n<p>Finally, the other way to hijack a Windows Service is to simple modify the registry entry for it to point its ImagePath at another executable of your choice. Of course that portion of the registry usually requires Administrator rights to modify, but we have seen systems configured to all members of the Users group, or indeed the Everyone object, to have write access for some reason. Sometimes this is a mistake of a system administrator, other times its poorly configured third party software making the change.<\/p>\n<p>Either way, PEVS will check all services to make sure that they are properly quoted.<\/p>\n<h2>Does it make any changes?<\/h2>\n<p>No. PEVS is not a remediation tool, it is simply a scanner to check for potential vulnerabilities that you may want to look into.<\/p>\n<h2>Usage<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-115\" src=\"https:\/\/int64software.com\/blog\/wp-content\/uploads\/2018\/07\/screenshot4.png\" alt=\"Privilege Escalation Vulnerability Scan Tool\" width=\"984\" height=\"593\" \/><\/p>\n<p>Extract the files to somewhere easily accessible and launch a command prompt as Administrator. Note that if you want to scan remote devices, you&#8217;ll need administrator rights to them as well.<\/p>\n<p><strong>privesc.exe [hostname] [\/verbose] [\/pause]<\/strong><\/p>\n<p><em>[hostname] &#8211; (Optional) name of the computer to scan.<\/em><br \/>\n<em>[\/verbose] &#8211; (Optional) show additional information.<\/em><br \/>\n<em>[\/pause] &#8211; (Optional) Require user input before closing.<\/em><\/p>\n<h3>Return Codes<\/h3>\n<p>If a vulnerability is detected by one of the scans, the return code of the application will be that of the last one found.<\/p>\n<p><em>100 &#8211; Unquoted Service Paths<\/em><br \/>\n<em>300 &#8211; Service Registry Permissions<\/em><br \/>\n<em>400 &#8211; Always Install Elevated<\/em><br \/>\n<em>500 &#8211; SysPrep Configuration Files<\/em><\/p>\n<p>So if an unquoted service path vulnerability is found and Always Install Elevated is enabled, then the return code will be 400. You can also examine the tools output for a full breakdown of its results.<\/p>\n<h2>Overcee<\/h2>\n<p>PEVS will work perfectly well as a defined Remote Execute tool, just set it to run without any parameters and Overcee will manage the capture of the return code and output for further analysis later.<\/p>\n<p><a href=\"https:\/\/overcee.com\" target=\"_blank\" rel=\"noopener noreferrer\">More info<\/a><\/p>\n<h2>Download<\/h2>\n<p>Click the link below to download PEVS.<\/p>\n<p><a href=\"https:\/\/int64software.com\/pubdl.php?id=5\" target=\"_blank\" rel=\"noopener noreferrer\">Privilege Escalation Vulnerability Scan Tool 1.0 (17kb)<\/a><\/p>\n<h2>Support \/ Warranty<\/h2>\n<p>Please read the included EULA prior to using PEVS. If you disagree with any of the content of this, then please delete PEVS and do not use it. PEVS is provided as-is, but if you experience any problems then please contact <a href=\"mailto:support@int64software.com\">support@int64software.com<\/a> for assistance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There exist many actual and potential vulnerabilities in the Windows operating system suite which could leave your systems open to attack. While many of these are patched or mitigated when they are discovered, many still remain as &#8220;features&#8221; of the operating system. We&#8217;ve isolated four of these vulnerabilities which we feel are the most easily&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[13,14,27],"tags":[35,28,30,31,33,34,29,32,21],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-blog","category-int64-software","category-tools","tag-elevated","tag-free","tag-hacker","tag-privilege-escalation","tag-services","tag-sysprep","tag-tools","tag-vulnerability","tag-windows"],"_links":{"self":[{"href":"https:\/\/int64software.com\/blog\/wp-json\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/int64software.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/int64software.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/int64software.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/int64software.com\/blog\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":6,"href":"https:\/\/int64software.com\/blog\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":652,"href":"https:\/\/int64software.com\/blog\/wp-json\/wp\/v2\/posts\/114\/revisions\/652"}],"wp:attachment":[{"href":"https:\/\/int64software.com\/blog\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/int64software.com\/blog\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/int64software.com\/blog\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}