Position:Home>net development> ASP.NET website program prevents SQL spoon-fed attack method
ASP.NET website program prevents SQL spoon-fed attack method
From;  Author:Stand originally

  One, what is SQL spoon-fed attack?

AllegedSQLSpoon-fed attack, the inquiry string that is the input region that aggressor inserts SQL command to Web to express sheet or page request, beguiling server executes baleful SQL order. In certain watch sheet, the content that the user inputs uses construction directly (perhaps affect) dynamic SQL command, or the input parameter that regards memory as the process, sheet of this kind of watch gets particularly easily SQL is spoon-fed attack. Common SQL is spoon-fed attack process kind be like:

⑴ a certainASP.net Web application has an entry page, this entry page is controlling an user to whether authority visits application, it asks the user inputs a name and password.

The content of the input in ⑵ entry page will use the SQL order of tectonic trends directly, perhaps use as directly the parameter of memory process. An example that ASP.NET application construction inquires is below:

System.Text.StringBuilder Query = New System.Text.StringBuilder(
"SELECT * From Users WHERE Login = '" )
.Append(txtLogin.Text).Append("' AND Password='" )
.Append(txtPassword.Text).Append("'" );

⑶ aggressor inputs the content of "' or '1'='1" and so on in user name and password input casing.

After the content that ⑷ user inputs refers a server, the server runs the ASP.NET code construction above to give the SQL order that inquires an user, but the content that inputs as a result of aggressor is very special, the SQL command that ends up with so becomes: SELECT * From Users WHERE Login = '' Or '1'='1' AND Password = '' Or '1'='1' .

⑸ server carries out inquiry or memory process, the identity that the user inputsInformationThe identity information that stores with server middleman and guarantor undertakes contrast.

⑹ commands as a result of SQL actually already by spoon-fed attack is revised, already cannot identity of user of true test and verify, so the system is met erroneously accredit gives aggressor.

If aggressor knows to apply meeting general to express the content of the input in sheet to be used at the inquiry of identity of test and verify directly, he can try to input certain and special SQL string to distort inquiry changes his originalFunction
Previous12 3 Next