Cross-Site Request Forgery (CSRF) is a type of security vulnerability that affects web applications.
It occurs when an attacker tricks a user’s browser into sending a malicious request to a web application on behalf of the user, often without the user’s knowledge or consent.
The attacker takes advantage of the trust that a web application has in a user’s browser, exploiting the fact that the browser automatically includes authentication credentials (such as cookies) with each request.
This can allow an attacker to perform actions such as changing a password, transferring funds, or accessing sensitive information.
For example, if a user is logged into their online banking account and visits a malicious website, the attacker could use CSRF to transfer money from the user’s account without their knowledge.
Lab Description:
This lab’s email change functionality is vulnerable to CSRF. It attempts to use the insecure “double submit” CSRF prevention technique.
To solve the lab, use your exploit server to host an HTML page that uses a CSRF attack to change the viewer’s email address.
You can log in to your own account using the following credentials: wiener:peter
Analysis:
We know that the Email change Functionality is vulnerable to CSRF, So Let’s capture the Request
2. Send the Request to the Repeater
3. Perform a search, send the resulting request to Burp Repeater, and observe that the search term gets reflected in the Set-Cookie header
4. Since the search function has no CSRF protection, you can use this to inject cookies into the victim user’s browser.
5. Create a URL that uses this vulnerability to inject a fake csrf cookie into the victim's browser: