How can I test my page that uses that uses Request.QueryString.Get("ID")
against SQL Injections. I have tried a few basic things like www.myDomain/mySite.aspx?ID=1234'
and www.myDomain/mySite.aspx?ID=1234'
, neither of which causes anything unexpected. I'm looking for a definitive way to test for vulnerabilities though. According to this post it looks like I have implemented the correct mechanisms to prevent injection. Besides online articles I do not have practical experience testing this.
I am using 2 defense mechanisms which seem to be fairly common
1.) I have a sanitize function which removes single apostrophes and '&' and does some formatting stuff to the query string before it is ever added the the SQL Command.
2.) I am also using parameterized statements so the Query String becomes a parameter for the command that is executed. I understand this make the whole process more secure because the query structure is already defined.