![]() |
| SQL injection attacks |
|
whitesites
|
One of my sites was attacked with this. I have implimented some code to prevent this in the future. Even though I am pretty sure I am protected now, does anyone have an recommendations for what to look for? In case anyone wants to scan their logs for this Jackasses IP its 75.167.41.248. Geocodes to Phoenix Arizona.
|
||||||||||||
|
|
|||||||||||||
|
Josh
Forum Regular
|
Noticing that you seem to work in ASP.NET, use parameterized queries. This ALONE will save you COUNTLESS man hours of manual stripping, converting, etc.
I'm not saying that you should rely solely on Parameters, but I have used parameterized queries since the start and not only do they make my apps easier to read (which minimizes development and maintenance times) but they do a **** fine job of handling data and making sure it's given to the database correctly.
And of course the MS SQL Equivilent...
More about Parameterized Queries... http://aspnet101.com/aspnet101/tutorials.aspx?id=1 PS... these aren't just for selects/queries... they're for anywhere you need to pass info from the app server to the db server. Updates/deletes/inserts should all utilize parameterized queries/commands. |
||||||||||||||||
|
Last edited by Josh on Mon Oct 22, 2007 10:57 pm; edited 1 time in total |
|||||||||||||||||
|
whitesites
|
That is very interesting way to doing it, and I can see how that would prevent most SQL injection attacks. Only problem is I use alot of helper functions, and that would be alot of coding to integrate. I will keep it in mind for future sites though. Thanks
|
||||||||||||
|
|
|||||||||||||
|
Josh
Forum Regular
|
Mind you that you don't need to use the USING blocks, either (You seem perty smart, but some people get all confused by me doing things alittle differently than most). It's just the query/command structure and the use of adding the parameters to the command object that's important.
Like I said, I think you know this, but I'll put it here as it may prove valuable to somebody else. |
||||||||||||
|
|
|||||||||||||
| SQL injection attacks |
|
||
|


