{"id":20876,"date":"2021-08-03T07:40:54","date_gmt":"2021-08-03T05:40:54","guid":{"rendered":"http:\/\/159.69.82.204\/win\/?p=20876"},"modified":"2021-08-03T08:20:10","modified_gmt":"2021-08-03T06:20:10","slug":"petitpotam-angriffe-auf-windows-durch-filter-blocken","status":"publish","type":"post","link":"https:\/\/borncity.com\/win\/2021\/08\/03\/petitpotam-angriffe-auf-windows-durch-filter-blocken\/","title":{"rendered":"PetitPotam attacks on Windows blocked by RPC filters"},"content":{"rendered":"<p><img decoding=\"async\" title=\"Windows\" style=\"float: left; margin: 0px 10px 0px 0px; display: inline\" alt=\"Windows\" src=\"https:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2021\/04\/Windows-klein.jpg\" width=\"200\" align=\"left\">[<a href=\"https:\/\/www.borncity.com\/blog\/2021\/08\/03\/petitpotam-angriffe-auf-windows-durch-filter-blocken\/\" target=\"_blank\" rel=\"noopener\">German<\/a>]Security researchers recently disclosed a new attack vector called PetitPotam. By means of an NTLM relay attack, any Windows domain controller can be taken over.&nbsp; In the meantime, Microsoft has responded and published a security advisory about this security issue. But there is a second proposal from security researchers to block the attack via RPC filters. But this proposal is not a universal solution. <\/p>\n<p><!--more--><\/p>\n<h2>The PetitPotam attack<\/h2>\n<p>DFrench security researcher Gilles Lionel (alias Topotam) had published a proof of concept (PoC) in July 2021 for exploiting an NTLM relay attack that can take over Windows Domain Controllers. Security researchers had come across <a href=\"https:\/\/posts.specterops.io\/certified-pre-owned-d95910965cd2?gi=9e542a7e34ce\" target=\"_blank\" rel=\"noopener\">a method<\/a> to force a domain controller to authenticate to a malicious NTLM relay. The allows then to forward the request over HTTP to a domain's Active Directory certificate services. Ultimately, the attacker obtains a Kerberos ticket (TGT) that could be used to assume the identity of any device on the network, including a domain controller.<\/p>\n<p>I had reported about this in the post <a href=\"https:\/\/borncity.com\/win\/2021\/07\/24\/petitpotam-angriff-erlaubt-windows-domain-bernahme\/\">PetitPotam attack allows Windows domain takeover<\/a>. A day later, Microsoft confirmed this attack scenario, which affects virtually all server operating systems from Windows Server 2008 to Windows Server 20H2. At the same time, Microsoft makes suggestions on how this vulnerability can be mitigated by administrators. Domain administrators need to ensure that services that allow NTLM authentication use protections such as Extended Protection for Authentication (EPA) or signing capabilities such as SMB signing. I had reported the details in the Microsoft blog post <a href=\"https:\/\/borncity.com\/win\/2021\/07\/25\/microsoft-liefert-workaround-fr-windows-petitpotam-ntlm-relay-angriffe\/\">Microsoft's mitigations of Windows PetitPotam NTLM relay attacks<\/a>.  <\/p>\n<h2>Block PetitPotam attacks with NETSH fitters<\/h2>\n<p>Over the weekend, I had already read the following information from Benjamin Delpy on <a href=\"https:\/\/twitter.com\/gentilkiwi\/status\/1421949715986403329\" target=\"_blank\" rel=\"noopener\">Twitter<\/a> about how to block MS-EFSR PetitPotam calls via RPC filters. raigKirby had pointed out this possibility in question. <\/p>\n<p><a href=\"https:\/\/twitter.com\/gentilkiwi\/status\/1421949715986403329\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" title=\"PetitPotam RPC-Filter\" alt=\"PetitPotam RPC-Filter\" src=\"https:\/\/i.imgur.com\/1k5GHy6.png\"><\/a><\/p>\n<p>However, this filtering technique said nothing to me and it was unclear to me whether something went there with on-board means. However, Delpy must have been in contact with the colleagues at Bleeping Computer, who addressed the issue in <a href=\"https:\/\/www.bleepingcomputer.com\/news\/microsoft\/windows-petitpotam-attacks-can-be-blocked-using-new-method\/\" target=\"_blank\" rel=\"noopener\">this post<\/a>.&nbsp; Delpy suggests the following NETSH-RPC filter, which blocks remote access to the MS-EFSRPC API, effectively blocking the unauthenticated PetitPotam attack vector. To do this, save the following instructions to a <em>block_efsr.txt<\/em> file on the administrator account desktop.<\/p>\n<pre><code>rpc\nfilter\nadd rule layer=um actiontype=block\nadd condition field=if_uuid matchtype=equal data=c681d488-d850-11d0-8c52-00c04fd90f7e\nadd filter\nadd rule layer=um actiontype=block\nadd condition field=if_uuid matchtype=equal data=df1941c5-fe89-4e79-bf10-463657acf44d\nadd filter\nquit<\/code><\/pre>\n<p>Then open an administrative command prompt and run the following command to import the filter:<\/p>\n<pre>netsh -f %userprofile%\\desktop\\block_efsr.txt\n<\/pre>\n<p>If an administrator then runs the following command in an administrative command prompt as a check, the two filters shown below should be displayed.<\/p>\n<pre>netsh rpc filter show filter<\/pre>\n<pre><img decoding=\"async\" title=\"PetitPotam RPC-Filter\" alt=\"PetitPotam RPC-Filter\" src=\"https:\/\/i.imgur.com\/RdW5uYK.png\"><\/pre>\n<p>With these filters, a PetitPotam attack should no longer work, while EFS will still be able to be used normally on the system. Security researcher Will Dormann confirms in <a href=\"https:\/\/twitter.com\/wdormann\/status\/1421972691867865091\" target=\"_blank\" rel=\"noopener\">this tweet<\/a>, that this filtering works. <\/p>\n<p><a href=\"https:\/\/twitter.com\/wdormann\/status\/1421972691867865091\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" title=\"PetitPotam RPC-Filter\" alt=\"PetitPotam RPC-Filter\" src=\"https:\/\/i.imgur.com\/nqenJW8.png\"><\/a><\/p>\n<p>However, it is important to note that this only blocks remote attacks. French security researcher Gilles Lionel (alias Topotam) points out the issue in <a href=\"https:\/\/twitter.com\/topotam77\/status\/1422419120260370432\" target=\"_blank\" rel=\"noopener\">this tweet<\/a>.<\/p>\n<p><a href=\"https:\/\/twitter.com\/topotam77\/status\/1422419120260370432\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/i.imgur.com\/busWO4S.png\"><\/a><\/p>\n<p>At this point, however, it is unclear to me how well the RPC filter now protects, because the attacker already needs access to the domain. If Microsoft ever fixes the API to block this attack vector, this filter can be removed with the following command in an administrative prompt:<\/p>\n<pre>netsh rpc filter delete filter filterkey=[key]<\/pre>\n<p>Maybe it will help you anyway.<\/p>\n<p><strong>Similar articles:<\/strong><br \/><a href=\"https:\/\/borncity.com\/win\/2021\/07\/24\/petitpotam-angriff-erlaubt-windows-domain-bernahme\/\">PetitPotam attack allows Windows domain takeover<\/a><br \/><a href=\"https:\/\/borncity.com\/win\/2021\/07\/25\/microsoft-liefert-workaround-fr-windows-petitpotam-ntlm-relay-angriffe\/\">Microsoft's mitigations of Windows PetitPotam NTLM relay attacks<\/a><br \/><a href=\"https:\/\/borncity.com\/win\/2021\/07\/29\/microsoft-security-update-revisions-29-juli-2021\/\">Microsoft Security Update Revisions (July 29, 2021)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[German]Security researchers recently disclosed a new attack vector called PetitPotam. By means of an NTLM relay attack, any Windows domain controller can be taken over.&nbsp; In the meantime, Microsoft has responded and published a security advisory about this security issue. &hellip; <a href=\"https:\/\/borncity.com\/win\/2021\/08\/03\/petitpotam-angriffe-auf-windows-durch-filter-blocken\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[580,2],"tags":[69,194],"class_list":["post-20876","post","type-post","status-publish","format-standard","hentry","category-security","category-windows","tag-security","tag-windows"],"_links":{"self":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/20876","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/comments?post=20876"}],"version-history":[{"count":0,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/20876\/revisions"}],"wp:attachment":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/media?parent=20876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/categories?post=20876"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/tags?post=20876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}