riciplay-miniproxy 0.4.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zaidux
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 ADDED
@@ -0,0 +1,78 @@
1
+ # MiniProxy
2
+
3
+ A lightweight HTTP/S interception proxy for security research — the standalone Burp-style toolkit from the [Riciplay](https://github.com/Zaidux/Riciplay) ecosystem. Built on **mitmproxy**, **Flask**, and **SQLite**.
4
+
5
+ Ships the **v4 capture engine** (the same addon the Riciplay CLI embeds):
6
+
7
+ - **Always-on capture** — every request/response is logged with full headers, bodies, and status codes. (The old intercept toggle silently produced empty captures on fresh DBs; it's gone.)
8
+ - **Static-asset streaming** — JS/CSS/images stream through without buffering, so heavy SPAs don't pay a per-flow decode tax.
9
+ - **Timing** — `ttfb_ms` / `total_ms` on every flow. Oracles and timing side-channels need numbers.
10
+ - **Scope guard** — `--scope '*.target.com'` keeps out-of-scope traffic out of your capture DB (or 403-blocks it with `--block-out-of-scope`).
11
+ - **Repeater** — pick a logged request, edit method/headers/body, resend, inspect.
12
+ - **Intruder** — mark parameters with `§param§` placeholders, supply a wordlist, fuzz every position; results highlighted by status code and stored in the DB.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ # Python (PyPI)
18
+ pip install riciplay-miniproxy
19
+
20
+ # or Node (npm — installs the Python package on postinstall)
21
+ npm install -g riciplay-miniproxy
22
+ ```
23
+
24
+ Requires Python 3.10+ and [mitmproxy](https://mitmproxy.org/).
25
+
26
+ ## Quick start
27
+
28
+ ```bash
29
+ miniproxy start # proxy on :8080
30
+ miniproxy start --scope '*.target.com' # capture only in-scope traffic
31
+ miniproxy dashboard # web UI on :5000 (Log/Repeater/Intruder)
32
+ ```
33
+
34
+ Then point your browser/system at `http://127.0.0.1:8080` (HTTPS interception uses mitmproxy's CA — run `mitmdump` once and install `~/.mitmproxy/mitmproxy-ca-cert.pem` if you haven't).
35
+
36
+ ```bash
37
+ miniproxy log # recent captured requests (with timing; reads the DB directly)
38
+ miniproxy log --id 5 # full detail for request #5
39
+ miniproxy send --url https://example.com/api --method POST \
40
+ --headers '{"Content-Type":"application/json"}' \
41
+ --body '{"key":"value"}'
42
+ miniproxy status
43
+ miniproxy stop
44
+ ```
45
+
46
+ State (pid, port, default capture DB) lives under `~/.miniproxy/`.
47
+
48
+ ## The dashboard
49
+
50
+ `miniproxy dashboard` serves a dark-theme SPA:
51
+
52
+ - **Proxy** — capture status and scope
53
+ - **Log** — live request feed; click any row for full headers/bodies/timing
54
+ - **Repeater** — edit and resend any captured request
55
+ - **Intruder** — `§param§` placeholders + wordlist fuzzing, results by status code
56
+
57
+ ## Relation to the Riciplay CLI
58
+
59
+ The Riciplay CLI (`pip install riciplay-cli`) embeds this same engine with agent-first extras: per-session capture DBs, RULES.md-derived scope enforcement, headless replay with response diffing, and bounded payload sweeps driven by the AI agent. Use MiniProxy standalone when you want the manual Burp-like workflow; use Riciplay when you want the agent to drive.
60
+
61
+ ## Project structure
62
+
63
+ ```
64
+ src/miniproxy/
65
+ ├── addon/
66
+ │ ├── proxy.py # mitmproxy addon — v4 capture engine
67
+ │ └── db.py # SQLite handler (timing columns, intruder results, pruning)
68
+ ├── app.py # Flask dashboard (API + UI)
69
+ ├── intruder.py # §placeholder§ fuzzing engine
70
+ ├── server.py # start/stop/status process manager
71
+ └── __main__.py # the `miniproxy` entry point (start/stop/status/
72
+ # dashboard/send/log — log and send work without
73
+ # any dashboard running)
74
+ ```
75
+
76
+ ## License
77
+
78
+ MIT
package/bin/miniproxy ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ // MiniProxy launcher — delegates to the Python package (riciplay-miniproxy).
3
+ //
4
+ // miniproxy <args> → python3 -m miniproxy <args>
5
+ //
6
+ // The Python package is installed by scripts/postinstall.js (pip install
7
+ // riciplay-miniproxy). If python3 is missing the user gets a clear error
8
+ // rather than a silent failure.
9
+
10
+ const { spawn } = require('child_process');
11
+
12
+ const args = process.argv.slice(2);
13
+ const proc = spawn('python3', ['-m', 'miniproxy', ...args], { stdio: 'inherit' });
14
+
15
+ proc.on('error', (err) => {
16
+ if (err.code === 'ENOENT') {
17
+ console.error('Error: python3 not found. MiniProxy is a Python tool — install Python 3.10+ first.');
18
+ process.exit(1);
19
+ }
20
+ console.error('Error:', err.message);
21
+ process.exit(1);
22
+ });
23
+
24
+ proc.on('close', (code) => process.exit(code ?? 1));
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "riciplay-miniproxy",
3
+ "version": "0.4.0",
4
+ "description": "A lightweight HTTP/S interception proxy for security research — always-on capture, timing, scope guard, Repeater + Intruder dashboard",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "miniproxy": "./bin/miniproxy"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1",
11
+ "prepublishOnly": "echo \"Ensure the Python package riciplay-miniproxy is published to PyPI first\"",
12
+ "postinstall": "node scripts/postinstall.js"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/Zaidux/miniproxy.git"
17
+ },
18
+ "keywords": [
19
+ "proxy",
20
+ "mitmproxy",
21
+ "interception",
22
+ "security",
23
+ "bugbounty",
24
+ "repeater",
25
+ "intruder",
26
+ "pentesting"
27
+ ],
28
+ "author": "Zaidux <zaiduabubakar777@gmail.com>",
29
+ "license": "MIT",
30
+ "bugs": {
31
+ "url": "https://github.com/Zaidux/miniproxy/issues"
32
+ },
33
+ "homepage": "https://github.com/Zaidux/miniproxy#readme",
34
+ "engines": {
35
+ "node": ">=14.0.0"
36
+ },
37
+ "os": [
38
+ "darwin",
39
+ "linux"
40
+ ],
41
+ "files": [
42
+ "bin/",
43
+ "scripts/postinstall.js",
44
+ "README.md",
45
+ "LICENSE"
46
+ ],
47
+ "dependencies": {},
48
+ "peerDependencies": {}
49
+ }
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ // MiniProxy npm postinstall — installs the Python package from PyPI.
3
+ //
4
+ // This npm package is a thin launcher; the real implementation is the
5
+ // Python package `riciplay-miniproxy`. If it is not importable, pip
6
+ // install it. Failures are warnings, not errors: the user may be
7
+ // installing without network access or managing Python themselves.
8
+
9
+ const { execSync, spawnSync } = require('child_process');
10
+ const os = require('os');
11
+
12
+ console.log('\n🔌 Installing MiniProxy (HTTP/S interception proxy)...\n');
13
+
14
+ const isWin = os.platform() === 'win32';
15
+ const python = isWin ? 'python' : 'python3';
16
+ const pip = isWin ? 'pip' : 'pip3';
17
+
18
+ function hasCommand(cmd) {
19
+ try {
20
+ execSync(`${cmd} --version`, { stdio: 'ignore' });
21
+ return true;
22
+ } catch {
23
+ return false;
24
+ }
25
+ }
26
+
27
+ try {
28
+ const probe = spawnSync(python, ['-c', 'import miniproxy'], { stdio: 'ignore' });
29
+ if (probe.status === 0) {
30
+ console.log('✓ Python package `miniproxy` already importable.');
31
+ } else {
32
+ console.log('Installing riciplay-miniproxy from PyPI...');
33
+ execSync(`${pip} install --upgrade riciplay-miniproxy`, { stdio: 'inherit' });
34
+ console.log('✓ Installed riciplay-miniproxy.');
35
+ }
36
+ } catch (err) {
37
+ console.warn(
38
+ `\n⚠ Could not install the Python package automatically (${err.message}).\n` +
39
+ ' MiniProxy needs Python 3.10+ and mitmproxy. Install manually with:\n' +
40
+ ' pip install riciplay-miniproxy\n'
41
+ );
42
+ }
43
+
44
+ console.log('\nUsage: miniproxy start --port 8080 # then miniproxy dashboard\n');