|
Instructor
Lecture:
Resources |
HW2Homework 2This homework assignment covers exploitation of web security. You may work with a partner. It is due Thursday 3/14 at 9 pm. Much of this is borrowed from UCSD CS 127, which in turn borrowed from Stanford CS 155. Thanks for their hard work setting up this homework assignment. Web Security ProjectFor this project, as in the 1st project, you are going to use a virtual machine. Setting up Boxes on your own machine: Download the BoxesX virtual machine image, http://pages.cs.wisc.edu/~rist/642-spring-2014/hw/BoxesX-pp3.ova (warning: 600 MB!). Note that this is not the same VM image as the one in the 1st project, so you cannot use that one. The ova file should load into VirtualBox or VMware. (Refer to the HW1 handout for a reminder.) Once the BoxesX VM is running, you will want to start X and run the Iceweasel browser, as described below. The user name and password are 'user' and 'user'. If you or your partner have trouble running the VM image, email the TAs for support. How to run iceweaselThe Web server serving the Zoobar site you will be attacking is hosted inside the VM. (If you try to connect to zoobar.org outside the VM, you will get Stanford's site, which you should not try to interact with.) Furthermore, the Web browser you'll use to develop and test your attacks is also hosted inside the VM. It is called Iceweasel. Iceweasel is the Debian version of Firefox (essentially the same browser, but with a different name because of licensing issues). To start iceweasel in BoxesX, login as user, and do the following:
Project OverviewThe fictional “Zoobar Foundation” has set up a simple Web application at zoobar.org (inside the BoxesX VM), allowing registered users to post profiles and transfer “zoobar” credits between each other. Each registered user starts with 10 zoobars. You will craft a series of attacks on zoobar.org that exploit vulnerabilities in the Websites design. Each attack presents a distinct scenario with unique goals and constraints, although in some cases you may be able to reuse parts of your code. Although many real-world attackers do not have the source code for the Websites they are attacking, you are one of the lucky ones: you can find the source code under /var/zoobar/www in the BoxesX VM. The Zoobar server is actually run locally on each of your boxes. We will run your attacks after wiping clean our own local database of registered users (except the user named “attacker”). Of course this means that any data you have added while working on the assignment will not be present during grading. SetupBrowser: We will grade your project within the BoxesX VM, using the Iceweasel browser. which is installed in the Boxes. Therefore, you should test your code in the boxes on this browser. Iceweasel is essentially the same browser as Firefox, but under different branding. Anything that works in iceweasel will likely work in (the same version of) Firefox as well. There are subtle quirks in the way HTML and JavaScript are handled by different browsers,
and some attacks that work in Internet Explorer (for example) may not work in Firefox (and therefore in Iceweasel). In particular, you should use the Mozilla way of adding listeners to events (see Email script: For Attack A, you will need a server-side script to automatically email information
captured by your client-side JavaScript to your user account within the Boxes. We have provided this script for you. Please review the instructions at Attack A: Cookie Theft
Attack B: Cross-Site Request Forgery
Attack C: SQL Injection
DeliverablesCreate files named a.txt, b.html, and c.html, containing each of your attacks. You may include a
separate README file, which will be used for partial credit if an attack fails. You must create a file called ID which contains, on each line: tar -cf hw2.tar attack/* To submit, copy hw2.tar to your handin directory. From a department managed machine: cp hw2.tar ~cs642-1/handin/<cslogin>/hw2 From another machine scp hw2.tar emperor-01.cs.wisc.edu:~cs642-1/handin/<cslogin>/hw2 As a team, only one person should submit the homework tarfile. GradingEach attack is worth up to 2 points. If the attack works, then one will receive full credit. Partial credit will be given for a good description of the vulnerability and how an exploit should work. Beware of Race Conditions: Depending on how you write your code, all of these attacks could potentially have race conditions that affect the success of your attacks. Attacks that fail on the graders browser during grading will receive less than full credit. To ensure that you receive full credit, you should wait after making an outbound network request rather than assuming that the request will be sent immediately. |