hands-on lab

Execute a Reflected Cross-Site Scripting (XSS) Attack

Difficulty: Intermediate
Duration: Up to 30 minutes
Students: 632
Rating: 4.7/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Cross-site scripting (XSS) is a security vulnerability affecting web applications. XSS allows an attacker to execute scripts on the machines of clients of a targeted web application. This can allow attackers to steal credentials and sessions from clients or deliver malware. The Open Web Application Security Project (OWASP) has included XSS in its top ten list of the most critical web application security risks every year the list has been produced. It reports that XSS vulnerabilities are found in two-thirds of all applications.

This Lab demonstrates a reflected cross-site scripting attack. Reflected XSS is sometimes referred to as non-persistent XSS and is the most common kind of XSS. It results from a user clicking a specially-constructed link storing a malicious script that an attacker injects. You will use a web application that is intentionally vulnerable to illustrate the attack.

You will use the web browser on a Kali Linux host to launch the attack on a web application running on a Metasploitable 2 host. Both hosts are running as virtual machines in a Hyper-V virtual environment.

This Lab is designed for the CREST Practitioner Security Analyst (CPSA) certification examination but is of value to security practitioners in general.

Learning Objectives

Upon completion of this Lab you will be able to:

  • Describe the elements of a cross-site scripting attack
  • Perform basic cross-site scripting attacks
  • Understand how to prevent cross-site-scripting attacks

Intended Audience

This Lab is intended for:

  • CREST CPSA certification examinees
  • Security practitioners
  • Web application developers

Prerequisites

You should be familiar with:

  • HTML and JavaScript language basics are beneficial but not required

 

Updates

July 10th, 2020 - Enabled direct browser RDP connection for a streamlined experience

Environment before

Environment after

Covered topics

Lab steps

Executing a Reflected Cross-site Scripting (XSS) Attack