Security Testing Tutorials

HOME

Multiple Choice Questions for Security Testing on API Testing
Multiple Choice Questions for Security Testing on Web Application

Understanding Security Testing in Software Development

HOME

Understanding SQL Injection: Types and Prevention

HOME

String username = request.getParameter("username");
String forename = request.getParameter("forename");

String sql = "SELECT * FROM users WHERE username = '" + username + "' AND forename = '" + forename + "'";

Connection conn = DriverManager.getConnection(url, username, forename);
Statement stmt = conn.createStatement();
ResultSet result = stmt.executeQuery(sql);
if (result.next()) {
    // User is authenticated
    String status = result.getString("success");
    System.out.println("Login to the application");
} else {
    // Authentication failed
  System.out.println("Unable to Login");
}

SELECT * FROM users WHERE username = 'admin'  AND forename = 'admin';

SELECT * FROM users WHERE username = 'admin'  -- AND forename = 'admin';

SELECT * FROM users WHERE username = 'admin'

String username = request.getParameter("username");
String forename = request.getParameter("forename");

String sql = "SELECT * FROM users WHERE username = ? AND forename = ?";

Connection conn = DriverManager.getConnection(url, username, forename);
PreparedStatement preparedStatement = conn.prepareStatement(sql);
preparedStatement.setString(1, username);
preparedStatement.setString(2, forename);
ResultSet result = preparedStatement.executeQuery();
if (result.next()) {
    // User is authenticated
       String status = result.getString("success");
       System.out.println("Login to the application");
} else {
    // Authentication failed
    System.out.println("Unable to Login");
}

SELECT ProductName, ProductDescription, ProductCost
FROM Products
WHERE ProductId = '100' UNION SELECT Username, Password FROM Users;

Multiple Choice Questions for Security Testing on Web Application

HOME

























What is Security Testing in API?

HOME

Multiple Choice Questions for Security Testing on API Testing

HOME



















a) Using a single access key for all users
b) Applying security measures such as authentication, encryption, and authorization for every API request
c) Allowing unlimited access to the API without any restrictions
d) Not validating input from users







How to create Security Test from Functional test in ReadyAPI

HOME

The previous tutorial has explained the creation of a new Security Test. This tutorial explains the process to create a Security test from the existing Functional Test.

Steps to be followed to create a security test from a functional test case:

  1. Create the Security Test from Functional Test
  2. Run the Security Test
  3. Analyse Security Test Results
  4. Generation of Security Test Report
  5. Sample Test Report
  6. Analyse Security Test Report

Create the Security Test from Functional Test

Step 1 – Right-click the test case present under Functional Tests in the Navigator and select Create Security Test.

Step 2 – Click Select Test Target. Select the test case you want to apply the security scan to. All the applicable scans are selected by default

Leave the scans you want to have in your test checked and uncheck the other scans.

There is a list of Scans, you can select either one scan or multiple scans. I have selected all the scans.

  1. Boundary Scan
  2. Cross Site Scripting
  3. Fuzzing Scan
  4. Invalid Types
  5. SQL Injection
  6. XPath Injection
  7. HTTP Method Fuzzing
  8. Sensitive Files Exposure
  9. Weak Authentication

Click the OK button.

Step 3 – This screen shows all the scans added to the Security Test.

Run the Security Test

Step 4 – Click the Green arrow “Run” to start the test.

Step 5 – ReadyAPI will start sending modified requests and checking responses.

Step 6 – The security test window shows the progress of each test step and matching security scans. This screen shows all the configurations of Cross Site Scripting. Similarly, all the scans have their own in-built configurations.

Analyse Security Test Results

Step 7 – The Transaction Log shows additional information about security scans.

Step 8 – The details of a particular request or response are available in the inspector.

The Setup pane contains the detail about the configuration used for the tests.

Generation of Security Test Report

Step 9 – After the security test run finishes, click View Summary Report:

Step 10 – In the dialog that appears, click View Full Report.

Step 11 – After that, ReadyAPI will open the report in the default PDF viewer.

Sample Test Report

Analyse Security Test Report

 Step 12 – Example of HTTP Method Fuzzing

Example of Cross Site Scripting

Congratulations!! We have successfully created the Security Test from the Functional Test. We are also run the test and generated the Security Test Report also. That’s a great accomplishment.

How to create Security Tests in ReadyAPI

HOME

Security tests in ReadyAPI include various types of security scans. Each of them detects a specific vulnerability. With multiple security scans in one test, you guarantee your service is well-protected against possible attacks.

This tutorial explains the steps to create the Security tests in ReadyAPI.

To know how to install ReadyAPI, refer to the installation tutorial.

A version of ReadyAPI used for this tutorial- 3.20.0

