- Create a test directory (on your https server) for CSRF. You will write some pages that do Cross Site Request Forgery in this directory.
Example of the index page for this directory: solution directory (Source)
- File displaying "Hello World" and login the user out of the guestbook.
The logout is done using the following image
<img src="/coursAWT/examples/webSecurity/guestbook/index.php?logout=Logout" width='10' height='10'>
Unfortunately, one can see that there was a problem in this page, since the image seams broken. We have chosen to change the size: width=1, height=1.
Solution: hello-world.php (Source ).
- Create another page, containing "Hello Someone" that inserts a new line in the Guestbook.
The main difficulty here was to transform a POST request into a GET one.
In order to be invisible, we have chosen not to use an image, but rather to use a script tag:
<script src="../index.php?title=This+is+a+Hack&message=Hi+everybody%2C+it+is+possible+to+hack+this+system&dest=0&userID=1&btnadd=Send+Message"></script>
Solution: hello-someone.php (Source ).
- Create a page for changing the password of the user on the page.
You may have seen another security hole in our application: we allow any logged user to change the password of any person in the system. So the required link is:
<script src="../../../guestbook/index.php?pwd1=abcd&pwd2=abcd&userID=2"></script>
Changes the password of the user whose ID=2. Writing a javascript loop adding this script for each userID would be very efficient!
Solution: hello-world2.php (Source ).