@vulcn/plugin-payloads 0.2.1 → 0.3.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/dist/index.cjs +76 -339
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -50
- package/dist/index.d.ts +59 -50
- package/dist/index.js +70 -337
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -2,36 +2,60 @@ import { z } from 'zod';
|
|
|
2
2
|
import { RuntimePayload, VulcnPlugin } from '@vulcn/engine';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* PayloadBox Loader
|
|
6
|
+
*
|
|
7
|
+
* Fetches payloads from PayloadsAllTheThings GitHub repository.
|
|
8
|
+
* This is the primary payload source for Vulcn — community-curated,
|
|
9
|
+
* battle-tested payloads from the largest security payload collection.
|
|
10
|
+
*
|
|
11
|
+
* Supports short aliases for convenience:
|
|
12
|
+
* xss, sqli, xxe, cmd, redirect, traversal
|
|
7
13
|
*/
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
|
-
*
|
|
16
|
+
* Canonical PayloadBox type names (as they appear in PayloadsAllTheThings)
|
|
11
17
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
type PayloadBoxType = "xss" | "sql-injection" | "xxe" | "command-injection" | "open-redirect" | "path-traversal";
|
|
14
19
|
/**
|
|
15
|
-
*
|
|
16
|
-
* Fetches payloads from PayloadsAllTheThings GitHub repository
|
|
20
|
+
* Get all available payload type names (canonical)
|
|
17
21
|
*/
|
|
18
|
-
|
|
22
|
+
declare function getPayloadBoxTypes(): PayloadBoxType[];
|
|
19
23
|
/**
|
|
20
|
-
*
|
|
24
|
+
* Get all short aliases
|
|
21
25
|
*/
|
|
22
|
-
|
|
26
|
+
declare function getAliases(): Record<string, PayloadBoxType>;
|
|
23
27
|
/**
|
|
24
|
-
*
|
|
28
|
+
* Resolve a user-provided name to a canonical PayloadBox type.
|
|
29
|
+
*
|
|
30
|
+
* Accepts:
|
|
31
|
+
* "xss" → "xss"
|
|
32
|
+
* "sqli" → "sql-injection"
|
|
33
|
+
* "sql-injection" → "sql-injection"
|
|
34
|
+
* "cmd" → "command-injection"
|
|
35
|
+
*
|
|
36
|
+
* Returns null if the name doesn't match any known type.
|
|
25
37
|
*/
|
|
26
|
-
declare function
|
|
38
|
+
declare function resolvePayloadType(name: string): PayloadBoxType | null;
|
|
27
39
|
/**
|
|
28
|
-
*
|
|
40
|
+
* Check if a name resolves to a valid PayloadBox type
|
|
41
|
+
*/
|
|
42
|
+
declare function isValidPayloadName(name: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Get description for a payload type
|
|
45
|
+
*/
|
|
46
|
+
declare function getDescription(type: PayloadBoxType): string;
|
|
47
|
+
/**
|
|
48
|
+
* Load payloads from PayloadBox.
|
|
29
49
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
50
|
+
* Accepts both canonical names and short aliases:
|
|
51
|
+
* loadPayloadBox("xss") → fetches XSS payloads
|
|
52
|
+
* loadPayloadBox("sqli") → fetches SQL injection payloads
|
|
33
53
|
*/
|
|
34
|
-
declare function loadPayloadBox(
|
|
54
|
+
declare function loadPayloadBox(name: string, limit?: number, fetchFn?: typeof fetch): Promise<RuntimePayload>;
|
|
55
|
+
/**
|
|
56
|
+
* Clear PayloadBox cache
|
|
57
|
+
*/
|
|
58
|
+
declare function clearPayloadBoxCache(): void;
|
|
35
59
|
|
|
36
60
|
/**
|
|
37
61
|
* File Loader
|
|
@@ -51,10 +75,12 @@ declare function loadFromFile(filePath: string): Promise<RuntimePayload[]>;
|
|
|
51
75
|
* @vulcn/plugin-payloads
|
|
52
76
|
* Official payload loader plugin for Vulcn
|
|
53
77
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* -
|
|
57
|
-
*
|
|
78
|
+
* Payload sources (in order of priority):
|
|
79
|
+
* 1. PayloadBox — community-curated payloads from PayloadsAllTheThings (default)
|
|
80
|
+
* 2. Custom files — expert-provided YAML/JSON payload files
|
|
81
|
+
*
|
|
82
|
+
* Short aliases for payload types:
|
|
83
|
+
* xss, sqli, xxe, cmd, redirect, traversal
|
|
58
84
|
*/
|
|
59
85
|
|
|
60
86
|
/**
|
|
@@ -62,49 +88,32 @@ declare function loadFromFile(filePath: string): Promise<RuntimePayload[]>;
|
|
|
62
88
|
*/
|
|
63
89
|
declare const configSchema: z.ZodObject<{
|
|
64
90
|
/**
|
|
65
|
-
*
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Specific built-in payload names to include (if not all)
|
|
70
|
-
*/
|
|
71
|
-
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
72
|
-
/**
|
|
73
|
-
* Built-in payload names to exclude
|
|
74
|
-
*/
|
|
75
|
-
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
76
|
-
/**
|
|
77
|
-
* PayloadBox types to fetch from PayloadsAllTheThings
|
|
78
|
-
* e.g., ["xss", "sql-injection", "xxe"]
|
|
91
|
+
* Payload types to load from PayloadsAllTheThings.
|
|
92
|
+
* Accepts short aliases: xss, sqli, xxe, cmd, redirect, traversal
|
|
93
|
+
* @example ["xss", "sqli"]
|
|
79
94
|
*/
|
|
80
|
-
|
|
95
|
+
types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
81
96
|
/**
|
|
82
|
-
*
|
|
97
|
+
* Maximum payloads per type (default 50)
|
|
83
98
|
*/
|
|
84
|
-
|
|
99
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
85
100
|
/**
|
|
86
101
|
* Custom payload files to load (YAML/JSON)
|
|
87
102
|
*/
|
|
88
103
|
files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
89
104
|
}, "strip", z.ZodTypeAny, {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
include?: string[] | undefined;
|
|
93
|
-
exclude?: string[] | undefined;
|
|
94
|
-
payloadbox?: string[] | undefined;
|
|
105
|
+
limit: number;
|
|
106
|
+
types?: string[] | undefined;
|
|
95
107
|
files?: string[] | undefined;
|
|
96
108
|
}, {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
exclude?: string[] | undefined;
|
|
100
|
-
payloadbox?: string[] | undefined;
|
|
101
|
-
payloadboxLimit?: number | undefined;
|
|
109
|
+
types?: string[] | undefined;
|
|
110
|
+
limit?: number | undefined;
|
|
102
111
|
files?: string[] | undefined;
|
|
103
112
|
}>;
|
|
104
113
|
type PayloadsPluginConfig = z.infer<typeof configSchema>;
|
|
105
114
|
/**
|
|
106
|
-
* Payloads Plugin
|
|
115
|
+
* Payloads Plugin
|
|
107
116
|
*/
|
|
108
117
|
declare const plugin: VulcnPlugin;
|
|
109
118
|
|
|
110
|
-
export {
|
|
119
|
+
export { type PayloadsPluginConfig, clearPayloadBoxCache, plugin as default, getAliases, getDescription, getPayloadBoxTypes, isValidPayloadName, loadFromFile, loadFromFiles, loadPayloadBox, resolvePayloadType };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,36 +2,60 @@ import { z } from 'zod';
|
|
|
2
2
|
import { RuntimePayload, VulcnPlugin } from '@vulcn/engine';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* PayloadBox Loader
|
|
6
|
+
*
|
|
7
|
+
* Fetches payloads from PayloadsAllTheThings GitHub repository.
|
|
8
|
+
* This is the primary payload source for Vulcn — community-curated,
|
|
9
|
+
* battle-tested payloads from the largest security payload collection.
|
|
10
|
+
*
|
|
11
|
+
* Supports short aliases for convenience:
|
|
12
|
+
* xss, sqli, xxe, cmd, redirect, traversal
|
|
7
13
|
*/
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
|
-
*
|
|
16
|
+
* Canonical PayloadBox type names (as they appear in PayloadsAllTheThings)
|
|
11
17
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
type PayloadBoxType = "xss" | "sql-injection" | "xxe" | "command-injection" | "open-redirect" | "path-traversal";
|
|
14
19
|
/**
|
|
15
|
-
*
|
|
16
|
-
* Fetches payloads from PayloadsAllTheThings GitHub repository
|
|
20
|
+
* Get all available payload type names (canonical)
|
|
17
21
|
*/
|
|
18
|
-
|
|
22
|
+
declare function getPayloadBoxTypes(): PayloadBoxType[];
|
|
19
23
|
/**
|
|
20
|
-
*
|
|
24
|
+
* Get all short aliases
|
|
21
25
|
*/
|
|
22
|
-
|
|
26
|
+
declare function getAliases(): Record<string, PayloadBoxType>;
|
|
23
27
|
/**
|
|
24
|
-
*
|
|
28
|
+
* Resolve a user-provided name to a canonical PayloadBox type.
|
|
29
|
+
*
|
|
30
|
+
* Accepts:
|
|
31
|
+
* "xss" → "xss"
|
|
32
|
+
* "sqli" → "sql-injection"
|
|
33
|
+
* "sql-injection" → "sql-injection"
|
|
34
|
+
* "cmd" → "command-injection"
|
|
35
|
+
*
|
|
36
|
+
* Returns null if the name doesn't match any known type.
|
|
25
37
|
*/
|
|
26
|
-
declare function
|
|
38
|
+
declare function resolvePayloadType(name: string): PayloadBoxType | null;
|
|
27
39
|
/**
|
|
28
|
-
*
|
|
40
|
+
* Check if a name resolves to a valid PayloadBox type
|
|
41
|
+
*/
|
|
42
|
+
declare function isValidPayloadName(name: string): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Get description for a payload type
|
|
45
|
+
*/
|
|
46
|
+
declare function getDescription(type: PayloadBoxType): string;
|
|
47
|
+
/**
|
|
48
|
+
* Load payloads from PayloadBox.
|
|
29
49
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
50
|
+
* Accepts both canonical names and short aliases:
|
|
51
|
+
* loadPayloadBox("xss") → fetches XSS payloads
|
|
52
|
+
* loadPayloadBox("sqli") → fetches SQL injection payloads
|
|
33
53
|
*/
|
|
34
|
-
declare function loadPayloadBox(
|
|
54
|
+
declare function loadPayloadBox(name: string, limit?: number, fetchFn?: typeof fetch): Promise<RuntimePayload>;
|
|
55
|
+
/**
|
|
56
|
+
* Clear PayloadBox cache
|
|
57
|
+
*/
|
|
58
|
+
declare function clearPayloadBoxCache(): void;
|
|
35
59
|
|
|
36
60
|
/**
|
|
37
61
|
* File Loader
|
|
@@ -51,10 +75,12 @@ declare function loadFromFile(filePath: string): Promise<RuntimePayload[]>;
|
|
|
51
75
|
* @vulcn/plugin-payloads
|
|
52
76
|
* Official payload loader plugin for Vulcn
|
|
53
77
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* -
|
|
57
|
-
*
|
|
78
|
+
* Payload sources (in order of priority):
|
|
79
|
+
* 1. PayloadBox — community-curated payloads from PayloadsAllTheThings (default)
|
|
80
|
+
* 2. Custom files — expert-provided YAML/JSON payload files
|
|
81
|
+
*
|
|
82
|
+
* Short aliases for payload types:
|
|
83
|
+
* xss, sqli, xxe, cmd, redirect, traversal
|
|
58
84
|
*/
|
|
59
85
|
|
|
60
86
|
/**
|
|
@@ -62,49 +88,32 @@ declare function loadFromFile(filePath: string): Promise<RuntimePayload[]>;
|
|
|
62
88
|
*/
|
|
63
89
|
declare const configSchema: z.ZodObject<{
|
|
64
90
|
/**
|
|
65
|
-
*
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Specific built-in payload names to include (if not all)
|
|
70
|
-
*/
|
|
71
|
-
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
72
|
-
/**
|
|
73
|
-
* Built-in payload names to exclude
|
|
74
|
-
*/
|
|
75
|
-
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
76
|
-
/**
|
|
77
|
-
* PayloadBox types to fetch from PayloadsAllTheThings
|
|
78
|
-
* e.g., ["xss", "sql-injection", "xxe"]
|
|
91
|
+
* Payload types to load from PayloadsAllTheThings.
|
|
92
|
+
* Accepts short aliases: xss, sqli, xxe, cmd, redirect, traversal
|
|
93
|
+
* @example ["xss", "sqli"]
|
|
79
94
|
*/
|
|
80
|
-
|
|
95
|
+
types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
81
96
|
/**
|
|
82
|
-
*
|
|
97
|
+
* Maximum payloads per type (default 50)
|
|
83
98
|
*/
|
|
84
|
-
|
|
99
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
85
100
|
/**
|
|
86
101
|
* Custom payload files to load (YAML/JSON)
|
|
87
102
|
*/
|
|
88
103
|
files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
89
104
|
}, "strip", z.ZodTypeAny, {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
include?: string[] | undefined;
|
|
93
|
-
exclude?: string[] | undefined;
|
|
94
|
-
payloadbox?: string[] | undefined;
|
|
105
|
+
limit: number;
|
|
106
|
+
types?: string[] | undefined;
|
|
95
107
|
files?: string[] | undefined;
|
|
96
108
|
}, {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
exclude?: string[] | undefined;
|
|
100
|
-
payloadbox?: string[] | undefined;
|
|
101
|
-
payloadboxLimit?: number | undefined;
|
|
109
|
+
types?: string[] | undefined;
|
|
110
|
+
limit?: number | undefined;
|
|
102
111
|
files?: string[] | undefined;
|
|
103
112
|
}>;
|
|
104
113
|
type PayloadsPluginConfig = z.infer<typeof configSchema>;
|
|
105
114
|
/**
|
|
106
|
-
* Payloads Plugin
|
|
115
|
+
* Payloads Plugin
|
|
107
116
|
*/
|
|
108
117
|
declare const plugin: VulcnPlugin;
|
|
109
118
|
|
|
110
|
-
export {
|
|
119
|
+
export { type PayloadsPluginConfig, clearPayloadBoxCache, plugin as default, getAliases, getDescription, getPayloadBoxTypes, isValidPayloadName, loadFromFile, loadFromFiles, loadPayloadBox, resolvePayloadType };
|