Xử lý mã độc (Malware) gây index Tiếng Nhật

0
2627

Hiện tượng

  • Kết quả tìm kiếm của website  hiện ra toàn nội dung website mua sắm tiếng Nhật

Kiểm tra

  • Thư mục web được upload bởi user kusanagi/kusanagi, user này cũng thuộc group www, sẽ dùng để upload source code, file qua SCP, file upload qua đường này sẽ có owner là kusanagi/kusanagi
  • PHP chạy với quyền user httpd/www, do đó các file upload trên web sẽ có owner là httpd/www
  • Tìm kiếm *.php trong thư mục upload thì phát hiện có nhiều file plugin upload vào đây, bao gồm cả malware
./web/DocumentRoot/wp-content/uploads/2016/11/Mrcfge.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/comingsoon/Dhjgxn.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/media-gallery-two/Dhjgxn.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/rockband/Dhjgxn.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/rotatingwords/Dhjgxn.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/web-product-light-hero-3d/Dhjgxn.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/youtube-gallery/Dhjgxn.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/niceandclean_callout/Dhjgxn.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/80s/Mrcfge.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/filmstrip/Mrcfge.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/doubleexposureeffect/Dhjgxn.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/goodnewsheader/Dhjgxn.php
./web/DocumentRoot/wp-content/uploads/revslider/templates/goodnewsblogheader/Dhjgxn.php
./web/DocumentRoot/wp-content/uploads/smile_fonts/Defaults/charmap.php
./web/DocumentRoot/wp-content/uploads/smile_fonts/Defaults/index.php
./web/DocumentRoot/wp-content/uploads/smile_fonts/line-icons/charmap.php
./web/DocumentRoot/wp-content/uploads/2017/04/Dhjgxn.php
./web/DocumentRoot/wp-content/uploads/wpseo-redirects/index.php
  • Check access log cho thấy ngày 23-26/7/2017 có nhiều lần thử đăng nhập vào admin

  • Check access log cho thấy từ ngày 26/7/2017 xuất hiện rất nhiều lượt request của Yahoo! Slurp (SearchEngine bot)

Nguyên nhân

  • Website bị nhiễm mã độc, có thể qua các plugin cài đặt không an toàn
  • Mã độc hoạt động nhằm mục đích đánh cắp traffic SEO, bằng cách trả nội dung website khác khi nhận được request từ SearchEngine

Giải pháp

  • (đã thực hiện) Remove các file php tìm thấy trong thư mục <webroot>/wp-content/uploads/
  • (đã thực hiện) Cấu hình lại permission: 775 cho thư mục, 664 cho file, những file/folder có owner là httpd/www thì chưa tác động được
  • (đã thực hiện) Chuyển group owner của toàn bộ webroot sang www
  • (đã thực hiện) Re-submit sitemap mới lên Google Search Console, sẽ theo dõi trong vài ngày
    • Những kết quả cũ sẽ vẫn tồn tại nhưng không rõ bao giờ bị remove
    • Có option để Temporary hidden toàn bộ kết quả tìm kiếm của website, nhưng làm vậy sẽ hide luôn toàn bộ kết quả trong 90 ngày nên chưa thực hiện
  • Khuyến cáo cập nhật version WordPress mới nhất, cài thêm Wordfence để bảo mật đăng nhập, giới hạn IP truy cập admin chỉ allow từ công ty
  • Để tránh tình trạng file upload qua SCP/Web có owner khác nhau, thì nên thiết lập 1 user dùng SCP và cấu hình PHP chạy với quyền user này
  • Cần có biện pháp giám sát, phân tích log file để phát hiện vấn đề sớm
  • Tiếp tục theo dõi và cải thiện

Mã độc: rs_malware.zip

Tham khảo thêm: https://www.optimizesmart.com/malware-removal-checklist-for-wordpress-diy-security-guide/

Tham khảo thêm: https://blog.sucuri.net/2016/08/cleaning-hijacked-google-seo-spam-results.html

Leave a Reply

avatar
  Subscribe  
Notify of