• Resolved rossagrant

    (@rossagrant)


    Hi guys!

    I think this has been spreading a fair bit over the last few weeks.

    Today 2 of my sites (on the same server) got hit by a ‘Hacked By Badi’ hack.

    Here’s a detailed look at what it does:

    1. It changes your site title to something like this:
    +ADw-/title+AD4-Hacked By Badi+ADw-DIV style+AD0AIg-DISPLAY: none+ACIAPgA8-xmp+AD4-

    2. It creates a non registered sidebar in your ‘Widgets’ area and inserts a text widget with some script in it which looks like this:

    <script>document.documentElement.innerHTML = unescape([ redacted ]);</script>

    ALL widgets are removed from the sidebar that are currently on your site, so you have no widgets displaying in the front end.

    3. It changes your charset from UTF-8 to UTF 7.

    Now I HAVE NO IDEA how this happens, as no users are created, it doesn’t look like wp-config is altered, no passwords are changed etc.

    Now I have Vaultpress and looking at my logs for the day (it’s been a pretty quiet day on my WP/ Buddypress site) I see that between 9:21am and 10:21am that 33 uploads to the uploads folder were made.

    I can’t be sure, but I don’t think these were uploaded by a user. They weren’t uploaded by me.

    None of the hack’s affects were felt at this time though, as I was online until midday, and a user submitted a Gravity form at about 4:30PM through a widget.

    They wouldn’t have been able to see the widget once the hack was in place.

    Vaultpress shows me that my site title and charset weren’t changed until about 8:30pm, so maybe the uploads and this hack were unrelated.

    I have deleted the text widget created, changed me charset back to UTF-8 through settings—> reading WHICH SHOULDN’T ACTUALLY SHOW THAT OPTION SINCE WP 3.5 (so the script must bring that option back too), and changed my site title back.

    I was just wondering if those who have experienced this would post a list of the plugins they use.

    We can then cross check and see if there is a plugin flaw causing this.

    It looks like an SQL injection, but I have no idea how they work.

    Seems a bit too widespread to be a host issue perhaps.

    I really don’t know, but if we put our heads together, we can hopefully get to the bottom of it.

    I have Securi on this too.

    Please pitch in!

Viewing 11 replies - 76 through 86 (of 86 total)
  • Thread Starter rossagrant

    (@rossagrant)

    Thanks Brian, that’s super helpful and I have passed it on to my host.

    I have now set the wp-config.php permissions to 600 and also moved them up one level to root, so hopefully they are well locked away now.

    Will keep everyone posted here when I hear back from my host.

    Thanks again!

    Out of interest, I am on a kind of ‘shared’ dedicated server.

    It’s a decent server but there are 12 of us on it, not hundreds like you usually get.

    Would a VPS stop any of the cross site scripting?

    I think I want my host to move me to a VPS as opposed to the current setup. Would that be even more secure?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    From what I’ve read and from the couple sites I’ve examined with this issue, the problem appears to be specific to certain shared hosts. This does not appear to be a problem with WordPress itself.

    Basic security tips:

    – Set the permissions on the wp-config.php file to 600. If this “breaks” the site, then you can adjust it to 640 or 644 to make the site work. However, the site may not be secure in these circumstances on a shared hosting account. You may want to switch to alternate hosting in such a case.

    – Ensure that your shared hosting system is using “setuid” or “setuser” or “suPHP” or some method involving the letters “SU”. Different names for the same basic concept, really.

    – If the host uses directory-level access protections, then moving the wp-config.php file up one directory can mitigate some issues. However, this is generally not intended as a security measure, and may be ineffective. If I have the ability to run code on your server on one website, and the server has poor-intra-user security, then I can leverage that to read any files the webserver can normally read. An “SU” method would prevent this.

    -Finally, if you are on a shared host and find yourself repeatedly vandalized like this, then switch hosts. If your site generates a lot of traffic, consider switching up to a VPS or something not on a “shared” host to eliminate this as a problem.

    Note that the initial hack has nothing to do with “cross-site-scripting”, and the “UTF-7” thing is a red-herring in this specific instance. It is not a prime-cause of the attack, nor is it related to how the site was compromised.

    Thread Starter rossagrant

    (@rossagrant)

    Just out of interest, has anyone been hacked by this that WASN’T on a shared server?

    Anyone get hit on a VPS or dedicated server – not in a shared environment?

    Interestingly enough no. Are we allowed to name which hosts were hacked and what wasn’t? I’ve got 3 shared hosts on my end and one that I’m helping out for and only that one (that I’m helping out for) got hacked.

    Also any pointers on what I can tell the hosts to patch up? The hosts are apparently denying anything happened and are saying it was outdated wordpress… but I have 3.5 across the board. We’re vigilant about updates. Cpanel always worked fine and that seemed to have escaped the problems that other people mentioned.

    Are we allowed to name which hosts were hacked

    There is no rule here to prohibit it and it might be very useful to compare notes in this particular case.

    The only information that we have is a claim that this was a server hack via an insecure site on the server.

    @rossagrant: I cannot thank you enough. Your fix has got my blog back up. I’m not a coder, nor do I use wordpress for any professional reasons, but like everyone else I have wasted hours trying to work out how to fix it.

    I had given up, and was about to resign myself to a long down-time, when I just thought I’d re-check this thread, and within 15 minutes my blog was back.

    Thank you, thank you, thank you.

    If there is any info I can give you that will help figure out how they got in, let me know. I won’t randomly post info, as I don’t know what is helpful.

    My fixed site: https://www.empin.us/
    I also have a site here https://www.elisechohan.co.uk/blog/ which I haven’t fixed yet.

    Thank you again.

    Thread Starter rossagrant

    (@rossagrant)

    No worries eplans, glad you got it fixed!

    Esmi, I’m not sure if we should post hosts as those that are less pro-active in fixing this issue may be retargeted.

    Perhaps when we know everyone has heard back from their hosts with what action has been taken and that any potential issue has been resolved.

    People right now need to be setting their wp-config.php file to the permission 600 if possible and moving it up one level above the default directory.

    That will stop anyone from reading DB passwords if they are hacked.

    You too should do that eplan.

    FTP into your install and right click your wp-config..php file, click on permissions and change it to 600.

    See if the site still functions properly. If not use 640.

    Then when it works, move your wp-config.php file up one directory into the root of your server.

    If it all works and your blog functions leave it there, it will be much safer.

    Hi Guys,

    I am not on a shared server and still can’t seem to figure out how to get my website up and running.

    I was unable to find the UTF charset option in wordpress settings > reading as I am running wordpress 3.5.1, I am wondering if anyone hase a fix for this yet?

    Thanks,
    Brandon

    @thehighersociety You could always change the encoding in PMA – just search for UTF-7 in wp-options (option_name = blog_charset).

    I got attacked with a similar attack yesterday, sidebar contains JS that replaces page contents using UTF-7 to bypass security. Long-ish blog post that describes the thought process: https://sqroot.eu/2013/02/victim-of-a-xss-attack-speaks/

    Mine is hosted at Namecheap aka Web-Hosting.com. I’ll try to ask if they can restore a good back-up since I only noticed the problem now. ??

Viewing 11 replies - 76 through 86 (of 86 total)
  • The topic ‘Calling all site owners hacked by walangkaji/ Badi etc. – Need some help’ is closed to new replies.