blackops-sql 0.1.6__py3-none-any.whl

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.
@@ -0,0 +1,250 @@
1
+ Metadata-Version: 2.4
2
+ Name: blackops-sql
3
+ Version: 0.1.6
4
+ Summary: API-aware SQL injection reconnaissance and validation engine
5
+ Project-URL: Homepage, https://github.com/roc1t1z3not/BlackOpsSQL
6
+ Project-URL: Issues, https://github.com/roc1t1z3not/BlackOpsSQL/issues
7
+ Author: roc1t1z3not
8
+ License: AGPL-3.0-or-later
9
+ License-File: LICENSE
10
+ License-File: NOTICE
11
+ Keywords: bugbounty,pentest,scanner,security,sql-injection,sqli
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Information Technology
15
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Security
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: blackops-cli
25
+ Requires-Dist: blackops-core
26
+ Requires-Dist: blackops-payloads
27
+ Requires-Dist: requests>=2.28.0
28
+ Requires-Dist: urllib3>=1.26.0
29
+ Provides-Extra: browser
30
+ Requires-Dist: blackops-core[browser]; extra == 'browser'
31
+ Provides-Extra: dev
32
+ Requires-Dist: mypy>=1.0; extra == 'dev'
33
+ Requires-Dist: pytest-mock>=3.0; extra == 'dev'
34
+ Requires-Dist: pytest>=8.0; extra == 'dev'
35
+ Requires-Dist: ruff>=0.4; extra == 'dev'
36
+ Requires-Dist: types-requests; extra == 'dev'
37
+ Description-Content-Type: text/markdown
38
+
39
+ # BlackOpsSQL
40
+ <p align="center">
41
+ <img src="assets/BlackOpsSQL_logo.png" alt="BlackOpsSQL" width="300"/>
42
+ </p>
43
+ <!-- markdownlint-disable MD033 -->
44
+ <p align="center">
45
+ <a href="LICENSE">
46
+ <img src="https://img.shields.io/badge/License-AGPL--3.0-white?style=for-the-badge&logo=opensourceinitiative&logoColor=black" alt="License">
47
+ </a>
48
+ <img src="https://img.shields.io/badge/Python-3.10+-black?style=for-the-badge&logo=python&logoColor=white" alt="Python">
49
+ </p>
50
+ <!-- markdownlint-enable MD033 -->
51
+
52
+ **API-aware SQL injection reconnaissance and validation engine** — detect and extract in one command, across all major backends, with WAF evasion baked in. No Java. No license fees. Drops into a Python pipeline.
53
+
54
+
55
+ > BlackOpsSQL is an AGPL-3.0-or-later modified fork of BreachSQL by CommonHuman-Lab.
56
+
57
+ ```bash
58
+ # Install from source (editable install — required on externally-managed Python)
59
+ git clone https://github.com/roc1t1z3not/BlackOpsSQL.git
60
+ cd BlackOpsSQL
61
+ python3 -m venv .venv && source .venv/bin/activate
62
+ pip install -e .
63
+
64
+ # Scan, exploit, and dump everything — outputs written to target.com/
65
+ blackops-sql -u "https://target.com/item?id=1" --exploit
66
+
67
+ # Dump a specific table straight from the finding
68
+ blackops-sql -u "https://target.com/item?id=1" --dump users
69
+ ```
70
+
71
+ > Point it at a target. Get findings. Drop it in a pipeline.
72
+
73
+ ---
74
+
75
+ ## Why BlackOpsSQL?
76
+
77
+ - **Faster** — binary-search boolean extraction, parallel surface probing, no per-request sleep loops
78
+ - **Detect → exploit in one pass** — `--exploit` dumps every discovered table and writes `.txt`, `.json`, and `.html` outputs to a `<host>/` folder automatically; `--dump TABLE` targets a single table
79
+ - **Python API** — `from blackopssql.engine import scan, ScanOptions` — embed it directly in your own tooling or scripts
80
+ - **Scan from spec** — `--openapi` imports every endpoint from a Swagger/OpenAPI file and scans them all
81
+ - **Curated payloads** — backed by [commonhuman-payloads](https://github.com/CommonHuman-Lab/commonhuman-payloads), an auditable, versioned payload library shared across the toolchain
82
+ - **Pipeline-native** — structured JSON output, clean exit codes, no interactive prompts by default
83
+ - **Lightweight** — pure Python 3.10+, no C extensions, no Java, installs in a venv in seconds
84
+
85
+ ---
86
+
87
+ ## Quick Start
88
+
89
+ ```bash
90
+ # Install
91
+ pip install -e .
92
+
93
+ # GET parameter
94
+ blackops-sql -u "https://target.com/item?id=1"
95
+
96
+ # POST form
97
+ blackops-sql -u "https://target.com/login" -d "username=admin&password=x"
98
+
99
+ # JSON body
100
+ blackops-sql -u "https://target.com/api/user" -d '{"user_id": 1}'
101
+
102
+ # Cookie injection
103
+ blackops-sql -u "https://target.com/profile" --cookie "session_id=abc" --cookie-params session_id
104
+
105
+ # Path parameter
106
+ blackops-sql -u "https://target.com/item/1" --path-params id
107
+
108
+ # Time-blind with custom threshold
109
+ blackops-sql -u "https://target.com/search?name=x" --technique T --time-threshold 3
110
+
111
+ # Specific backend and technique
112
+ blackops-sql -u "https://target.com/users?id=1" --dbms mysql --technique E
113
+
114
+ # Exploit: dump every table, write target.com/{txt,json,html} automatically
115
+ blackops-sql -u "https://target.com/users?id=1" --exploit
116
+
117
+ # Dump all rows from a specific table (implies --exploit)
118
+ blackops-sql -u "https://target.com/users?id=1" --dump users
119
+
120
+ # Dump every table, save results to a custom output stem
121
+ blackops-sql -u "https://target.com/users?id=1" --dump-all -o results/target
122
+
123
+ # Full multi-technique scan
124
+ blackops-sql -u "https://target.com/report?id=1" --dbms mysql --technique EBTUS --level 2 --risk 2
125
+
126
+ # Authenticate before scanning
127
+ blackops-sql -u "https://target.com/app/search?q=test" \
128
+ --login-url "https://target.com/login" \
129
+ --login-user admin --login-pass secret
130
+
131
+ # Import all endpoints from an OpenAPI / Swagger spec
132
+ blackops-sql -u "https://target.com/" --openapi https://target.com/openapi.json
133
+
134
+ # Discover JS-rendered endpoints first, then scan everything
135
+ blackops-sql -u "https://target.com/" --browser-crawl --level 2
136
+ ```
137
+
138
+ ---
139
+
140
+ ## Techniques
141
+
142
+ | Flag | Technique | Description |
143
+ | ---- | --------- | ----------- |
144
+ | `E` | Error-based | Database errors leak schema/data via malformed syntax |
145
+ | `B` | Boolean-blind | True/false response differences reveal data bit by bit |
146
+ | `T` | Time-blind | `SLEEP()` / `pg_sleep()` / `randomblob()` timing confirms injection |
147
+ | `U` | UNION-based | Column-count probing + data extraction via UNION SELECT |
148
+ | `S` | Stacked | Semicolon-delimited second statement injection |
149
+
150
+ Combine with `-t EBTUS` to run all techniques in a single pass.
151
+
152
+ ---
153
+
154
+ ## Python API
155
+
156
+ ```python
157
+ from blackopssql.engine import scan, ScanOptions
158
+
159
+ result = scan(
160
+ "https://target.com/users?id=1",
161
+ ScanOptions(dbms="mysql", technique="E", risk=1),
162
+ )
163
+
164
+ print(f"{result.total_findings} finding(s) in {result.duration_s:.1f}s")
165
+ for f in result.error_based:
166
+ print(f" [{f.technique}] {f.param} — {f.evidence}")
167
+ ```
168
+
169
+ ---
170
+
171
+ ## Options
172
+
173
+ | Option | Default | Description |
174
+ | ------ | ------- | ----------- |
175
+ | `-u` | — | Target to use |
176
+ | `--crawl` | — | Crawl target |
177
+ | `--dbms` | auto | Target backend: `mysql`, `mariadb`, `postgres`, `sqlite`, `mssql`, `oracle` |
178
+ | `-t` / `--technique` | `EBTUS` | Techniques to run (any combo of E B T U S) |
179
+ | `--level` | `1` | Payload depth: 1 = standard, 2 = extended, 3 = extended + data extraction |
180
+ | `--risk` | `1` | Payload aggression: 1 = low, 2 = medium, 3 = high |
181
+ | `--time-threshold` | `5` | Seconds to consider a time-blind hit (T technique) |
182
+ | `-d` / `--data` | — | POST body — form-encoded or JSON |
183
+ | `--cookie` | — | Cookie string: `name=val; name2=val2` |
184
+ | `--cookie-params` | — | Which cookie names to inject |
185
+ | `--header-params` | — | HTTP header names to inject (e.g. `X-Forwarded-For`) |
186
+ | `--path-params` | — | Path segment names to treat as injection points |
187
+ | `--second-url` | — | Read URL for two-step injection |
188
+ | `--timeout` | `10` | Per-request timeout in seconds |
189
+ | `--login-url` | — | Login form URL — authenticates before scanning |
190
+ | `--login-user` | — | Username for form login |
191
+ | `--login-pass` | — | Password for form login |
192
+ | `--openapi` | — | OpenAPI/Swagger spec file or URL — imports endpoints to scan |
193
+ | `--browser-crawl` | — | Headless Chromium endpoint discovery (requires selenium) |
194
+ | `--exploit` | — | Dump every discovered table; auto-creates `<host>/` and writes `<host>.txt`, `<host>.json`, `<host>.html` |
195
+ | `--dump TABLE` | — | Dump all rows from TABLE using a confirmed injection point (implies `--exploit`) |
196
+ | `--dump-all` | — | Dump every discovered table (implies `--exploit`); use with `-o` to control output path |
197
+ | `-o` | — | Output stem — writes `<name>.txt`, `<name>.json`, `<name>_dump.json` |
198
+ | `--report-html` | — | Write a self-contained HTML report to this file |
199
+
200
+ ---
201
+
202
+ ## Fire Range
203
+
204
+ The **BreachSQL Fire Range** is a deliberately vulnerable Flask + MySQL + PostgreSQL + SQLite app that ships with [OctoRig](https://github.com/CommonHuman-Lab/OctoRig). It provides injectable endpoints that the scanner is verified against on every change.
205
+
206
+ ```bash
207
+ # Start the Fire Range (OctoRig required)
208
+ ./octorig.sh start breachsql
209
+
210
+ # Run the full end-to-end test suite
211
+ pytest tests/test_firerange.py -v
212
+ ```
213
+
214
+ → [Fire Range README](https://github.com/CommonHuman-Lab/OctoRig/tree/main/labs/firerange)
215
+
216
+ ---
217
+
218
+ ## Install from source
219
+
220
+ ```bash
221
+ git clone https://github.com/roc1t1z3not/BlackOpsSQL.git
222
+ cd BlackOpsSQL
223
+ python3 -m venv .venv && source .venv/bin/activate
224
+ pip install -e .
225
+ pip install -e ".[dev]" # + pytest, mypy, ruff
226
+ ```
227
+
228
+ Requires Python 3.10+. No C extensions. On Kali and other Debian-based systems, the virtual env is required — system Python is externally managed.
229
+
230
+ ---
231
+
232
+ ## Legal & Ethical Use
233
+
234
+ Only run BlackOpsSQL against applications you own or have explicit written authorization to test. Authorized use includes penetration testing engagements, bug bounty programs within defined scope, and CTF competitions.
235
+
236
+ `--exploit`, `--dump`, and `--dump-all` extract live database content — only use them where data extraction is explicitly permitted by your engagement scope.
237
+
238
+ The authors accept no liability for unauthorized or illegal use.
239
+
240
+ ---
241
+
242
+ ## License
243
+
244
+ Licensed under the [AGPLv3](LICENSE). You are free to use, modify, and distribute this software. If you run it as a service or distribute it, the source must remain open.
245
+
246
+ ---
247
+
248
+ ## Attribution
249
+
250
+ BlackOpsSQL is an AGPL-3.0-or-later modified fork of [BreachSQL](https://github.com/CommonHuman-Lab/breachsql) by CommonHuman-Lab. Original copyright (c) 2026 CommonHuman-Lab. See [NOTICE](NOTICE) for full attribution.
@@ -0,0 +1,29 @@
1
+ blackopssql/__init__.py,sha256=wjwAW0NvvkX3EB5p7Qm505uQo1pcX35Qw4VEfxuj-Ds,3242
2
+ blackopssql/__main__.py,sha256=iVQ7jiAV4YgjpbbiPqA7r8op-cJfODSx2W18DWje6ok,11533
3
+ blackopssql/_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ blackopssql/_cli/args.py,sha256=eEVGYUkbXVafFxQV3DpuLjA2V25GKwap9o6OgumhsF4,11044
5
+ blackopssql/_cli/summary.py,sha256=U_iH3Vy3y2pnih2fPiczCohUP7L7iz5K1t4kLu8lrx4,8416
6
+ blackopssql/engine/__init__.py,sha256=ehHE2iRZpnOTRBH0AV3D15gAojAG07jVc_AVmhBivAo,688
7
+ blackopssql/engine/crawler.py,sha256=tmJZl-czM4DJZWvRCZfrmPZU3VfapLQ7D4QwBGATZ_0,268
8
+ blackopssql/engine/log.py,sha256=GfImVlILwiE8QscQU3ep7pfKT8PB0tvMZwgqFxIImD4,319
9
+ blackopssql/engine/reporter.py,sha256=--ePOj1f7ZgfZlO2DoDaiScLxsl007lqlHPHDpqNY-o,6550
10
+ blackopssql/engine/scanner.py,sha256=4n77Z8jQFANZqMQWeUbRP3_76ywE16L9v-rEvF6aSuM,3175
11
+ blackopssql/engine/_scanner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ blackopssql/engine/_scanner/blind.py,sha256=jR7Gi2pcKyVLTc0kBcinhGTMbxSiS8lxQOt1mkwglHU,12098
13
+ blackopssql/engine/_scanner/extract.py,sha256=aux-ggEddl-4QotsVy7TIJORMlsnLXxK8ILMLbvtaO8,10910
14
+ blackopssql/engine/_scanner/options.py,sha256=IEDFG7L_XJe2yGpk2YzywpJHyk73WsWVOGdDmwOXhzs,4511
15
+ blackopssql/engine/_scanner/passive.py,sha256=L43Nt5UtZWMiFZR6Yf3QC_gYPBNVPCX-cN3qxXvmkpw,3092
16
+ blackopssql/engine/_scanner/pipeline.py,sha256=d4xhxUvY11fSr7Nopa17Gz9nMoNgqnbOE3sRZbHWhFU,21858
17
+ blackopssql/engine/_scanner/stacked.py,sha256=QKO6yHZvV2Nggz6o27yl7BsReaSel5xnpIC9sxkGgR0,5087
18
+ blackopssql/engine/_scanner/active/__init__.py,sha256=p2aNw3d7u5fj_mIYqRBPjdsUdW9cZqfFyikEMK0L2ks,21830
19
+ blackopssql/engine/_scanner/active/_helpers.py,sha256=mBgm6Ggz7deDa3Wiz8rDsZDsMHg1uecd4wXi0Y0df5U,12214
20
+ blackopssql/engine/_scanner/payloads/__init__.py,sha256=9AL9S7mNw5Ufqr8PCWls8SWZqncr9XRDpZo_CAfttpc,1854
21
+ blackopssql/engine/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
+ blackopssql/engine/http/injector.py,sha256=0ANkmEFyYFC-S5JxmXvzh7x80gwR_WykuDdq7Z1EokI,397
23
+ blackopssql/engine/http/waf_detect.py,sha256=IIzxXWDyQKlprndmhm98Ub1N-hU6iXWWXGS6_zgLl4I,1510
24
+ blackops_sql-0.1.6.dist-info/METADATA,sha256=m2RSJQzxyNaQv11sf2bUKxN-8CVESYytHOFwEf1X_6I,10086
25
+ blackops_sql-0.1.6.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
26
+ blackops_sql-0.1.6.dist-info/entry_points.txt,sha256=EzHK84x_9at3uSPMrC_BVxOFXh5tRY8Npl_P2NNWeII,59
27
+ blackops_sql-0.1.6.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
28
+ blackops_sql-0.1.6.dist-info/licenses/NOTICE,sha256=Chb7ex9ALb-HDIiOPw0nDiuq1vI2ZZNAIvUlFjxf5a4,1107
29
+ blackops_sql-0.1.6.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ blackops-sql = blackopssql.__main__:main