We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23203
    • 12 Posts
    Hi All,

    After a recent hack to my site I have been running a cron job site audit. This morning it emailed me to say that manager/frames/nodes.php content had changed. Comparing the file on my site with the 1.0.0 release (which I had already upgraded to a few months ago) I find the only change is at the end of the following line:

    Modx-1.0.0 zip line 155
                       	$output .= '<span onclick="treeAction('.$id.', \''.addslashes($pagetitle).'\'); setSelected(this);" onmouseover="setHoverClass(this, 1);" onmouseout="setHoverClass(this, 0);" class="treeNode" onmousedown="itemToChange='.$id.'; selectedObjectName=\''.addslashes($pagetitle).'\'; selectedObjectDeleted='.$deleted.';" oncontextmenu="document.getElementById(\'f'.$id.'\').onclick(event);return false;" title="'.addslashes($alt).'">'.$pagetitleDisplay.$weblinkDisplay.'</span> '.$pageIdDisplay.'<div style="display:none"></div></div>';


    My Site line 155
                       	$output .= '<span onclick="treeAction('.$id.', \''.addslashes($pagetitle).'\'); setSelected(this);" onmouseover="setHoverClass(this, 1);" onmouseout="setHoverClass(this, 0);" class="treeNode" onmousedown="itemToChange='.$id.'; selectedObjectName=\''.addslashes($pagetitle).'\'; selectedObjectDeleted='.$deleted.';" oncontextmenu="document.getElementById(\'f'.$id.'\').onclick(event);return false;" title="'.addslashes($alt).'">'.$pagetitleDisplay.$weblinkDisplay.'</span> '.$pageIdDisplay.'</div>';


    The modification to my site file breaks the file tree branch expand.

    This is strange and worrying. It looks like human intervention as the file is cleanly edited. Is this a reversion to an earlier copy? I am worried if this is some proof of concept hack. Does anyone have a clue?

    Many thanks for looking.

    Cheers,
    Paul



      • 22303 MODX Staff
      • 10,725 Posts
      First, is this file writable by the webserver/PHP user, and if so, is anything in the access logs indicative of someone hacking the file (i.e. a POST with the added content in the payload)?
        • 23203
        • 12 Posts
        Thanks for the idea, I checked my raw logs and error files for any possible indicators.

        I know from the audit that the file was modified between 4am and 8am but annoyingly the raw logs only start from 6am! so I have 2 hrs where any potential change via http is invisible. I have posted a trouble ticket with my host - hoping they will have more info or confess to tweaking my files.

        Cheers,
        Paul
          • 2231
          • 10 Posts
          I’ve had the same exact thing happen. I replaced the nodes.php file with the one in my backup, but the next morning, the file has been altered again.
            • 23203
            • 12 Posts
            It has happened again with exactly the same change. I have now replaced the file with a commented version and changed file and directory access to read only. My host was not able to offer any advice.

            This is strange stuff indeed, there is no obvious access relating to this change that I can see in any log.

            Cheers,
            Paul
              • 26461
              • 2 Posts
              same thing happened to me.
                • 25663 MODX Staff
                • 12,272 Posts
                Please PM me with contact details (Skype account or US/Canada phone number) so we can follow up with you on this. Thank you; this is obviously important to us to get to the bottom of this.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 23203
                  • 12 Posts
                  The problem is still happening to my file - at this point I am blaming some host script since you would need root access or my login details to modify the file and put the read only directory and file mode back in place. As this is the only change I have found on my site it looks like a side effect of some maintenance script IMO. I have logged another support call with my host. If/when the sitaution changes I will post an update.

                  Cheers,
                  Paul
                    • 2231
                    • 10 Posts
                    Same for me - the problem still continues, even after replacing the file multiple times and changing the permissions. Never seen anything like that.
                      • 25663 MODX Staff
                      • 12,272 Posts
                      For all those that are experiencing this issue, what web host are you using? Are the modifications the same as Pharscape’s?

                      On your server, is the Apache/PHP user the same as the FTP user?
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me