100 ways of API Hacking
Below are 100 approaches for API hacking, categorized for better understanding. Each method delves into testing for security issues, misconfigurations, or vulnerabilities in APIs:
1–20: Authentication and Authorization Flaws
- Test for insecure direct object references (IDOR).
- Attempt brute-forcing API keys.
- Check for missing authentication headers.
- Bypass authentication via parameter manipulation.
- Use default credentials (e.g.,
admin:admin
). - Explore JWT misconfigurations (e.g., using
none
algorithm). - Manipulate OAuth tokens (e.g., swapping
aud
oriss
fields). - Reuse expired or stolen tokens.
- Test rate-limiting flaws for account takeover.
- Enumerate users via API responses.
- Escalate privileges by altering roles or user IDs.
- Bypass 2FA mechanisms via API flaws.
- Exploit misconfigured CORS policies.
- Send requests from untrusted origins.
- Test HTTP Basic authentication for weaknesses.
- Use dictionary attacks on API endpoints with weak passwords.
- Check for weak session management (e.g., predictable tokens).
- Exploit token leakage via logs or error messages.
- Use APIs to bypass frontend restrictions.
- Bypass IP-based restrictions by using proxies.
21–40: Input Validation Flaws
- Test for SQL injection in parameters.
- Check for NoSQL injection vulnerabilities.
- Inject command injections via payloads.
- Test for XML External Entity (XXE) attacks.
- Exploit insecure deserialization vulnerabilities.
- Perform path traversal attacks (e.g.,
../../etc/passwd
). - Use cross-site scripting (XSS) in JSON/XML responses.
- Try LDAP injections in user directory APIs.
- Manipulate graph queries (e.g., GraphQL injections).
- Send malformed JSON/XML payloads.
- Use oversized requests to test for DoS vulnerabilities.
- Inject unicode characters to bypass filters.
- Fuzz with unexpected inputs like negative numbers or long strings.
- Test for regular expression DoS (ReDoS) vulnerabilities.
- Send double-encoded payloads to bypass validation.
- Manipulate API queries with SQL wildcards.
- Inject JavaScript Object Notation Hijacking (JSON Hijacking).
- Test for HTTP parameter pollution.
- Experiment with incomplete request bodies.
- Use nested or recursive payloads to crash parsers.
41–60: Business Logic Testing
- Test for improper rate limits (e.g., brute force).
- Abuse API workflows for free or unauthorized access.
- Manipulate payment APIs to bypass charges.
- Exploit currency conversion discrepancies.
- Modify shipping calculations in e-commerce APIs.
- Bypass API rules for promo codes.
- Duplicate transaction requests to double-charge or refund.
- Exploit logical flaws in subscription APIs.
- Test state management flaws in multi-step processes.
- Exploit APIs to access internal admin functions.
- Use incomplete or delayed responses to probe data leakage.
- Attempt to modify immutable objects.
- Test for skipping steps in multi-stage workflows.
- Exploit sequence-breaking vulnerabilities.
- Abuse caching mechanisms to expose stale data.
- Attempt double-spending attacks via concurrent requests.
- Test for missing cleanup mechanisms in transaction APIs.
- Check for unintended rate-limited actions (e.g., skipping approvals).
- Abuse cross-tenant isolation issues in SaaS APIs.
- Manipulate timestamps to exploit time-dependent logic.
61–80: Misconfiguration Issues
- Exploit APIs with default configurations.
- Test for verbose error messages leaking sensitive info.
- Check for API debugging tools exposed in production.
- Look for unsecured admin endpoints.
- Scan for open API schemas (
swagger.json
,api-docs
). - Exploit unfiltered log outputs.
- Abuse hard-coded secrets in API code.
- Access unsecured database connections.
- Test for overly permissive access controls.
- Look for exposed APIs via search engines (e.g., Google Dorks).
- Test for weak or missing TLS configurations.
- Exploit insecure redirects in API responses.
- Abuse API versioning to access deprecated features.
- Check for unpatched software vulnerabilities.
- Enumerate hidden endpoints using robots.txt or sitemap.xml.
- Exploit HTTP method misconfigurations (e.g., PUT instead of GET).
- Abuse misconfigured rate limits to perform DoS.
- Scan for open debugging ports (e.g., gRPC APIs).
- Exploit APIs on default ports (e.g., 8080).
- Identify proxy misconfigurations leading to request tampering.
81–100: Advanced Techniques
- Exploit side-channel leaks (e.g., timing attacks).
- Perform subdomain takeovers to compromise API endpoints.
- Exploit API chaining to combine vulnerabilities.
- Test for unauthorized file uploads.
- Abuse GraphQL introspection to gather sensitive details.
- Exploit metadata endpoints on cloud services (e.g., AWS).
- Analyze mobile app traffic to find hidden APIs.
- Use reverse engineering tools to extract API keys.
- Test middleware vulnerabilities (e.g., API gateways).
- Intercept API traffic with MITM attacks.
- Perform SSTI attacks (Server-Side Template Injection).
- Exploit functionality exposed via third-party integrations.
- Abuse public API keys in repositories.
- Automate scans with Burp Suite or OWASP ZAP.
- Use fuzzing tools like FFUF or Atheris.
- Exploit delayed rate limits (e.g., per minute vs. per request).
- Perform JWT replay attacks.
- Inject API hooks into client applications.
- Use tools like Postman, Insomnia, or cURL for manual testing.
- Cross-reference APIs with CVE databases to find public exploits.
These methods cover a broad spectrum of API security testing. Always ensure you have proper legal authorization to test APIs to comply with ethical and legal boundaries.