{"id":17078,"date":"2016-02-25T12:12:53","date_gmt":"2016-02-25T17:12:53","guid":{"rendered":"https:\/\/www.nicknormal.com\/normalblog\/?p=17078"},"modified":"2016-02-25T17:07:35","modified_gmt":"2016-02-25T22:07:35","slug":"eliminating-js-obfuscator-from-a-wordpress-install","status":"publish","type":"post","link":"https:\/\/www.nicknormal.com\/normalblog\/eliminating-js-obfuscator-from-a-wordpress-install\/","title":{"rendered":"Eliminating JS Obfuscator from a WordPress install"},"content":{"rendered":"<p><a href=\"http:\/\/www.microsoft.com\/security\/portal\/threat\/encyclopedia\/entry.aspx?name=VirTool%3aJS%2fObfuscator.HO&amp;threatid=2147709220&amp;enterprise=0\" rel=\"attachment wp-att-17079\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"17079\" data-permalink=\"https:\/\/www.nicknormal.com\/normalblog\/eliminating-js-obfuscator-from-a-wordpress-install\/js_obfuscator\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.nicknormal.com\/normalblog\/wp-content\/uploads\/2016\/02\/js_obfuscator.png?fit=608%2C503&amp;ssl=1\" data-orig-size=\"608,503\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"js_obfuscator\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.nicknormal.com\/normalblog\/wp-content\/uploads\/2016\/02\/js_obfuscator.png?fit=608%2C503&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.nicknormal.com\/normalblog\/wp-content\/uploads\/2016\/02\/js_obfuscator.png?fit=608%2C503&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.nicknormal.com\/normalblog\/wp-content\/uploads\/2016\/02\/js_obfuscator.png?resize=608%2C503&#038;ssl=1\" alt=\"js_obfuscator\" width=\"608\" height=\"503\" class=\"aligncenter size-full wp-image-17079\" srcset=\"https:\/\/i0.wp.com\/www.nicknormal.com\/normalblog\/wp-content\/uploads\/2016\/02\/js_obfuscator.png?w=608&amp;ssl=1 608w, https:\/\/i0.wp.com\/www.nicknormal.com\/normalblog\/wp-content\/uploads\/2016\/02\/js_obfuscator.png?resize=200%2C165&amp;ssl=1 200w\" sizes=\"(max-width: 608px) 100vw, 608px\" \/><\/a><\/p>\n<p>The <a href=\"http:\/\/www.microsoft.com\/security\/portal\/threat\/encyclopedia\/entry.aspx?name=VirTool%3aJS%2fObfuscator.HO&#038;threatid=2147709220&#038;enterprise=0\" target=\"_blank\">JS\/Obfuscator.HO virus<\/a> (safe link, promise) recently made its way onto one of my WordPress installations. It&#8217;s been probably 9-10 years since I&#8217;ve had a website attack &#8211; it was a good run. But thankfully the attacks of today (while more clever, cloaked, and potentially harmful) aren&#8217;t the attacks of yesteryear, and the tools today provide pretty quick fixes to the problem\/s at hand.<\/p>\n<p>My issue resulted in malicious JavaScript code somehow finding its way into multiple JavaScript files located in \/wp-admin\/js\/ &#8211; interestingly, the code prompted Google to blacklist the site from Chrome browsers (and subsequently other brand browsers), alerting me to the issue when I next visited the website. My webhost on the other hand provided no prompt, and when I notified them of the security alert they gave me <a href=\"https:\/\/mediatemple.net\/community\/products\/grid\/204644830\/recover-from-a-site-hack-or-compromise\" target=\"_blank\">a page of tips<\/a> and recommended I purchase <a href=\"https:\/\/mediatemple.net\/cloudtech\/security\/\" target=\"_blank\">a security patch<\/a> from them at either the rate of $150 for a one-off fix or a recurring monthly fee of $50\/month. Now, granted, the malicious code might have found its way online through a porous opening in either a plugin or theme that was my responsibility, or even via core WordPress code, but it also seems plausible its the fault of the webhost who are meant to secure the connections established with their servers &#8211; and furthermore those rates are ridiculous, especially considering what the fix winded up being.<\/p>\n<p>Knowing the code was online, I wouldn&#8217;t visit the site via HTTP. I logged in instead via sFTP and began to examine what I could. Nothing looked out of place, but I didn&#8217;t know yet what I was looking for. I immediately renamed the themes and plugins folders to disable those potential vulnerabilities, until the code could be confirmed safe.<\/p>\n<p>Not suspecting either the wp-includes or wp-admin folders, I still decided to basically download the static files for the entire domain; at this point, Windows Security Essentials (for Win7 64bit) prompted me to some threat &#8211; when downloading the files via sFTP! This gave me the name of the virus: JS\/Obfuscator.HO &#8211; now I know what to look for, although this virus is barely two weeks old! I eventually isolated the code to the \/wp-admin\/js\/ folder, and found the code was running in not one or two but <em>twelve <\/em>files:<\/p>\n<ul>\n<li>accordion.js<\/li>\n<li>accordion.min.js<\/li>\n<li>bookmarklet.js<\/li>\n<li>bookmarklet.min.js<\/li>\n<li>color-picker.js<\/li>\n<li>comment.js<\/li>\n<li>comment.min.js<\/li>\n<li>common.js<\/li>\n<li>common.min.js<\/li>\n<li>custom-background.js<\/li>\n<li>custom-background.min.js<\/li>\n<li>custom-header.js<\/li>\n<\/ul>\n<p>Unbelievable.<\/p>\n<p>Okay, so at this point I prompted the webhost to where the code was isolated, and renamed the folder so its location would be&#8230;<em>obfuscated<\/em>.<\/p>\n<p>It was at this junction that the webhost asked me to pay them money, at which point I balked. I knew where the code was, now I just had to replace it, and patch any other possible holes in the dam. I updated the core WordPress files, all the while very casually (it&#8217;s important that you <a href=\"https:\/\/c1.staticflickr.com\/5\/4052\/4512507780_3e194bdab4_b.jpg\" target=\"_blank\">DON&#8217;T PANIC!<\/a>) reading multiple pages on this process. Notable assistant documents included:<\/p>\n<p><strong><a href=\"https:\/\/support.google.com\/webmasters\/answer\/163633\" target=\"_blank\">What is malware?<\/a><\/strong> by Google&#8217;s Search Console help<br \/>\n<strong><a href=\"https:\/\/support.google.com\/webmasters\/answer\/3258249\" target=\"_blank\">Malware and unwanted software<\/a><\/strong>, also by Google Search Console help<br \/>\n<strong><a href=\"https:\/\/securelist.com\/threats\/what-if-my-computer-is-infected\/\" target=\"_blank\">What if my computer is infected?<\/a><\/strong> by Securelist<br \/>\n<strong><a href=\"http:\/\/codex.wordpress.org\/FAQ_My_site_was_hacked\" target=\"_blank\">FAQ My site was hacked<\/a><\/strong> by WordPress Codex<\/p>\n<p>And when you reckon you&#8217;ve cleared the virus from your server you can run a scan report <em>on any URL<\/em> utilizing 60+ trusted online security agents using <a href=\"https:\/\/www.virustotal.com\/en\/\" target=\"_blank\">VirusTotal&#8217;s scanner<\/a>.<\/p>\n<p>No extreme measures were necessary. Once the files were replaced and I flushed the DNS of the server pointing to locations prompted as <em>possible <\/em>vulnerabilities by Google, then all I had to do was request a re-indexing of the safety of the domain using Google&#8217;s <a href=\"https:\/\/www.google.com\/webmasters\/tools\/home?hl=en\" target=\"_blank\">Webmaster Tools<\/a> service. I did this right before going to bed and by the time I woke up service to the website was re-established &#8211; no fee necessary!<\/p>\n<p>So if I can do it you can too. Just be patient, don&#8217;t jump to conclusions, and unless you really feel you can&#8217;t handle it or you have more money than time, you probably don&#8217;t need to pay your webhost either.<\/p>\n<div class='ctx-module-container ctx_default_placement ctx-clearfix'><\/div><span class=\"ctx-article-root\"><!-- --><\/span>","protected":false},"excerpt":{"rendered":"<p>The JS\/Obfuscator.HO virus (safe link, promise) recently made its way onto one of my WordPress installations. It&#8217;s been probably 9-10 years since I&#8217;ve had a website attack &#8211; it was a good run. But thankfully the attacks of today (while more clever, cloaked, and potentially harmful) aren&#8217;t the attacks of yesteryear, and the tools today [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":17079,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20],"tags":[1342,102],"series":[],"class_list":["post-17078","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-geekathon","tag-virus","tag-webhost"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.nicknormal.com\/normalblog\/wp-content\/uploads\/2016\/02\/js_obfuscator.png?fit=608%2C503&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p6OfVu-4rs","_links":{"self":[{"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/posts\/17078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/comments?post=17078"}],"version-history":[{"count":7,"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/posts\/17078\/revisions"}],"predecessor-version":[{"id":17086,"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/posts\/17078\/revisions\/17086"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/media\/17079"}],"wp:attachment":[{"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/media?parent=17078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/categories?post=17078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/tags?post=17078"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.nicknormal.com\/normalblog\/wp-json\/wp\/v2\/series?post=17078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}