What is the purpose of this script

Discussion in 'Programming' started by postcd, Jan 9, 2014.

  1. #1
    Hello, i found potentionally malicious script on my hosting shared cpanel account. What does this script do please?

    Here im pasting it safelly in text form:
    http://pastebin.com/5v8h0Hm2
     
    postcd, Jan 9, 2014 IP
  2. programmer_best1

    programmer_best1 Well-Known Member

    Messages:
    282
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    133
    #2
    the script print this

    its a shell, looks like there is a hacker on your shared host !!
     
    programmer_best1, Jan 9, 2014 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    yeah most likely your shared host server is compromised
     
    Bohra, Jan 10, 2014 IP
  4. StrongCoffee

    StrongCoffee Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    Looks like a perl script which attempts to extract config files from a load of well known systems on your webserver. A small search for "ScripT Extracting Config !n Serv ~v² 2o12~" gives a handful of infected servers, I guess you're not the only target.

    I assume you've already removed this script, if for whatever reason you haven't, do it pronto! Also, I'd suggest researching in which permission scope this script has been put. In worst case scenario, all neighboring virtual hosts have been compromised, in that situation I'd suggest informing all the users of your webserver that they've been compromised and that their websites potentially leaked all info from their configs. Advise them to change their credentials to all services related to the website, including database and all the users registered in the databases.

    Ofcourse, if you're not the owner of the webserver, then report the situation immediately to the webmaster.
     
    Last edited: Jan 11, 2014
    StrongCoffee, Jan 11, 2014 IP
  5. postcd

    postcd Well-Known Member

    Messages:
    1,043
    Likes Received:
    9
    Best Answers:
    1
    Trophy Points:
    190
    #5
    Thanks,

    pls can be anyhow checked whether this script actually got permissions to read mentioned config files?
    Which log files or how? It is cpanel/whm server with CentOS thx
     
    postcd, Jan 12, 2014 IP
  6. StrongCoffee

    StrongCoffee Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #6
    I'm not entirely sure how a PERL script would be handled permissions wise. I'd first check where the script was placed and which owner and group the file was placed. Also you might want to check the history files of other users (/home/users/{username}/.bash_history) if you can find if they run any suspicious commands. You might want to use "grep" for that.

    Other then that, I'd assume the worst, to be safe.

    Edit: I'm not really sure how cpanel's virtual hosts data is structured, but this script assumes that it's stuctured in /home/{user}/public_html/. If your path's are different, you might not be compromised.

    Edit 2: Cpanel does seem to handle that scructure, according to this page: http://www.webhostingbuzz.com/wiki/common-paths-cpanel-and-whm/
     
    Last edited: Jan 12, 2014
    StrongCoffee, Jan 12, 2014 IP
  7. deemainer

    deemainer Active Member

    Messages:
    351
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    78
    #7
    Wow....Just out interest.Where would you look on Cpanel account to check for malicious scripts?
     
    deemainer, Feb 4, 2014 IP