@memrov2/pentcloud-sqlmap 0.0.0-stage → 0.1.1-dev.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.
- package/LICENSE +21 -0
- package/README.md +2 -2
- package/THIRD_PARTY_NOTICES.md +3 -0
- package/package.json +36 -4
- package/src/index.d.mts +9 -0
- package/src/index.mjs +69 -0
- package/src/worker.d.mts +9 -0
- package/src/worker.mjs +3 -0
- package/tools.lock.json +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PentCloud contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PentCloud sqlmap
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Version 0.1.0 SDK for the native Cloudflare sqlmap tool pack. See the repository [bundle documentation](https://github.com/Memrov/PentCloud-tools/blob/main/docs/bundles.md) for its exact interface, build and limitations. The package exposes the adapter as its main entry point and SqlmapRunner through `./worker`.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# SQLmap pack notices
|
|
2
|
+
|
|
3
|
+
SQLmap 1.10 is distributed under GPL-2.0 with the upstream licensing clarifications in its LICENSE. Its complete unmodified source and LICENSE are included in the image under /opt/pentcloud-sqlmap/assets/sqlmap. The Python/Alpine base retains its upstream packages and licenses. See tools.lock.json for the exact source archive and checksum. The separate adapter is MIT licensed; that does not relicense SQLmap.
|
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memrov2/pentcloud-sqlmap",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1-dev.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"description": "Cloudflare-native sqlmap tool pack",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/Memrov/PentCloud-tools.git",
|
|
10
|
+
"directory": "packages/sqlmap"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=22"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./src/index.d.mts",
|
|
18
|
+
"import": "./src/index.mjs"
|
|
19
|
+
},
|
|
20
|
+
"./worker": {
|
|
21
|
+
"types": "./src/worker.d.mts",
|
|
22
|
+
"import": "./src/worker.mjs"
|
|
23
|
+
},
|
|
24
|
+
"./tools.lock.json": "./tools.lock.json"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"src",
|
|
28
|
+
"tools.lock.json",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"THIRD_PARTY_NOTICES.md"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@memrov2/pentcloud-tool-runtime": "0.1.1-dev.0"
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/index.d.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolCommand, PackLock } from "@memrov2/pentcloud-tool-runtime";
|
|
2
|
+
export type PackRequest = {
|
|
3
|
+
tool: "sqlmap";
|
|
4
|
+
target: string;
|
|
5
|
+
parameter: string;
|
|
6
|
+
database?: "sqlite" | "mysql" | "postgresql" | "mssql";
|
|
7
|
+
};
|
|
8
|
+
export declare const lock: PackLock;
|
|
9
|
+
export declare function buildCommand(input: PackRequest): ToolCommand;
|
package/src/index.mjs
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { request } from "@memrov2/pentcloud-tool-runtime";
|
|
2
|
+
import lock from "../tools.lock.json" with { type: "json" };
|
|
3
|
+
export { lock };
|
|
4
|
+
export function buildCommand(input) {
|
|
5
|
+
const url = request(
|
|
6
|
+
input,
|
|
7
|
+
["tool", "target", "parameter", "database"],
|
|
8
|
+
["sqlmap"],
|
|
9
|
+
);
|
|
10
|
+
if (
|
|
11
|
+
typeof input.parameter !== "string" ||
|
|
12
|
+
!/^[A-Za-z_][A-Za-z0-9_.-]{0,63}$/.test(input.parameter) ||
|
|
13
|
+
url.searchParams.getAll(input.parameter).length !== 1 ||
|
|
14
|
+
url.href.includes("*")
|
|
15
|
+
)
|
|
16
|
+
throw new TypeError("Select exactly one existing query parameter");
|
|
17
|
+
// SQLmap's explicit -p aliases override --param-filter for these headers.
|
|
18
|
+
if (
|
|
19
|
+
[
|
|
20
|
+
"ua",
|
|
21
|
+
"useragent",
|
|
22
|
+
"user-agent",
|
|
23
|
+
"ref",
|
|
24
|
+
"referer",
|
|
25
|
+
"referrer",
|
|
26
|
+
"host",
|
|
27
|
+
"cookie",
|
|
28
|
+
].includes(input.parameter.toLowerCase())
|
|
29
|
+
)
|
|
30
|
+
throw new TypeError(
|
|
31
|
+
"Reserved SQLmap header aliases are not supported query parameters",
|
|
32
|
+
);
|
|
33
|
+
const db = {
|
|
34
|
+
sqlite: "SQLite",
|
|
35
|
+
mysql: "MySQL",
|
|
36
|
+
postgresql: "PostgreSQL",
|
|
37
|
+
mssql: "Microsoft SQL Server",
|
|
38
|
+
};
|
|
39
|
+
if (input.database !== undefined && !Object.hasOwn(db, input.database))
|
|
40
|
+
throw new TypeError("Unsupported database hint");
|
|
41
|
+
const args = [
|
|
42
|
+
"/opt/pentcloud-sqlmap/assets/sqlmap/sqlmap.py",
|
|
43
|
+
"-u",
|
|
44
|
+
url.href,
|
|
45
|
+
"-p",
|
|
46
|
+
input.parameter,
|
|
47
|
+
"--batch",
|
|
48
|
+
"--disable-coloring",
|
|
49
|
+
"--threads=1",
|
|
50
|
+
"--delay=0.5",
|
|
51
|
+
"--timeout=8",
|
|
52
|
+
"--retries=0",
|
|
53
|
+
"--risk=1",
|
|
54
|
+
"--level=1",
|
|
55
|
+
"--param-filter=GET",
|
|
56
|
+
"--technique=BE",
|
|
57
|
+
"--skip-waf",
|
|
58
|
+
"--ignore-redirects",
|
|
59
|
+
"--flush-session",
|
|
60
|
+
"--fresh-queries",
|
|
61
|
+
"--output-dir=/tmp/pentcloud-sqlmap/results",
|
|
62
|
+
];
|
|
63
|
+
if (input.database) args.push("--dbms", db[input.database]);
|
|
64
|
+
return {
|
|
65
|
+
argv: ["/opt/pentcloud-sqlmap/bin/sqlmap", ...args],
|
|
66
|
+
stdin: "",
|
|
67
|
+
timeoutMs: 75000,
|
|
68
|
+
};
|
|
69
|
+
}
|
package/src/worker.d.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DurableObject } from "cloudflare:workers";
|
|
2
|
+
import type { ToolResult } from "@memrov2/pentcloud-tool-runtime";
|
|
3
|
+
import type { PackRequest } from "./index.mjs";
|
|
4
|
+
export declare class SqlmapRunner extends DurableObject {
|
|
5
|
+
ready(): Promise<{ image: string; instance: "lite"; readyMs: number }>;
|
|
6
|
+
run(input: PackRequest): Promise<ToolResult>;
|
|
7
|
+
retire(): Promise<{ stopped: boolean; retired: true }>;
|
|
8
|
+
stop(): Promise<{ stopped: boolean }>;
|
|
9
|
+
}
|
package/src/worker.mjs
ADDED
package/tools.lock.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"packVersion": "0.1.0",
|
|
4
|
+
"platform": "linux/amd64",
|
|
5
|
+
"packId": "sqlmap",
|
|
6
|
+
"baseImage": "docker.io/library/python@sha256:bdd0cc97663b9b920570d0f1b4601ee18ed895221a0594ca1d9b5e2f26adba83",
|
|
7
|
+
"tools": [
|
|
8
|
+
{
|
|
9
|
+
"tool": "sqlmap",
|
|
10
|
+
"version": "1.10",
|
|
11
|
+
"url": "https://codeload.github.com/sqlmapproject/sqlmap/tar.gz/refs/tags/1.10",
|
|
12
|
+
"format": "sqlmap-tar",
|
|
13
|
+
"sha256": "aea3bf921d9a2466bc0e33cf43bc941f527eabf7981ec1de104220def3a1cba4"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"assets": [],
|
|
17
|
+
"executables": ["sqlmap"]
|
|
18
|
+
}
|