tags:

views:

77

answers:

2

How can it be done?

Did you ever experienced something like this?

A: 

You have probably experienced Cross Site Scripting (XSS).

From Wikipedia:

Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications which enable malicious attackers to inject client-side script into web pages viewed by other users.

thephpdeveloper
The script is directed checked into source code.
Mask
Then it might be your server protection problem.
thephpdeveloper
+1  A: 

If you're finding JavaScript injected into your web site content (not via XSS but actually present in the file contents) you've most likely been hit by a worm or virus.

A good example is the Gumblar virus, which spread very rapidly indeed a few months ago; it used FTP password sniffing to find FTP details of people's sites and modified them, injecting malicious JavaScript to send site visitors to malware sites etc.

The specifics of removing such viruses depends on the specific virus, but a good start is:

  • Replace the contents of the site with a known clean backup
  • Make sure all security patches are applied to your server and all software you're running on it, as well as e.g. any modules or 3rd-party libraries being used on the site
  • Make sure all computers which are used to access the site (via FTP or an administration interface, for example) have been marked as clean by a reputable and up-to-date virus scanner so you don't get any passwords sniffed
  • As the password for your site may already have leaked out into the big wide world via (say) a botnet, change all your FTP + administration passwords on the site so you don't just have to go right back to the start again.

Good luck!

Cowan