Skills Assessment
We are performing a Web Application Penetration Testing task for a company that hired you, which just released their new Security Blog. In our Web Application Penetration Testing plan, we reached the part where you must test the web application against Cross-Site Scripting vulnerabilities (XSS).
Start the server below, make sure you are connected to the VPN, and access the /assessment directory on the server using the browser:

Apply the skills you learned in this module to achieve the following:
Identify a user-input field that is vulnerable to an XSS vulnerability
Find a working XSS payload that executes JavaScript code on the target's browser
Using the
Session Hijackingtechniques, try to steal the victim's cookies, which should contain the flag
Step 1: Identify a vulnerable user-input field
For this assessment, the vulnerable user-input field is accessible when clicking in "Welcome to Security Blog".

This XSS vulnerability is a Blind-XSS, in order to create a proof of concept, we must create a temporary helper file to receive a connection.
Then we start the server with sudo php -S 0.0.0.0:80.
Step 2: Find a working XSS payload
The vulnerable payload found is:

And we received a 200 Response from our payload!

Step 3: Steal the victim's cookies
Now we must find a way to still the cookie
Let's create another payload. First we create a a file with the command nano script.js, and then we add the following:
And we fill the comment section again. But this time we point our script to our file:

And when we check the logs, we can see we got a session cookie, and subsequently our flag!

Last updated