idor-testing – skill Lập trình cho agent AI
Cung cấp phương pháp có hệ thống để xác định và khai thác lỗ hổng Insecure Direct Object Reference (IDOR) trong ứng dụng web.
Cài skill idor-testing bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/idor-testing-b1328.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /idor-testing – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/idor-testing-b1328.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $idor-testing – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/idor-testing-b1328.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /idor-testing – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/idor-testing-b1328.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /idor-testing – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
> ⚠️ AUTHORIZED USE ONLY
> This skill is for educational purposes or authorized security assessments only.
> You must have explicit, written permission from the system owner before using this tool.
> Misuse of this tool is illegal and strictly prohibited.
> Mandatory confirmation gate
> Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:
> 1. Ask the user to state the exact target URL, IP, account, or resource.
> 2. Ask the user to confirm written authorization and the permitted scope.
> 3. Show the exact command(s) and explain their expected effect.
> 4. Wait for explicit confirmation in the current conversation.
>
> Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.
> AUTHORIZED USE ONLY: Use this skill only for authorized security assessments, defensive validation, or controlled educational environments.
IDOR Vulnerability Testing
Purpose
Provide systematic methodologies for identifying and exploiting Insecure Direct Object Reference (IDOR) vulnerabilities in web applications. This skill covers both database object references and static file references, detection techniques using parameter manipulation and enumeration, exploitation via Burp Suite, and remediation strategies for securing applications against unauthorized access.
Inputs / Prerequisites
- Target Web Application: URL of application with user-specific resources
- Multiple User Accounts: At least two test accounts to verify cross-user access
- Burp Suite or Proxy Tool: Intercepting proxy for request manipulation
- Authorization: Written permission for security testing
- Understanding of Application Flow: Knowledge of how objects are referenced (IDs, filenames)
Outputs / Deliverables
- IDOR Vulnerability Report: Documentation of discovered access control bypasses
- Proof of Concept: Evidence of unauthorized data access across user contexts
- Affected Endpoints: List of vulnerable API endpoints and parameters
- Impact Assessment: Classification of data exposure severity
- Remediation Recommendations: Specific fixes for identified vulnerabilities
Core Workflow
1. Understand IDOR Vulnerability Types
Direct Reference to Database Objects
Occurs when applications reference database records via user-controllable parameters:
# Original URL (authenticated as User A)
example.com/user/profile?id=2023
# Manipulation attempt (accessing User B's data)
example.com/user/profile?id=2022Direct Reference to Static Files
Occurs when applications expose file paths or names that can be enumerated:
# Original URL (User A's receipt)
example.com/static/receipt/205.pdf
# Manipulation attempt (User B's receipt)
example.com/static/receipt/200.pdf2. Reconnaissance and Setup
Create Multiple Test Accounts
Account 1: "attacker" - Primary testing account
Account 2: "victim" - Account whose data we attempt to accessIdentify Object References
Capture and analyze requests containing:
- Numeric IDs in URLs:
/api/user/123 - Numeric IDs in parameters:
?id=123&action=view - Numeric IDs in request body:
{"userId": 123} - File paths:
/download/receipt_123.pdf - GUIDs/UUIDs:
/profile/a1b2c3d4-e5f6-...
Map User IDs
# Access user ID endpoint (if available)
GET /api/user-id/
# Note ID patterns:
# - Sequential integers (1, 2, 3...)
# - Auto-incremented values
# - Predictable patterns3. Detection Techniques
URL Parameter Manipulation
# Step 1: Capture original authenticated request
GET /api/user/profile?id=1001 HTTP/1.1
Cookie: session=attacker_session
# Step 2: Modify ID to target another user
GET /api/user/profile?id=1000 HTTP/1.1
Cookie: session=attacker_session
# Vulnerable if: Returns victim's data with attacker's sessionRequest Body Manipulation
# Original POST request
POST /api/address/update HTTP/1.1
Content-Type: application/json
Cookie: session=attacker_session
{"id": 5, "userId": 1001, "address": "123 Attacker St"}
# Modified request targeting victim
{"id": 5, "userId": 1000, "address": "123 Attacker St"}HTTP Method Switching
# Original GET request may be protected
GET /api/admin/users/1000 → 403 Forbidden
# Try alternative methods
POST /api/admin/users/1000 → 200 OK (verify protected data/action and policy)
PUT /api/admin/users/1000 → 200 OK (verify protected data/action and policy)4. Exploitation with Burp Suite
Manual Exploitation
1. Configure browser proxy through Burp Suite
2. Login as "attacker" user
3. Navigate to profile/data page
4. Enable Intercept in Proxy tab
5. Capture request with user ID
6. Modify ID to victim's ID
7. Forward request
8. Observe response for victim's dataAutomated Enumeration with Intruder
1. Send request to Intruder (Ctrl+I)
2. Clear all payload positions
3. Select ID parameter as payload position
4. Configure attack type: Sniper
5. Payload settings:
- Type: Numbers
- Range: 1 to 10000
- Step: 1
6. Start attack
7. Analyze responses for 200 status codesBattering Ram Attack for Multiple Positions
# When same ID appears in multiple locations
PUT /api/addresses/§5§/update HTTP/1.1
{"id": §5§, "userId": 3}
Attack Type: Battering Ram
Payload: Numbers 1-10005. Common IDOR Locations
API Endpoints
/api/user/{id}
/api/profile/{id}
/api/order/{id}
/api/invoice/{id}
/api/document/{id}
/api/message/{id}
/api/address/{id}/update
/api/address/{id}/deleteFile Downloads
/download/invoice_{id}.pdf
/static/receipts/{id}.pdf
/uploads/documents/{filename}
/files/reports/report_{date}_{id}.xlsxQuery Parameters
?userId=123
?orderId=456
?documentId=789
?file=report_123.pdf
[email protected]Quick Reference
IDOR Testing Checklist
| Test | Method | Indicator of Vulnerability |
|------|--------|---------------------------|
| Increment/Decrement ID | Change id=5 to id=4 | Returns different user's data |
| Use Victim's ID | Replace with known victim ID | Access granted to victim's resources |
| Enumerate Range | Test IDs 1-1000 | Find valid records of other users |
| Negative Values | Test id=-1 or id=0 | Unexpected data or errors |
| Large Values | Test id=99999999 | System information disclosure |
| String IDs | Change format id=user_123 | Logic bypass |
| GUID Manipulation | Modify UUID portions | Predictable UUID patterns |
Response Analysis
| Status Code | Interpretation |
|-------------|----------------|
| 200 OK | Potential IDOR - verify data ownership |
| 403 Forbidden | This request denied; not proof of overall authorization coverage |
| 404 Not Found | Missing or deliberately concealed resource; verify with authorized owner session |
| 401 Unauthorized | Authentication required |
| 500 Error | Potential input validation issue |
Common Vulnerable Parameters
| Parameter Type | Examples |
|----------------|----------|
| User identifiers | userId, uid, user_id, account |
| Resource identifiers | id, pid, docId, fileId |
| Order/Transaction | orderId, transactionId, invoiceId |
| Message/Communication | messageId, threadId, chatId |
| File references | filename, file, document, path |
Constraints and Limitations
Operational Boundaries
- Requires at least two valid user accounts for verification
- Some applications use session-bound tokens instead of IDs
- GUID/UUID references harder to enumerate but not impossible
- Rate limiting may restrict enumeration attempts
- Some IDOR requires chained vulnerabilities to exploit
Detection Challenges
- Horizontal privilege escalation (user-to-user) vs vertical (user-to-admin)
- Blind IDOR where response doesn't confirm access
- Time-based IDOR in asynchronous operations
- IDOR in websocket communications
Legal Requirements
- Only test applications with explicit authorization
- Document all testing activities and findings
- Do not access, modify, or exfiltrate real user data
- Report findings through proper disclosure channels
Examples
Example 1: Basic ID Parameter IDOR
# Login as attacker (userId=1001)
# Navigate to profile page
# Original request
GET /api/profile?id=1001 HTTP/1.1
Cookie: session=abc123
# Response: Attacker's profile data
# Modified request (targeting victim userId=1000)
GET /api/profile?id=1000 HTTP/1.1
Cookie: session=abc123
# Vulnerable Response: Victim's profile data returned!Example 2: IDOR in Address Update Endpoint
# Intercept address update request
PUT /api/addresses/5/update HTTP/1.1
Content-Type: application/json
Cookie: session=attacker_session
{
"id": 5,
"userId": 1001,
"street": "123 Main St",
"city": "Test City"
}
# Modify userId to victim's ID
{
"id": 5,
"userId": 1000, # Changed from 1001
"street"… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- stress-test – /em:stress-test: Kiểm tra độ bền các giả định kinh doanh. Dùng trước khi đặt cược vào kế…
- improve-codebase-architecture – Quét codebase để tìm cơ hội tối ưu kiến trúc, trình bày dưới dạng báo cáo HTML trực…
- strict-api – Dùng khi người dùng nói 'no hallucinations', 'verify APIs', 'reality check' hoặc 'don't…
- incident-response-smart-fix – Điều tra sự cố production, tái hiện nguyên nhân gốc, triển khai bản sửa có phạm vi rõ…
- stripe-integration-expert – Tích hợp Stripe chuẩn production: subscription với trial và proration, thanh toán một…
- instructree – Lập bản đồ, giải thích và kiểm tra lint các hướng dẫn coding-agent theo phạm vi…
- interactive-portfolio – Chuyên gia xây dựng portfolio giúp tìm được việc và khách hàng, không chỉ trưng bày sản…
- tc-tracker – Dùng khi người dùng yêu cầu theo dõi thay đổi kỹ thuật, tạo bản ghi thay đổi, quản lý…