Lab 7 Cross-Site Scripting
Lab 7 Cross-Site Scripting
Instructions
− This assignment should be completed individually.
− This assignment is designed for the purpose of education and training, but not for any
illegal activities including hacking. Beware to only use these exploits on hosts that you
have permission to hack.
− When a question asks for screenshots, your screenshots must:
▪ Include the full window (the application window, or the terminal window, etc…),
▪ have the PROMPT setup as per the instructions, including the date and time in
the same format provided in the instructions. Screenshots without the prompt
setup will receive zero credit,
▪ be clearly readable,
▪ include all the information required by the question, and
▪ not include extra commands, failed attempts, and/or error messages. When you
run into errors, troubleshoot them, clear the screen, and rerun the commands to
capture a screenshot clear of any error messages.
− Failure to follow submission instructions will result in marks deduction. There will be
marks deduction for including more than what is required in the instructions. Do not
replace any screenshot that is not marked for replacement. These screenshots are to
guide you only.
− The below instructions are guidelines, you are expected to troubleshoot any errors you
run into.
− Read and complete the lab instructions below and finish all the tasks. Provide
screenshots and answer the questions in the Answer File.
Environment Setup
We will use a fresh copy ofSEED Ubuntu 20.04 Virtual Machine available at
https://seedsecuritylabs.org/:
1. Download Ubuntu 20.04 VM available under Ubuntu 20.04 VM -Approach 1: Use a pre-
built SEED VM from the following link https://seedsecuritylabs.org/labsetup.html
2. Follow the lab manual setup instructions to install the SEED VM you downloaded in the
previous step on VirtualBox. The lab manual setup is available here:
https://github.com/seed-labs/seed-labs/blob/master/manuals/vm/seedvm-manual.md
Lab Setup
1. Download the Cross-Site Scripting Attack Lab file available here:
https://seedsecuritylabs.org/Labs_20.04/Files/Web_XSS_Elgg/Web_XSS_Elgg.pdf
2. We will refer to the Cross-Site Scripting Attack Lab you downloaded in the previous step
as the Web_XSS_Elgg file.
3. Download the Labsetup file available at
https://seedsecuritylabs.org/Labs_20.04/Web/Web_XSS_Elgg/ , and save it to your
SEED Ubuntu 20.04 Virtual Machine. Unzip the Labsetup file you have downloaded.
4. DNS Setup: Seed Labs have set up several websites for this lab. They are hosted by the
container 10.9.0.5. We need to map the names of the webserver to this IP address.
Please add the following entries to /etc/hosts. You need to use the root privilege to
modify this file. You also need to remove “www.xsslabelgg.com”:
10.9.0.5 www.seed-server.com
10.9.0.5 www.example32a.com
10.9.0.5 www.example32b.com
10.9.0.5 www.example32c.com
10.9.0.5 www.example60.com
10.9.0.5 www.example70.com
5. Read and follow the instructions in the Web_XSS_Elgg file to build the containers
required for this lab:
a. Use the docker-compose build command to build the containers.
b. Use the docker-compose up command to start the containers.
c. You will need to issue these commands where you unzipped your Labsetup files.
d. Check to ensure the containers are up.
6. Use the Web_XSS_Elgg file to aid you in carrying out the lab tasks below.
Task 1: Posting a Malicious Message to Display an Alert Window
1. On your SEEDVM20.04, sign in to http://www.seed-server.com/ as Samy, and embed
the following javascript in your profile (e.g. in the brief description field):
<script>alert(’XSS by yourname’);</script>
2. Replace yourname with your name.
3. Sign out of Samy’s profile, and sign in as Alice. Visit Samy’s profile.
4. Take a screenshot of the alert window appearing, and place it under Screenshot#1 in the
answer file. Ensure that the screenshot includes everything as shown in the sample
screenshot below (the full browser with the URL showing).
5. Remove the javascript from Samy's profile before proceeding to the next task.
Task 2: Posting a Malicious Message to Display Cookies
2. Replace the highlighted three dots for the value of sendurl in the script with the correct
syntax to add Samy as a friend.
3. You can find the correct syntax of sendurl to add Samy as a friend in two ways:
Method 1: