open-sploit 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +75 -0
  3. package/bin/install.mjs +158 -0
  4. package/package.json +27 -0
  5. package/template/agent/offsec.md +53 -0
  6. package/template/command/target.md +45 -0
  7. package/template/config/opencode.example.json +46 -0
  8. package/template/skills/api-security-testing/SKILL.md +61 -0
  9. package/template/skills/conducting-api-security-testing/LICENSE +201 -0
  10. package/template/skills/conducting-api-security-testing/SKILL.md +195 -0
  11. package/template/skills/conducting-api-security-testing/references/api-reference.md +62 -0
  12. package/template/skills/conducting-api-security-testing/scripts/agent.py +228 -0
  13. package/template/skills/exploiting-api-injection-vulnerabilities/LICENSE +201 -0
  14. package/template/skills/exploiting-api-injection-vulnerabilities/SKILL.md +481 -0
  15. package/template/skills/exploiting-api-injection-vulnerabilities/references/api-reference.md +103 -0
  16. package/template/skills/exploiting-api-injection-vulnerabilities/scripts/agent.py +142 -0
  17. package/template/skills/exploiting-http-request-smuggling/LICENSE +201 -0
  18. package/template/skills/exploiting-http-request-smuggling/SKILL.md +343 -0
  19. package/template/skills/exploiting-http-request-smuggling/references/api-reference.md +53 -0
  20. package/template/skills/exploiting-http-request-smuggling/scripts/agent.py +196 -0
  21. package/template/skills/exploiting-idor-vulnerabilities/LICENSE +201 -0
  22. package/template/skills/exploiting-idor-vulnerabilities/SKILL.md +309 -0
  23. package/template/skills/exploiting-idor-vulnerabilities/references/api-reference.md +52 -0
  24. package/template/skills/exploiting-idor-vulnerabilities/scripts/agent.py +177 -0
  25. package/template/skills/exploiting-jwt-algorithm-confusion-attack/LICENSE +201 -0
  26. package/template/skills/exploiting-jwt-algorithm-confusion-attack/SKILL.md +472 -0
  27. package/template/skills/exploiting-jwt-algorithm-confusion-attack/references/api-reference.md +99 -0
  28. package/template/skills/exploiting-jwt-algorithm-confusion-attack/scripts/agent.py +132 -0
  29. package/template/skills/exploiting-nosql-injection-vulnerabilities/LICENSE +201 -0
  30. package/template/skills/exploiting-nosql-injection-vulnerabilities/SKILL.md +219 -0
  31. package/template/skills/exploiting-nosql-injection-vulnerabilities/assets/template.md +30 -0
  32. package/template/skills/exploiting-nosql-injection-vulnerabilities/references/api-reference.md +85 -0
  33. package/template/skills/exploiting-nosql-injection-vulnerabilities/references/standards.md +19 -0
  34. package/template/skills/exploiting-nosql-injection-vulnerabilities/references/workflows.md +23 -0
  35. package/template/skills/exploiting-nosql-injection-vulnerabilities/scripts/agent.py +136 -0
  36. package/template/skills/exploiting-nosql-injection-vulnerabilities/scripts/process.py +222 -0
  37. package/template/skills/exploiting-oauth-misconfiguration/LICENSE +201 -0
  38. package/template/skills/exploiting-oauth-misconfiguration/SKILL.md +316 -0
  39. package/template/skills/exploiting-oauth-misconfiguration/references/api-reference.md +59 -0
  40. package/template/skills/exploiting-oauth-misconfiguration/scripts/agent.py +232 -0
  41. package/template/skills/exploiting-prototype-pollution-in-javascript/LICENSE +201 -0
  42. package/template/skills/exploiting-prototype-pollution-in-javascript/SKILL.md +239 -0
  43. package/template/skills/exploiting-prototype-pollution-in-javascript/references/api-reference.md +102 -0
  44. package/template/skills/exploiting-prototype-pollution-in-javascript/scripts/agent.py +156 -0
  45. package/template/skills/exploiting-race-condition-vulnerabilities/LICENSE +201 -0
  46. package/template/skills/exploiting-race-condition-vulnerabilities/SKILL.md +246 -0
  47. package/template/skills/exploiting-race-condition-vulnerabilities/references/api-reference.md +84 -0
  48. package/template/skills/exploiting-race-condition-vulnerabilities/scripts/agent.py +119 -0
  49. package/template/skills/exploiting-server-side-request-forgery/LICENSE +201 -0
  50. package/template/skills/exploiting-server-side-request-forgery/SKILL.md +354 -0
  51. package/template/skills/exploiting-server-side-request-forgery/references/api-reference.md +57 -0
  52. package/template/skills/exploiting-server-side-request-forgery/scripts/agent.py +183 -0
  53. package/template/skills/exploiting-sql-injection-vulnerabilities/LICENSE +201 -0
  54. package/template/skills/exploiting-sql-injection-vulnerabilities/SKILL.md +205 -0
  55. package/template/skills/exploiting-sql-injection-vulnerabilities/references/api-reference.md +60 -0
  56. package/template/skills/exploiting-sql-injection-vulnerabilities/scripts/agent.py +196 -0
  57. package/template/skills/exploiting-sql-injection-with-sqlmap/LICENSE +201 -0
  58. package/template/skills/exploiting-sql-injection-with-sqlmap/SKILL.md +257 -0
  59. package/template/skills/exploiting-sql-injection-with-sqlmap/references/api-reference.md +74 -0
  60. package/template/skills/exploiting-sql-injection-with-sqlmap/scripts/agent.py +217 -0
  61. package/template/skills/exploiting-template-injection-vulnerabilities/LICENSE +201 -0
  62. package/template/skills/exploiting-template-injection-vulnerabilities/SKILL.md +322 -0
  63. package/template/skills/exploiting-template-injection-vulnerabilities/references/api-reference.md +55 -0
  64. package/template/skills/exploiting-template-injection-vulnerabilities/scripts/agent.py +205 -0
  65. package/template/skills/exploiting-type-juggling-vulnerabilities/LICENSE +201 -0
  66. package/template/skills/exploiting-type-juggling-vulnerabilities/SKILL.md +272 -0
  67. package/template/skills/exploiting-type-juggling-vulnerabilities/references/api-reference.md +87 -0
  68. package/template/skills/exploiting-type-juggling-vulnerabilities/scripts/agent.py +141 -0
  69. package/template/skills/exploiting-websocket-vulnerabilities/LICENSE +201 -0
  70. package/template/skills/exploiting-websocket-vulnerabilities/SKILL.md +424 -0
  71. package/template/skills/exploiting-websocket-vulnerabilities/references/api-reference.md +62 -0
  72. package/template/skills/exploiting-websocket-vulnerabilities/scripts/agent.py +211 -0
  73. package/template/skills/hackerone/SKILL.md +137 -0
  74. package/template/skills/hackerone/reference/INTEGRATION_GUIDE.md +199 -0
  75. package/template/skills/hackerone/reference/sensitive-data-tracking.md +134 -0
  76. package/template/skills/hackerone/tools/__init__.py +0 -0
  77. package/template/skills/hackerone/tools/csv_parser.py +185 -0
  78. package/template/skills/hackerone/tools/report_validator.py +285 -0
  79. package/template/skills/hackerone/tools/sensitive_data_tracker.py +495 -0
  80. package/template/skills/owasp-top-10-testing/SKILL.md +64 -0
  81. package/template/skills/web-app-penetration-testing/SKILL.md +54 -0
@@ -0,0 +1,201 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. Please do not remove or change
186
+ the license header comment from a contributed file except when
187
+ necessary.
188
+
189
+ Copyright 2026 mukul975
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,195 @@
1
+ ---
2
+ name: conducting-api-security-testing
3
+ description: 'Conducts security testing of REST, GraphQL, and gRPC APIs to identify
4
+ vulnerabilities in authentication, authorization, rate limiting, input validation,
5
+ and business logic. The tester uses the OWASP API Security Top 10 as the testing
6
+ framework, combining Burp Suite interception with Postman collections and custom
7
+ scripts to test endpoint security at every privilege level. Activates for requests
8
+ involving API security testing, REST API pentest, GraphQL security assessment, or
9
+ API vulnerability testing.
10
+
11
+ '
12
+ domain: cybersecurity
13
+ subdomain: penetration-testing
14
+ tags:
15
+ - API-security
16
+ - OWASP-API-Top10
17
+ - REST
18
+ - GraphQL
19
+ - authorization-testing
20
+ version: 1.0.0
21
+ author: mahipal
22
+ license: Apache-2.0
23
+ nist_csf:
24
+ - ID.RA-01
25
+ - ID.RA-06
26
+ - GV.OV-02
27
+ - DE.AE-07
28
+ mitre_attack:
29
+ - T1190
30
+ - T1213
31
+ - T1552.001
32
+ - T1078
33
+ - T1071.001
34
+ ---
35
+ # Conducting API Security Testing
36
+
37
+ ## When to Use
38
+
39
+ - Testing API endpoints for authorization flaws, injection vulnerabilities, and business logic bypasses
40
+ - Assessing the security of microservices architecture where APIs are the primary communication method
41
+ - Validating that API gateway protections (rate limiting, authentication, input validation) are properly enforced
42
+ - Testing third-party API integrations for data exposure and insecure configurations
43
+ - Evaluating GraphQL APIs for introspection disclosure, query complexity attacks, and authorization bypasses
44
+
45
+ **Do not use** against APIs without written authorization, for load testing or denial-of-service testing unless explicitly scoped, or for testing production APIs that process real financial transactions without safeguards.
46
+
47
+ ## Prerequisites
48
+
49
+ - API documentation (OpenAPI/Swagger, GraphQL schema, Postman collection) or application access to reverse-engineer the API
50
+ - Burp Suite Professional configured to intercept API traffic with JSON/XML content type handling
51
+ - Postman or Insomnia for organizing and replaying API requests across different authentication contexts
52
+ - Valid API tokens or credentials at multiple privilege levels (unauthenticated, standard user, admin)
53
+ - Target API base URL and version information
54
+
55
+ ## Workflow
56
+
57
+ ### Step 1: API Discovery and Documentation
58
+
59
+ Map the complete API attack surface:
60
+
61
+ - **Import API documentation**: Load OpenAPI/Swagger specs into Postman or Burp Suite to catalog all endpoints, methods, parameters, and authentication requirements
62
+ - **Reverse-engineer undocumented APIs**: Proxy the mobile app or web frontend through Burp Suite and exercise all features to capture API calls. Export the Burp sitemap as the baseline endpoint inventory.
63
+ - **GraphQL introspection**: Send an introspection query to discover the full schema:
64
+ ```json
65
+ {"query": "{__schema{types{name,fields{name,args{name,type{name}}}}}}"}
66
+ ```
67
+ - **Endpoint enumeration**: Fuzz for hidden API versions (`/api/v1/`, `/api/v2/`, `/api/internal/`), debug endpoints (`/api/debug`, `/api/health`, `/api/metrics`), and administrative endpoints
68
+ - **Document authentication mechanisms**: Identify if the API uses API keys, OAuth 2.0 Bearer tokens, JWT, session cookies, or mutual TLS
69
+
70
+ ### Step 2: Authentication and Token Testing
71
+
72
+ Test authentication mechanisms for weaknesses:
73
+
74
+ - **JWT analysis**: Decode the JWT and inspect claims (sub, exp, iss, aud, role). Test:
75
+ - Algorithm confusion: Change `alg` to `none` and remove the signature
76
+ - Key confusion: Change `alg` from RS256 to HS256 and sign with the public key
77
+ - Weak secret: Brute-force the HMAC secret with `hashcat -m 16500 jwt.txt wordlist.txt`
78
+ - Token expiration: Verify tokens expire and cannot be used after expiration
79
+ - Claim tampering: Modify role, userId, or permission claims and re-sign
80
+ - **OAuth 2.0 testing**: Check for redirect_uri manipulation, authorization code reuse, token leakage in Referer headers, and missing state parameter (CSRF)
81
+ - **API key security**: Test if API keys are validated per-endpoint, if revoked keys are immediately rejected, and if keys in query strings appear in access logs or analytics
82
+
83
+ ### Step 3: Authorization Testing (BOLA/BFLA)
84
+
85
+ Test for Broken Object Level Authorization (BOLA) and Broken Function Level Authorization (BFLA):
86
+
87
+ - **BOLA (IDOR) testing**: For every endpoint that returns user-specific data, replace the object identifier with another user's identifier:
88
+ - `GET /api/users/123/orders` -> `GET /api/users/456/orders`
89
+ - Test with numeric IDs, UUIDs, usernames, and email addresses
90
+ - Automate with Burp Autorize extension: configure it with two sessions (attacker and victim) and replay all requests
91
+ - **BFLA testing**: Using a low-privilege token, attempt to access administrative endpoints:
92
+ - `DELETE /api/users/456` (admin-only delete)
93
+ - `PUT /api/users/456/role` (role modification)
94
+ - `GET /api/admin/dashboard` (admin panel data)
95
+ - **Mass assignment**: Send additional JSON properties not shown in the documentation:
96
+ ```json
97
+ PUT /api/users/123
98
+ {"name": "Test", "role": "admin", "isVerified": true, "balance": 99999}
99
+ ```
100
+ - **HTTP method testing**: If GET works on an endpoint, try PUT, PATCH, DELETE, and OPTIONS to discover unprotected methods
101
+
102
+ ### Step 4: Input Validation and Injection Testing
103
+
104
+ Test API inputs for injection and validation flaws:
105
+
106
+ - **SQL injection in API parameters**: Test all parameters (path, query, body, headers) with SQL injection payloads. JSON APIs are often overlooked: `{"username": "admin' OR 1=1--", "password": "test"}`
107
+ - **NoSQL injection**: For MongoDB backends, test with operator injection: `{"username": {"$gt": ""}, "password": {"$gt": ""}}`
108
+ - **SSRF via API**: Test any parameter that accepts URLs (webhook URLs, avatar URLs, import endpoints) with internal addresses and cloud metadata endpoints
109
+ - **GraphQL-specific injection**: Test for query depth attacks, alias-based batching for brute force, and field suggestion enumeration
110
+ - **XXE in XML APIs**: Submit XML content with external entity declarations to API endpoints that accept XML
111
+ - **Rate limiting validation**: Send 100+ rapid requests to authentication endpoints, password reset, and OTP verification to test for brute force protection
112
+
113
+ ### Step 5: Data Exposure and Response Analysis
114
+
115
+ Check for excessive data exposure in API responses:
116
+
117
+ - **Verbose responses**: Compare the data returned in API responses with what the UI displays. APIs often return more fields than needed (internal IDs, creation timestamps, email addresses of other users, role information).
118
+ - **Error message analysis**: Trigger errors by sending malformed input, invalid tokens, and non-existent resources. Check if error messages reveal stack traces, database queries, internal paths, or technology details.
119
+ - **Pagination and enumeration**: Test if enumeration is possible by iterating through paginated responses (`/api/users?page=1`, `page=2`, etc.) to extract all records
120
+ - **GraphQL data exposure**: Query for fields not intended for the current user's role. Test nested queries that traverse relationships to access unauthorized data.
121
+ - **Debug endpoints**: Check `/api/debug`, `/api/status`, `/metrics`, `/health`, `/.env`, `/api/swagger.json` for exposed internal information
122
+
123
+ ## Key Concepts
124
+
125
+ | Term | Definition |
126
+ |------|------------|
127
+ | **BOLA** | Broken Object Level Authorization (OWASP API #1); failure to verify that the requesting user is authorized to access a specific object, enabling IDOR attacks |
128
+ | **BFLA** | Broken Function Level Authorization (OWASP API #5); failure to restrict administrative or privileged API functions from being accessed by lower-privilege users |
129
+ | **Mass Assignment** | A vulnerability where the API binds client-provided data to internal object properties without filtering, allowing attackers to modify fields they should not have access to |
130
+ | **GraphQL Introspection** | A built-in GraphQL feature that exposes the complete API schema including all types, fields, and relationships; should be disabled in production |
131
+ | **JWT** | JSON Web Token; a self-contained token format used for API authentication containing claims signed with a secret or key pair |
132
+ | **Rate Limiting** | Controls that restrict the number of API requests a client can make within a time window, preventing brute force, enumeration, and abuse |
133
+
134
+ ## Tools & Systems
135
+
136
+ - **Burp Suite Professional**: HTTP proxy for intercepting, modifying, and replaying API requests with extensions like Autorize for automated authorization testing
137
+ - **Postman**: API development platform used for organizing endpoint collections, scripting tests, and comparing responses across authentication contexts
138
+ - **GraphQL Voyager**: Visual tool for exploring GraphQL schemas obtained through introspection queries
139
+ - **jwt.io / jwt_tool**: Tools for decoding, analyzing, and tampering with JWT tokens to test authentication bypasses
140
+ - **Nuclei**: Template-based scanner with API-specific templates for detecting common misconfigurations and known vulnerabilities
141
+
142
+ ## Common Scenarios
143
+
144
+ ### Scenario: API Security Assessment for a Fintech Mobile Application
145
+
146
+ **Context**: A fintech startup has a mobile banking application with a REST API backend. The API handles account management, fund transfers, bill payments, and transaction history. The tester has Swagger documentation and accounts at user and admin levels.
147
+
148
+ **Approach**:
149
+ 1. Import Swagger spec into Postman, generating 87 endpoint collections across 12 controllers
150
+ 2. Discover BOLA on `/api/v1/accounts/{accountId}/transactions` allowing any authenticated user to view any account's transaction history
151
+ 3. Find mass assignment on the user update endpoint where adding `"dailyTransferLimit": 999999` bypasses the configured transfer limit
152
+ 4. Identify that the fund transfer endpoint lacks rate limiting, allowing unlimited transfer attempts without throttling
153
+ 5. Discover that JWT tokens have a 30-day expiration with no refresh token rotation, enabling long-lived session hijacking
154
+ 6. Find that the admin endpoint `/api/v1/admin/users` is accessible with a standard user token (BFLA)
155
+ 7. Report all findings with CVSS scores and specific API code-level remediation guidance
156
+
157
+ **Pitfalls**:
158
+ - Testing only the endpoints documented in Swagger and missing undocumented or deprecated API versions
159
+ - Not testing the same endpoint with tokens from every privilege level to detect authorization bypasses
160
+ - Ignoring response body analysis for excessive data exposure when the UI only shows a subset of returned fields
161
+ - Failing to test for mass assignment by only sending fields shown in the documentation
162
+
163
+ ## Output Format
164
+
165
+ ```
166
+ ## Finding: Broken Object Level Authorization in Transaction History API
167
+
168
+ **ID**: API-001
169
+ **Severity**: Critical (CVSS 9.1)
170
+ **Affected Endpoint**: GET /api/v1/accounts/{accountId}/transactions
171
+ **OWASP API Category**: API1:2023 - Broken Object Level Authorization
172
+
173
+ **Description**:
174
+ The transaction history endpoint returns all transactions for the specified
175
+ account without verifying that the authenticated user owns the account. Any
176
+ authenticated user can view the complete transaction history of any account
177
+ by substituting the accountId path parameter.
178
+
179
+ **Proof of Concept**:
180
+ 1. Authenticate as User A (account ID: ACC-10045)
181
+ 2. Request: GET /api/v1/accounts/ACC-10046/transactions
182
+ Authorization: Bearer <User_A_token>
183
+ 3. Response: 200 OK with User B's full transaction history
184
+
185
+ **Impact**:
186
+ Any authenticated user can view the complete financial transaction history of
187
+ all 45,000 customer accounts, including amounts, dates, recipients, and
188
+ transaction descriptions.
189
+
190
+ **Remediation**:
191
+ Implement server-side authorization check that verifies the authenticated user
192
+ owns the requested account before returning data:
193
+ const account = await Account.findById(accountId);
194
+ if (account.userId !== req.user.id) return res.status(403).json({error: "Forbidden"});
195
+ ```
@@ -0,0 +1,62 @@
1
+ # API Reference: API Security Testing Agent
2
+
3
+ ## Overview
4
+
5
+ Tests REST and GraphQL APIs for OWASP API Security Top 10 vulnerabilities including BOLA, BFLA, mass assignment, rate limiting, JWT bypass, and GraphQL introspection disclosure. For authorized penetration testing only.
6
+
7
+ ## Dependencies
8
+
9
+ | Package | Version | Purpose |
10
+ |---------|---------|---------|
11
+ | requests | >=2.28 | HTTP requests to target APIs |
12
+
13
+ ## CLI Usage
14
+
15
+ ```bash
16
+ python agent.py --base-url https://api.target.com --token <jwt> \
17
+ --low-priv-token <jwt> --graphql --output report.json
18
+ ```
19
+
20
+ ## Arguments
21
+
22
+ | Argument | Required | Description |
23
+ |----------|----------|-------------|
24
+ | `--base-url` | Yes | Target API base URL |
25
+ | `--token` | No | Auth bearer token for authenticated testing |
26
+ | `--low-priv-token` | No | Low-privilege token for BFLA testing |
27
+ | `--login-endpoint` | No | Login endpoint for rate limiting test (default: `/api/auth/login`) |
28
+ | `--graphql` | No | Test GraphQL introspection disclosure |
29
+ | `--output` | No | Output file (default: `api_security_report.json`) |
30
+
31
+ ## Key Functions
32
+
33
+ ### `test_bola(base_url, endpoint_template, id_field, valid_id, other_id, auth_token)`
34
+ Tests Broken Object Level Authorization by accessing another user's resource with own credentials.
35
+
36
+ ### `test_bfla(base_url, admin_endpoints, low_priv_token)`
37
+ Tests admin endpoints with low-privilege tokens using GET, POST, DELETE methods.
38
+
39
+ ### `test_mass_assignment(base_url, endpoint, auth_token, extra_fields)`
40
+ Sends undocumented fields (role, isAdmin) to update endpoints and verifies if they persist.
41
+
42
+ ### `test_rate_limiting(base_url, endpoint, num_requests)`
43
+ Sends rapid requests to detect absence of rate limiting on authentication endpoints.
44
+
45
+ ### `test_jwt_none_algorithm(base_url, endpoint, jwt_token)`
46
+ Forges JWT with `alg: none` to test for algorithm confusion vulnerabilities.
47
+
48
+ ### `test_graphql_introspection(base_url, graphql_endpoint)`
49
+ Sends introspection query to check if full schema disclosure is enabled.
50
+
51
+ ### `test_excessive_data_exposure(base_url, endpoint, auth_token, expected_fields)`
52
+ Compares API response fields against expected fields to identify over-exposure.
53
+
54
+ ## OWASP API Top 10 Coverage
55
+
56
+ | OWASP ID | Vulnerability | Function |
57
+ |----------|--------------|----------|
58
+ | API1:2023 | Broken Object Level Authorization | `test_bola` |
59
+ | API3:2023 | Excessive Data Exposure | `test_excessive_data_exposure` |
60
+ | API4:2023 | Unrestricted Resource Consumption | `test_rate_limiting` |
61
+ | API5:2023 | Broken Function Level Authorization | `test_bfla` |
62
+ | API6:2023 | Mass Assignment | `test_mass_assignment` |