Skip to content

Cross-Site Request Forgery (CSRF) is a web security vulnerability that explores CSRF attack techniques, vulnerability analysis, and mitigation strategies. It includes hands-on demonstrations of how CSRF attacks work, how to identify weak implementations, and how to secure web applications against such threats.

Notifications You must be signed in to change notification settings

Priyabug/Cross-Site-Request-Forgery-Vulnerability-Exploration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛠️ Cross-Site-Request-Forgery-Vulnerability-Exploration

📘 Description

The goal of this lab environment is to familiarize with Cross-Site Request Forgery (CSRF) attacks. In a CSRF attack, a victim user, a trusted website, and a malicious site are involved.

The victim, who has an active session with a trusted site, visits a malicious site that then sends an unauthorized HTTP request to the trusted site within the victim's session, leading to potential harm.

We will perform a CSRF attack on a social networking application called Elgg, which is an open-source platform pre-installed on our virtual machine. Elgg typically includes built-in protections against CSRF, but these defenses have been disabled for this exercise.

This session will cover the following key topics:

🔍 Topics Covered

  • Cross-Site Request Forgery (CSRF) attack
  • CSRF countermeasures: Secret Token and Same-site Cookie
  • HTTP GET and POST requests
  • JavaScript and Ajax

image


🧰 Languages and Utilities Used

  • Python
  • Ubuntu 20.04 VM
  • Docker

💻 Environments Used

  • Windows 11 Home (21H2)

🚶‍♂️ Program Walk-through

✅ Task 1: Observing HTTP Request

Learn how to inspect HTTP request headers and understand session behavior.

🎯 Task 2: CSRF Attack using GET Request

Craft and execute a CSRF attack leveraging the GET method.

🎯 Task 3: CSRF Attack using POST Request

Use POST-based CSRF attacks to manipulate form submissions.

🔐 Task 4: Enabling Elgg’s Countermeasures

Re-enable and explore Elgg’s built-in CSRF protections.


📌 Conclusion

Through this lab, we successfully simulated and analyzed the impact of CSRF attacks in a controlled environment. By exploiting the trust a website has in a user's browser, we demonstrated how attackers can compromise user data and actions without their knowledge.

Additionally, we explored and implemented effective countermeasures, such as secret tokens and same-site cookies, to safeguard web applications from such threats. This hands-on experience emphasized the importance of secure web development practices and the role of client-side and server-side defenses in mitigating CSRF risks.

About

Cross-Site Request Forgery (CSRF) is a web security vulnerability that explores CSRF attack techniques, vulnerability analysis, and mitigation strategies. It includes hands-on demonstrations of how CSRF attacks work, how to identify weak implementations, and how to secure web applications against such threats.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published