Solved

How to protect against SQL injections

Posted on 2011-09-20
5
211 Views
Last Modified: 2012-05-12
We have just suffered a SQL injection into our sql 2008 database running our .net websites.

The intruders planted a script in all our content item that would have displayed a page of links offset so as not to be visible to users, but picked up by search engines.

I am shocked by how they have managed to retrieve the names of tables and fields.

How can we determine where they got in, and how can we protect ourselves from such threats in future?
0
Comment
Question by:nhmedia
5 Comments
 
LVL 10

Accepted Solution

by:
gaurav05 earned 125 total points
ID: 36571769
Hi,

check this one,

http://msdn.microsoft.com/en-us/library/ff648339.aspx


let us know for  more information.
0
 
LVL 9

Assisted Solution

by:mimran18
mimran18 earned 125 total points
ID: 36571938
0
 
LVL 10

Assisted Solution

by:sqlservr
sqlservr earned 125 total points
ID: 36572469
this url helps you with sample and good explanation
http://www.unixwiz.net/techtips/sql-injection.html
0
 
LVL 1

Assisted Solution

by:millsap_singer
millsap_singer earned 125 total points
ID: 36581893
Use parameterized queries for your insert/update statements.  
0
 

Author Closing Comment

by:nhmedia
ID: 36949414
In the end we came up with our own solution based on an http handler to prevent undesirable requests being processed.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
GRANT, REVOKE, DENY 4 38
Params not declared?  T-SQL syntax question 3 39
tempdb latch contention 12 50
Sql Query Datatype 2 19
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now