0% found this document useful (0 votes)
23 views

Lab 2 Cross Site Scripting

Uploaded by

maaryamrh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Lab 2 Cross Site Scripting

Uploaded by

maaryamrh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

CSF4103 Web App & E-Commerce Security

Lab 2: Cross Site Scripting

Objectives:
You will perform XSS attacks on an intentionally vulnerable target website.
Tasks:
1. Start the CSF 4103 Azure VM, and logon.

2. In the Hyber V manager, start the windows 10 VM.

3. On the desktop of your Azure VM, go to Resources/GETIP/get_win10vm_ip and run it. Wait
until you see the “press any key to continue message…..”

4. Open the result excel sheet on the same folder to find the IP address for the windows 10
VM.

172.17.233.42

5. Start your browser and ensure the browser is not using any proxy settings (done in lab 1)
6. Visit http://IP address/cisweb/ws/xss.php
7. Type your name in the textbox or text area and notice the results page
8. Go back to the XSS page and type your name inside the <b> tag
<b>Name here</b>
9. What difference do you see in the result? Difference
The data (or code) you entered was sent to the server and got saved there. In this page all
injected code is displayed back in the client.
The data (or code) you entered was sent to the server and is now back in the client.

10. Repeat and this time use the <h1> tag


11. What code did you use? Code
The data (or code) you entered was sent to the server and got saved there. In this page all
injected code is displayed back in the client.

The website is allowing us to input more than just data. We can input code. Let’s test to
see if we can do more.

12. Try the following:


<a href="http://google.com">Google</a>
13. What does the code above do? Answer
The data (or code) you entered was sent to the server and got saved there. In this page all
injected code is displayed back in the client.
14. Open a new tab in your browser and type the following address to verify that you can
access this graphic
(http://IP address/cisweb/resources/images/wsLogo.png)

15. Try to input the following html code in the textbox of xss.php page:
<img src=" http:// IP address/cisweb/resources/images/wsLogo.png"/>
16. What does the code above do? Answer
The data (or code) you entered was sent to the server and got saved there. In this page all
injected code is displayed back in the client.

1|Page

Let’s test to see if we can inject JavaScript code.

17. Try to input the following script:


<script>alert(123)</script> 18.
What does the code above do?
19. Try the following:

<script>alert(document.cookie)</script>

20. What does the code above do? Answer


Perform the following script injection attacks and for each step, write the code used:
21. Open another website of your choice in a new window/tab
<meta http-equiv="refresh" content="0; url=http://example.com/" />

22. Redirect the webpage to another website of your choice (in the same window/tab)
<meta http-equiv="refresh" content="0; url=http://example.com/" />

Let’s do something a little more serious.

The http-equiv attribute pf the <meta> element can be used to simulate an HTTP
response header. Using the “refresh” as a value, we can simulate a continuous refresh
every interval of time. For example: <meta http-equiv="refresh" content="1">

23. Go to the http:// IP address/cisweb/ws/urlparam.php webpage and click the “URL


Parameters Example” link
24. Change the value of the URL parameter country country=<h1>Norway</h1>

We can inject code in the URL using the parameter value.

25. Try the following:


country=<meta http-equiv="refresh" content="0">
If the browser doesn’t block this, it will simulate a DoS attack using an infinite refresh.

2|Page

You might also like