Updated
This commit is contained in:
@@ -32,13 +32,14 @@ namespace Webtester.Pages
|
||||
Console.WriteLine("Testing for injections:");
|
||||
getDone = true;
|
||||
}
|
||||
|
||||
TestInjection(test);
|
||||
}
|
||||
|
||||
private void TestInjection(string text)
|
||||
{
|
||||
var result = SqlHelper.ExecuteQuery(
|
||||
new Microsoft.Data.SqlClient.SqlConnection(@"Server=localhost;Database=NorthWind;User Id=sa;Password=jeroen;TrustServerCertificate=Yes;"),
|
||||
var connectionString = @"Server=localhost;Database=NorthWind;User Id=sa;Password=jeroen;TrustServerCertificate=Yes;";
|
||||
var result = SqlHelper.ExecuteQuery(connectionString,
|
||||
$"SELECT * FROM Customers WHERE Country = @0", true, text);
|
||||
|
||||
if (!result.HasResult)
|
||||
@@ -76,8 +77,8 @@ namespace Webtester.Pages
|
||||
private static async void TestsqlServer()
|
||||
{
|
||||
var customerId = "AROUT";
|
||||
var result = SqlHelper.ExecuteQuery(
|
||||
new Microsoft.Data.SqlClient.SqlConnection(@"Server=localhost;Database=NorthWind;User Id=sa;Password=jeroen;TrustServerCertificate=Yes;"),
|
||||
var connectionString = @"Server=localhost;Database=NorthWind;User Id=sa;Password=jeroen;TrustServerCertificate=Yes;";
|
||||
var result = SqlHelper.ExecuteQuery(connectionString,
|
||||
$"SELECT * FROM Customers WHERE CustomerID = @0 AND Country = @1"
|
||||
, true, customerId, "UK");
|
||||
|
||||
|
Reference in New Issue
Block a user