Cross-site request forgery Demo

Posted by rajivvishwa On December - 31 - 2008

XSRF is an exploit where malicious scripts are transmitted from one trusted site to trigger undesirable operations in some other user authenticated trusted site. The user-website trust is broken and this is exploited. Two demo PHP websites are used to demonstrate this attack. Here, the user is authenticated with VulnBank and the malicious embedded scripts in IMG tag, found in Vulnerable to XSRF site, transfers victims fund to the attacker account.

XSRF In Action

If you can see this, then you might need a Flash Player upgrade or you need to install Flash Player if it's missing. Get Flash Player from Adobe.

How this works

The attacker understands that a particular site trusted by the victim, here, VulnBank. He finds out that fund transfer operation can be invoked by activating a single url (once victim user is authenticated). He now finds out another victim trusted site which accepts user input and reflects the same if any error found in the input. So the attacker trys to inject an IMG tag which points to fund transfer link, appended with attacker crafted parameters. This is reflected back by the VulnSite, executes the IMG tag and activates the link along with it. The attacker copies the VulnSite’s URL which has the reflected Img tag and sends to the victim. Since the victim trusts the VulnSite he clicks it without any hesitation. During the page load, money gets transferred to the attacker account from the victim and victim isn’t even aware of it.

Download Files

Dropbox Download link

Note: This is updated code, what you see on the video is older version of the code but that will get you started.

Files in the Archive

XSRF Demo Files

Instructions

  1. Update the Database config section on connect.php in the root folder.
  2. Once done, load the sql in root folder, client.com and bank.com folders
  3. Then access bank.com and client.com in two different browsers (or tabs)
  4. Note the balance in ‘bank.com’
  5. Execute the XSRF script in ‘client.com’
  6. Check the balance in new balance in ‘bank.com’

More Info

cgisecurity Wikipedia OWASP XSRF Animated Movie

XSRF Demo Info
App Name XSRF Demo
License free
Type code
App URL Download
More Info link

  • Utkunglt

    sr, but i don’t see code  fundtransfer.php

    • http://a4apphack.com/ Rajiv Vishwa

      Hi, I’ve put a link to download the new demo files. I’ve also put the instructions on setting it up. Please check that. 

      • Utkunglt

        sr if botherhow many tables in the database?
        I only saw the account table and comments table!
        users table… where?

        • http://a4apphack.com/ Rajiv Vishwa

          My bad, updated users.sql in the download zip file. Can you please re-download and check.

          • Utkunglt

            oh, i down in ”
            Download Files
            Dropbox Note: This is updated code, what you see on the video is older version of the code but that will get you started.”sr, i don’t see link below, thank you very much.
            i reading your code! ^^!

          • http://a4apphack.com/ Rajiv Vishwa

            Aren’t you abel to download users table from this link? – http://db.tt/m2cqpjl9

          • Utkunglt

            i did.
            how to prevent this issue?you can demo for me and everyone?
            I enjoyed your article!!!

          • Utkunglt

            I found, it is token!!! hihi, tks you!!!

Subscribe RSS
Follow me on TwitterTechnoratiYoutube VidsLinkedIn ProfileDelicious