{"id":6331,"date":"2017-01-23T15:50:24","date_gmt":"2017-01-23T23:50:24","guid":{"rendered":"http:\/\/www.palada.net\/index.php\/2017\/01\/23\/news-169\/"},"modified":"2017-01-23T15:50:24","modified_gmt":"2017-01-23T23:50:24","slug":"news-169","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2017\/01\/23\/news-169\/","title":{"rendered":"Double-click me not: Malicious proxy settings in OLE Embedded Script"},"content":{"rendered":"<p>Attackers have been using social engineering to avoid the increasing costs of exploitation due to the significant hardening and exploit mitigations investments in Windows. Tricking a user into running a malicious file or malware can be cheaper for an attacker than building an exploit which works on Windows 10. In our previous blog, <a href=\"https:\/\/blogs.technet.microsoft.com\/mmpc\/2016\/06\/14\/wheres-the-macro-malware-author-are-now-using-ole-embedding-to-deliver-malicious-files\/\">Where\u2019s the macro<\/a><u>,<\/u> we reviewed how attackers leverage social engineering to misuse the legitimate Office object linking and embedding (OLE) functionality to trick users into enabling and downloading malicious content.<\/p>\n<p>We recently came across a threat that uses the same social engineering trick but delivers a different payload. Its primary purpose is to change a user&#8217;s browser Proxy Server setting which could result in the theft of authentication credentials or other sensitive information. We detect this JScript malware as <a href=\"http:\/\/www.microsoft.com\/security\/portal\/threat\/encyclopedia\/Entry.aspx?Name=Trojan:JS\/Certor.A\">Trojan:JS\/Certor.A<\/a><strong>.<\/strong><\/p>\n<p>What\u2019s not unique is that the malware gets into the victim\u2019s computer when the victim clicks the email attachment from a spam campaign.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"462\" height=\"451\" class=\"alignnone size-full wp-image-8735\" alt=\"Sample email lures potential Certor victim shows as it pretends to be a document (.docx file) from a legitimate company\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor1.png\" \/><\/a><\/p>\n<p><em>Figure 1: The sample email shows how the threat pretends to be a document (.docx file) from a legitimate company.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>Inside the <em>.docx<\/em> file is an OLE Embedded Object which runs a script when double-clicked. It tries to mask itself by changing its icon to something that resembles an invoice or receipt.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor2_updated.png\"><img loading=\"lazy\" decoding=\"async\" width=\"669\" height=\"404\" class=\"alignnone size-full wp-image-8745\" alt=\"The file contains text written in German: Um Quittung zu sehen, klicken Sie zwei Mal auf dem Bild, which translates: \u201cTo see a receipt, click twice on the screen.\u201d\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor2_updated.png\" \/><\/a><\/p>\n<p><em>Figure 2: The file contains text written in German: Um Quittung zu sehen, klicken Sie zwei Mal auf dem Bild, which translates: \u201cTo see a receipt, click twice on the screen.\u201d<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>Double-clicking the image runs the JScript that is disguised to appear as a harmless file.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"679\" height=\"411\" class=\"alignnone size-full wp-image-8755\" alt=\"The JS file typically has file names such as, paypal_bestellung.js and post.ch_65481315.js.\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor3.png\" \/><\/a><\/p>\n<p><em>Figure 3: The JS file typically has file names such as, paypal_bestellung.js and post.ch_65481315.js.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>But if the script was executed, it would proceed with its malicious objective which is described in the remainder of this blog post.<\/p>\n<h2>What is in the script?<\/h2>\n<p>The JScript is obfuscated to hide its code and the other script it contains.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"778\" height=\"423\" class=\"alignnone size-full wp-image-8765\" alt=\"A screnshot of the JScript malware that we detect as Trojan:JS\/Certor.A\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor4.png\" \/><\/a><\/p>\n<p><em>Figure 4: We detect this JScript malware as Trojan:JS\/Certor.A<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>Upon deobfuscation, the main script code is revealed.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"688\" height=\"662\" class=\"alignnone size-full wp-image-8775\" alt=\"Screenshot of the script that is responsible for dropping, executing its components, and modifying registry keys related to the browser\u2019s proxy settings.\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor5.png\" \/><\/a><\/p>\n<p><em>Figure 5: This is the script that is responsible for dropping, executing its components, and modifying registry keys related to the browser\u2019s proxy settings.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>The main JScript code contains encrypted PowerShell scripts and its own certificate. The certificate is later used to enable monitoring of HTTPS content and traffic.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"817\" height=\"265\" class=\"alignnone size-full wp-image-8785\" alt=\"Screenshot of the other script components are decrypted using the above function.\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor6.png\" \/><\/a><\/p>\n<p><em>Figure 6: The other script components are decrypted using the above function.<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>The following component files would be dropped in the temp folder and executed.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"279\" height=\"119\" class=\"alignnone size-full wp-image-8795\" alt=\"Screenshot of sample component files dropped.\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor7.png\" \/><\/a><\/p>\n<p><em>Figure 7: Sample component files dropped<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>The malware carries a certificate of its own (<em>cert.der<\/em>).<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"411\" height=\"510\" class=\"alignnone size-full wp-image-8805\" alt=\"Screenshot of the sample certificate information from this malware.\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor8.png\" \/><\/a><\/p>\n<p><em>Figure 8: Sample certificate information from this malware<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor9.png\"><img loading=\"lazy\" decoding=\"async\" width=\"412\" height=\"510\" class=\"alignnone size-full wp-image-8815\" alt=\"Screenshot of the sample certificate details\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor9.png\" \/><\/a><\/p>\n<p><em>Figure 9: Sample certificate details<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor10.png\"><img loading=\"lazy\" decoding=\"async\" width=\"410\" height=\"510\" class=\"alignnone size-full wp-image-8825\" alt=\"Screenshot of certificate details\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor10.png\" \/><\/a><\/p>\n<p><em>Figure 10: Further certificate details<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>The threat adds the <em>cert.der<\/em> file as certificate so it can monitor HTTPS content and traffic.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor11.png\"><img loading=\"lazy\" decoding=\"async\" width=\"512\" height=\"472\" class=\"alignnone size-full wp-image-8835\" alt=\"certor11\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor11.png\" \/><\/a><\/p>\n<p><em>Figure 11: A screenshot of the sample certificate added by this threat<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>The <em>ps.ps1<\/em> file is responsible for making sure the certificate is installed.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor12.png\"><img loading=\"lazy\" decoding=\"async\" width=\"538\" height=\"369\" class=\"alignnone size-full wp-image-8845\" alt=\"Screenshot of the PowerShell code that we detect as Trojan:PowerShell\/Certor.A\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor12.png\" \/><\/a><\/p>\n<p><em>Figure 12: We detect these PowerShell code as <\/em><a href=\"http:\/\/www.microsoft.com\/security\/portal\/threat\/encyclopedia\/Entry.aspx?Name=Trojan:PowerShell\/Certor.A\"><em>Trojan:PowerShell\/Certor.A<\/em><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The <em>psf.ps1<\/em> file is responsible for adding its certificate to Mozilla Firefox browser. This is necessary because <a href=\"https:\/\/wiki.mozilla.org\/CA:AddRootToFirefox\">Firefox uses its own certificate store<\/a> instead of the one provided by the operating system.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor13.png\"><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"350\" class=\"alignnone size-full wp-image-8855\" alt=\"Screenshot of a sample script that the threat used to add the certificate in Firefox.\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor13.png\" \/><\/a><\/p>\n<p><em>Figure 13: Sample script that the threat used to add the certificate in Firefox<\/em><\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p>The <em>pstp.ps1<\/em> file is responsible for installing the Tor client, task scheduler and proxifier. This is another malware technique to tamper with the browser&#8217;s Proxy Settings.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor14.png\"><img loading=\"lazy\" decoding=\"async\" width=\"817\" height=\"427\" class=\"alignnone size-full wp-image-8865\" alt=\"Screenshot of sample script that the threat used to install the Tor client, task scheduler and proxifier\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor14.png\" \/><\/a><\/p>\n<p><em>Figure 14: Sample script that the threat used to install the Tor client, task scheduler and proxifier<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>The main JScript changes the following registry key to modify Internet Explorer\u2019s proxy settings.<\/p>\n<p style=\"padding-left: 30px\">In subkey: <em>HKCUSoftwareMicrosoftWindowsCurrentVersionInternet Settings<\/em><br \/> Sets value: <em>AutoConfigURL<\/em><br \/> With data: <em>http:\/\/pysvonjm6a7idbkz.onion\/rejtyahf.js?ip=&lt;host ip address&gt;<\/em><\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor15.png\"><img loading=\"lazy\" decoding=\"async\" width=\"817\" height=\"147\" class=\"alignnone size-full wp-image-8875\" alt=\"Screenshot of the registry entry that this threat changes\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor15.png\" \/><\/a><\/p>\n<p><em>Figure 15: Screenshot of the registry entry that this threat changes<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>When the URL is invoked, the following script code is returned. This code suggests that it is redirecting URLs to a specific proxy which may lead to websites hosting phishing and ad campaigns.<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor16.png\"><img loading=\"lazy\" decoding=\"async\" width=\"748\" height=\"148\" class=\"alignnone size-full wp-image-8885\" alt=\"Screenshot of the function that is revealed upon the script deobfuscation: function FindProxyForURL(url,host){return&quot;DIRECT&quot;}\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2016\/08\/certor16.png\" \/><\/a><\/p>\n<p><em>Figure 16: Upon the script deobfuscation, the following readable function is revealed: function FindProxyForURL(url,host){return&#8221;DIRECT&#8221;}<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>At this point the system is fully infected and the web traffic, including HTTPS, can be seen by the proxy server it assigned. This enables attackers to remotely redirect, modify and monitor traffic. Sensitive information, or web credentials could be stolen remotely, without user awareness.<\/p>\n<h2><strong>Recommendations<\/strong><\/h2>\n<p>To avoid attacks like we have just detailed, it is recommended that you only open, and interact with messages from senders and websites that you recognize and trust. For added defense-in-depth, you can reduce the risk from this threat by following the guidance in our previous <a href=\"https:\/\/blogs.technet.microsoft.com\/mmpc\/2016\/06\/14\/wheres-the-macro-malware-author-are-now-using-ole-embedding-to-deliver-malicious-files\/\">blog<\/a> post on how to adjust the registry settings to help prevent OLE Embedded Objects from executing altogether, or from running without your explicit permission.<\/p>\n<p><em>\u00a0<\/em><\/p>\n<p><em>Alden Pornasdoro and Vincent Tiu<\/em><\/p>\n<p><em>MMPC<\/em><\/p>\n<p><a href=\"https:\/\/blogs.technet.microsoft.com\/mmpc\/2016\/08\/29\/double-click-me-not-malicious-proxy-settings-in-ole-embedded-script\/\" target=\"bwo\" >https:\/\/blogs.technet.microsoft.com\/mmpc\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Attackers have been using social engineering to avoid the increasing costs of exploitation due to the significant hardening and exploit mitigations investments in Windows. Tricking a user into running a malicious file or malware can be cheaper for an attacker than building an exploit which works on Windows 10. In our previous blog, Where\u2019s the&#8230;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10759,10378],"tags":[10760,10871,10846,10937,10938,10939,10806,10940,10941,10942,10943,10910,10510,10518,10900,10833,10944,10945,10762],"class_list":["post-6331","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-security","tag-antimalware-research-for-it-pros-and-enthusiasts","tag-javascript","tag-javascript-spam-attachment","tag-jscript","tag-jscript-malware","tag-jscript-malware-prevention","tag-macro-based-malware","tag-malware-prevention-blog","tag-mitigate-ole-misuse","tag-obfuscated-jscript","tag-ole-misuse-mitigation","tag-ole-embedded-objects","tag-social-engineering","tag-spam","tag-spam-email-infection-vector","tag-trojan","tag-trojanjscertor-a","tag-trojanpowershellcertor-a","tag-windows-defender"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/6331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=6331"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/6331\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=6331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=6331"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=6331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}