This tutorial explains the below steps:-

  1. Create a Security Test
  2. Run the Security Test
  3. Analyse Security Test Results
  4. Generation of Security Test Report
  5. Sample Test Report
  6. Analyse Security Test Report

Create a Security Test

Step 1 – Select File ->New Security Test.

Step 2 – Select the URL option.

Step 3 – Enter the following URL and click the Next button:

URL – http://dummy.restapiexample.com/api/v1/employee/1

Step 4 – Select the scans you need and click the Finish button.

Another thing to keep in mind is to select whether you want to create a new project or add the test to an existing project. Here, I’m creating a new project.

There is a list of Scans, you can select either one scan or multiple scans. I have selected all the scans.

  1. Boundary Scan
  2. Cross Site Scripting
  3. Fuzzing Scan
  4. Invalid Types
  5. SQL Injection
  6. XPath Injection
  7. HTTP Method Fuzzing
  8. Sensitive Files Exposure
  9. Weak Authentication

Run the Security Tests

Step 5 – We have created a security test. ReadyAPI will offer you to run the security test immediately or edit it before running. We do not need to configure anything, so select the Run Security Test option.

If you want to edit the test before running it, then select the Edit Security Test option.

Step 6 – ReadyAPI will start sending modified requests and checking responses. 

The security test window shows the progress of each test step and matching security scans:

The Summary pane contains a short overview of the currently running security test.

Step 7 – After the security test run finishes, click View Summary Report:

Analyse Security Test Results

Step 8 – The Transaction Log shows additional information about security scans.

Step 9 – The details of a particular request or response are available in the inspector.

Generation of Security Test Report

Step 10 – In the dialog that appears, click View Full Report:

After that, ReadyAPI will open the report in the default PDF viewer.

This Summary Report shows there was a total of 258 scans and 28 issues are found. Out of 28 issues, 17 issues were Sensitive Files Exposure, and 11 issues are HTTP Method Fuzzing.

Sample Test Report

Analyse Security Test Report

Step 12 – Sensitive Files Exposure

Example of HTTP Method Fuzzing

Congratulations!! We have successfully created a Security test, run it as well as generating the Test Report, and analyzed the result too. Cheers!!!

ReadyAPI Tutorials

HOME

ReadyAPI is an easy-to-use no-code API Testing platform designed to streamline your testing workflows. Automate and scale your end-to-end tests across multiple API types. Run compatible load tests against your functional tests. Enable virtualization to ensure fast and reliable integrations for your development teams.

Chapter 1 How to install ReadyAPI
Chapter 2 How to create Security Tests in ReadyAPI
Chapter 3 How to create Security Test from Functional test in ReadyAPI
Chapter 4 How to create Functional Tests in ReadyAPI
Chapter 5 How to add Test Suite in existing Project in ReadyAPI
Chapter 6 Assertions in ReadyAPI

How to install ReadyAPI

HOME

What is ReadyAPI?

ReadyAPI allows teams to create, manage, and execute automated functional, security, and performance tests in one centralized interface – accelerating API quality for Agile and DevOps software teams. It allows importing API definitions like OpenAPI/Swagger or AsyncAPI, testing and recording live API traffic, or virtualizing web services to remove pipeline dependencies.

ReadyAPI is handled by SmartBear. ReadyAPI is not an open source tool, but a licensed tool.

In ReadyAPI, We can easily manage our APIs and project. We can easily create APIs from an openAPI, Swagger, WSDL, and WADL definition and use Discovery to record API requests and methods.

ReadyAPI can be used to perform

  1. Security Testing
  2. Functional Testing
  3. Performance Testing

How to install ReadyAPI – Version 3.20.0

Step 1 – Go to SmartBear ReadyAPI Installation site.

Step 2 – Before starting the installation, please check the system requirements for ReadyAPI.

Step 3 – As ReadyAPI is a licensed tool, but it also provides a trial version as well as commercial Pro License.

If you want to go for the trial version, fill in the details on this page and get Free Trial.

If you have license, then download the installer for your platform from the ReadyAPI Downloads Center.

I have a license, so will download ReadyAPI Desktop 3.20.0 (Windows Installer 64-bit).

Step 4 – Once the download is completed, run the installer. The installer will unpack the files and prepare them for installation:

Step 5 – Click the Next button to proceed with the installation:

Step 6 – If you install ReadyAPI for the first time or have chosen to install it to a different directory, the wizard will ask you to specify the installation folder:

Step 7 – This image shows that installation is in progress.

Step 8 – When the installation is complete, you can select the Run ReadyAPI check box to run ReadyAPI upon closing the wizard. You can also select the Create a desktop icon check box to create a desktop icon for ReadyAPI. Click the Finish button.

Step 9 – Once the installation is successfully completed, ReadyAPI will open, and it will look like something as in the below image.

We are done! Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!!