We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34109
    • 119 Posts
    Very strange one. I have a site (Revo 2.2.7 running in IIS) which has been hacked. When a resource is requested by a search engine bot a load of viagra links are injected into the page. Any other browser sees the correct site, but with a load of empty lines at the top of the page. I've since updated to 2.2.9 but the issue's still there. There must be something intercepting requests to the site, but I can't find it. Any ideas of where to start looking?
      Studio Republic
      http://www.studiorepublic.com
      0845 226 3205
      @christodhunter
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Check the config.inc.php file and the index.php file. Look for suspicious Javascript or eval() functions; there shouldn't be any in those files.
        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
        • 22840
        • 1,572 Posts
        Also make sure you have deleted everything in the core/cache folder
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          Mark Hamstra Reply #4, 13 years ago
          On top of the other suggestions, also check the .htaccess file (or the IIS equivalent) for anything that shouldn't be there, in particular auto_prepend_file/auto_append_file flags.

          It's also possible a plugin can insert data to the pages, so check for anything suspicious there too.
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 41406 ☆ A M B ☆
            • 30 Posts
            I've been done by that one before... In my case it had injected a load of base64 encoded php into the top of every index.php file it could find on the machine.
            The base64, once decoded, seemed to sniff the user agent and link source and only deface the site when the user visited via google - quite cunning really as a webmaster wouldn't see it going direct the their site.

            Check all the way accross the file aswell... i missed a couple at first 'cos they had a couple of hundred empty spaces at the start of the line to push the malicious code off the side of my editor.

            Do you have an older phpMyAdmin running on the server by any chance?
              • 34109
              • 119 Posts
              Thanks for your responses guys. Alan had it spot on - base64 encoded code in 143 files! Looks like I'll be rebuilding the site. It's not my server (apache all the way here) but it looks like someone has installed at least a couple of instances of phpmyadmin too.
                Studio Republic
                http://www.studiorepublic.com
                0845 226 3205
                @christodhunter
                • 22840
                • 1,572 Posts
                I really can't see why the files would still be compromised after the upgrade as you would have overwritten all the affected files, if you had overwritten them all then I would make sure that all passwords to the account ( hosting, ftp, manager etc ) have been changed as you may have been hit again.