3.10.2 Mobile Exercise

Note: This exercise contain 2 parts: XSS Mobile Exercise (Part 1) and XSS Cookie Stealing Mobile Exercise (Part 2). Both exercises will be completed using Android Studio and the Command Prompt.

Running the Server for the Mobile Exercises

You need to follow the same steps to run the server for Mobile Exercise (Part 1) and XSS Cookie Stealing Mobile Exercise (Part 2). Complete Part 1 and then start Part 2.

  1. Download the exercise files to your local host
    1. Download the zip file for XSS Mobile Exercise (Part 1) here. Unzip the zip file to see an Android project folder named XSS and other files described in the exercise description for Part 1.
    2. Download the zip file for XSS Cookie Stealing Mobile Exercise (Part 2) here. Unzip the zip file to see an Android project folder named XSSCookieStealing and other files described in the exercise description for Part 2.

  2. Open a Command Prompt
    1. On Windows, press the Windows key, type "cmd" in the search box, and click the result
    2. On Mac, open Spotlight, search for "Terminal", and double click the result.

  3. Run the server (on Windows, with Java 8)
    1. In the Command Prompt, cd into the directory containing the unzipped files.
    2. Every time you change any .java file, you must recompile the program before running it again. Enter the following command to compile the program:

      javac -Djava.ext.dirs=./lib *.java
    3. This program depends on files in the lib directory, so the command to run the server in Windows is:

      java -Djava.ext.dirs=./lib TargetServer
    4. To stop the server, type quit in the command line interface and press enter.

  4. Run the Server (on MacOS/Linux)
    1. In the Command Prompt, cd into the directory containing the unzipped files.
    2. Every time you change any .java file, you must recompile the program before running it again. Enter the following commands to compile:

      javac -cp ".;./lib/*" *.java
    3. This program depends on files in the lib directory, so the command to run the server is:

      java -cp ".:./lib/*" TargetServer
    4. To stop the server, type quit in the command line interface and press enter.