riciplay-miniproxy 0.4.0 → 0.6.2
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 +175 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ Ships the **v4 capture engine** (the same addon the Riciplay CLI embeds):
|
|
|
10
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
11
|
- **Repeater** — pick a logged request, edit method/headers/body, resend, inspect.
|
|
12
12
|
- **Intruder** — mark parameters with `§param§` placeholders, supply a wordlist, fuzz every position; results highlighted by status code and stored in the DB.
|
|
13
|
+
- **TUI** — a full terminal UI (`miniproxy tui`, built with [Textual](https://textual.textualize.io)): live capture feed, master–detail inspection, filters, Repeater, Intruder results, and proxy control — no browser needed.
|
|
14
|
+
- **Connect any browser** — the dashboard's **Connect** tab serves a PAC file, the CA cert, and a QR code so your browser (on any OS/device, including over SSH to a VPS) can route itself through MiniProxy.
|
|
13
15
|
|
|
14
16
|
## Install
|
|
15
17
|
|
|
@@ -26,12 +28,39 @@ Requires Python 3.10+ and [mitmproxy](https://mitmproxy.org/).
|
|
|
26
28
|
## Quick start
|
|
27
29
|
|
|
28
30
|
```bash
|
|
29
|
-
miniproxy start # proxy on :8080
|
|
31
|
+
miniproxy start # proxy on :8080 + web UI on :5000 (URL is printed)
|
|
32
|
+
miniproxy start --port auto # pick any free port (busy ports also move up automatically)
|
|
30
33
|
miniproxy start --scope '*.target.com' # capture only in-scope traffic
|
|
31
|
-
miniproxy
|
|
34
|
+
miniproxy tui # terminal UI (live feed, repeater, filters)
|
|
35
|
+
miniproxy dashboard # web UI in the foreground (Log/Repeater/Intruder)
|
|
36
|
+
miniproxy stop # stop proxy + dashboard
|
|
32
37
|
```
|
|
33
38
|
|
|
34
|
-
Then point your browser/system at `http://127.0.0.1:8080` (HTTPS interception uses mitmproxy's CA — run `mitmdump` once
|
|
39
|
+
Then point your browser/system at `http://127.0.0.1:8080` — the dashboard's **Connect** tab (`/connect`) prints the exact settings, a one-click PAC URL, the CA download, and a QR code. HTTPS interception uses mitmproxy's CA — install it from the Connect tab or run `mitmdump` once (`~/.mitmproxy/mitmproxy-ca-cert.pem`). Capture is always on while the proxy runs; the web UI and TUI are just windows onto the same capture DB. Running the proxy on a VPS or another machine? See [docs/connect.md](docs/connect.md).
|
|
40
|
+
|
|
41
|
+
### Capturing from another machine
|
|
42
|
+
|
|
43
|
+
Since 0.6.0 the proxy binds `127.0.0.1` only, so it is **not** reachable from
|
|
44
|
+
other machines until you say so. Forward the port over SSH instead — the
|
|
45
|
+
proxy never needs a public address:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# on the client (laptop/phone), then point the browser at 127.0.0.1:8080
|
|
49
|
+
ssh -N -L 8080:127.0.0.1:8080 user@your-host
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
To publish the proxy on a LAN/VPS interface instead, bind it explicitly and
|
|
53
|
+
restrict who may connect:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
miniproxy start --proxy-host 0.0.0.0 --allow-client 203.0.113.7
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`--allow-client` is repeatable. Without it, a published proxy is an open
|
|
60
|
+
relay: anything that can reach the port can capture through it and write to
|
|
61
|
+
your database.
|
|
62
|
+
|
|
63
|
+
📚 **Full documentation in [`docs/`](docs/index.md)** — [setup](docs/setup.md) · [CLI & TUI](docs/cli-and-tui.md) · [web UI](docs/web-ui.md) · [connect browsers & devices](docs/connect.md) · [integrations](docs/integrations.md) · [troubleshooting](docs/troubleshooting.md) · [code audit](docs/AUDIT.md).
|
|
35
64
|
|
|
36
65
|
```bash
|
|
37
66
|
miniproxy log # recent captured requests (with timing; reads the DB directly)
|
|
@@ -45,14 +74,136 @@ miniproxy stop
|
|
|
45
74
|
|
|
46
75
|
State (pid, port, default capture DB) lives under `~/.miniproxy/`.
|
|
47
76
|
|
|
77
|
+
### Quieting browser noise
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
miniproxy noise list # rules and their state
|
|
81
|
+
miniproxy noise enable # opt into the bundled telemetry/ad list
|
|
82
|
+
miniproxy noise add '*.telemetry.example.com'
|
|
83
|
+
miniproxy noise disable youtube.com # just this one
|
|
84
|
+
miniproxy noise rm youtube.com
|
|
85
|
+
|
|
86
|
+
miniproxy noise scan # dry run: what would go, by host
|
|
87
|
+
miniproxy noise clean # refuses without --yes
|
|
88
|
+
miniproxy noise clean --yes --keep-host target.example
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Enabled rules make matching hosts skip the capture **entirely** — the traffic
|
|
92
|
+
is still proxied, it just never reaches the DB. `clean` writes a timestamped
|
|
93
|
+
`.noise-backup-<date>.db` snapshot first (via SQLite's backup API) and reports
|
|
94
|
+
its path, so a misjudged rule is always recoverable. Works with no dashboard
|
|
95
|
+
and no proxy running. Full model: [docs/web-ui.md](docs/web-ui.md#noise--the-browser-noise-problem).
|
|
96
|
+
|
|
97
|
+
## The TUI
|
|
98
|
+
|
|
99
|
+
`miniproxy tui` opens a two-pane terminal dashboard over the same SQLite capture DB the dashboard uses (it does not need the dashboard — or even the proxy — running):
|
|
100
|
+
|
|
101
|
+
- **Left** — the live capture table (ID, method, status, latency, URL), polling every 2s (`--refresh` to tune).
|
|
102
|
+
- **Right** — tabbed detail panes for the selected request: Request (line, headers, body), Response (headers, body), Intruder results.
|
|
103
|
+
- **Filters** — method, status class (2xx/3xx/4xx/5xx/errors/pending), and URL substring, all applied live.
|
|
104
|
+
- **Proxy bar** — current proxy state; `p` starts/stops it without leaving the app.
|
|
105
|
+
- Selection survives refreshes, `c` copies the request as a ready-to-run curl command, `y` copies the response body.
|
|
106
|
+
|
|
107
|
+
Keys: `r` Repeater · `i` Intruder · `c` copy curl · `y` copy body · `p` proxy · `R` refresh · `f/t/s` focus URL/method/status filter · `j/k` + `g/G` navigate · `?` help · `q` quit.
|
|
108
|
+
|
|
109
|
+
## Capturing traffic from the terminal (no browser needed)
|
|
110
|
+
|
|
111
|
+
You do **not** need a browser in your terminal. A proxy is just a middleman: any HTTP client that points at `127.0.0.1:8080` appears in the capture — browser or not.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# pane 1
|
|
115
|
+
miniproxy start
|
|
116
|
+
miniproxy tui
|
|
117
|
+
|
|
118
|
+
# pane 2 — point any client at the proxy
|
|
119
|
+
export https_proxy=http://127.0.0.1:8080 http_proxy=http://127.0.0.1:8080
|
|
120
|
+
curl https://api.github.com/zen # shows up in the TUI immediately
|
|
121
|
+
pip install requests # same
|
|
122
|
+
HTTPS_PROXY=$https_proxy npm ping # same
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Plain HTTP works with zero setup. For **HTTPS**, the client must trust mitmproxy's CA (exactly like a browser would):
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
export REQUESTS_CA_BUNDLE=~/.mitmproxy/mitmproxy-ca-cert.pem # python/requests/pip
|
|
129
|
+
export NODE_EXTRA_CA_CERTS=~/.mitmproxy/mitmproxy-ca-cert.pem # node/npm
|
|
130
|
+
curl --cacert ~/.mitmproxy/mitmproxy-ca-cert.pem https://example.com
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Tools that ignore proxy env vars can usually be pointed explicitly (`curl -x`, `git config http.proxy`, `pip --proxy`). And when *your own browser* is the client, nothing changes: point it at the proxy as usual and keep the TUI open beside it — both views read the same DB in real time.
|
|
134
|
+
|
|
48
135
|
## The dashboard
|
|
49
136
|
|
|
50
137
|
`miniproxy dashboard` serves a dark-theme SPA:
|
|
51
138
|
|
|
52
|
-
- **
|
|
53
|
-
- **Log** —
|
|
139
|
+
- **Live** — capture status, live request feed; click any row for full headers/bodies/timing
|
|
140
|
+
- **Log** — the complete request history
|
|
54
141
|
- **Repeater** — edit and resend any captured request
|
|
55
142
|
- **Intruder** — `§param§` placeholders + wordlist fuzzing, results by status code
|
|
143
|
+
- **Connect** — PAC URL, CA download, QR code, and step-by-step settings for connecting any browser/device (including remotely)
|
|
144
|
+
|
|
145
|
+
### Built for scanning, and for a phone
|
|
146
|
+
|
|
147
|
+
- **Host + Path columns** — the URL is split so you read endpoints, not the same host 200 times.
|
|
148
|
+
- **Resizable / collapsible panes** — drag the divider, click it to hide the detail pane. Remembered across refreshes.
|
|
149
|
+
- **Highlight + notes** — an 8-colour Burp-style palette per row (tap the **⋮** button — a real touch target, no right-click needed) and free-text notes. Stored with the capture, so they survive restarts.
|
|
150
|
+
- **Pretty / Raw / Hex** — every body, both request and response. JSON re-indented, bytes escaped, or a full hex dump with offsets and an ASCII gutter.
|
|
151
|
+
- **Host focus + Hide static** — one tap to narrow to your target, or drop images/fonts/css/js.
|
|
152
|
+
- **Noise control** — see below.
|
|
153
|
+
|
|
154
|
+
Captures persist across refreshes and restarts until you click
|
|
155
|
+
**Clear all captures…**.
|
|
156
|
+
|
|
157
|
+
## Browser noise (the thing that ruins a capture)
|
|
158
|
+
|
|
159
|
+
A browser session drags in telemetry pings, ad beacons, new-tab thumbnails
|
|
160
|
+
and fonts. On a real Web Security Academy run: **119 captured rows, 12 on
|
|
161
|
+
target**. MiniProxy fights this in three layers, so you can go back to
|
|
162
|
+
reading the requests.
|
|
163
|
+
|
|
164
|
+
1. **Capture time** — enable noise rules and matching hosts never reach the DB
|
|
165
|
+
at all (traffic is still proxied). A bundled list of known telemetry/ad
|
|
166
|
+
hosts ships *disabled*, so nothing is dropped until you opt in.
|
|
167
|
+
2. **Query time** — the Host dropdown, the **Hide static** chip, and the
|
|
168
|
+
**Highlighted** chip narrow what's already captured, with a summary showing
|
|
169
|
+
`N shown / M fetched` and naming the noisiest hosts.
|
|
170
|
+
3. **Cleanup time** — `noise scan` previews exactly what would be deleted
|
|
171
|
+
(broken down by host) and `noise clean` applies it. Both the CLI and the
|
|
172
|
+
dashboard's **Noise…** button **refuse to delete without confirmation**,
|
|
173
|
+
write a timestamped `.noise-backup-<date>.db` first, and can protect hosts
|
|
174
|
+
you name.
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
miniproxy noise list # rules and their state
|
|
178
|
+
miniproxy noise enable # opt into the bundled telemetry/ad list
|
|
179
|
+
miniproxy noise add '*.telemetry.example.com'
|
|
180
|
+
miniproxy noise scan # dry run — never deletes
|
|
181
|
+
miniproxy noise clean # refuses without --yes
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Connecting a browser (yours, a phone, or anywhere)
|
|
185
|
+
|
|
186
|
+
You don't need a browser in your terminal — you need the browser to send its
|
|
187
|
+
traffic *through* the proxy:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
miniproxy connect # prints the exact settings + a scannable QR
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
or open the dashboard's **Connect** tab (`http://127.0.0.1:5000/connect`):
|
|
194
|
+
one-click PAC URL, CA download with per-OS steps, `curl -x` one-liners, a
|
|
195
|
+
persistent saved-device registry, and a scannable QR code. The TUI shows the same cheat-sheet on `w`. Running MiniProxy
|
|
196
|
+
on a VPS and pointing your laptop/phone at it from anywhere?
|
|
197
|
+
**[docs/connect.md](docs/connect.md)** covers both the SSH-tunnel and
|
|
198
|
+
public-exposure patterns.
|
|
199
|
+
|
|
200
|
+
## Community & project docs
|
|
201
|
+
|
|
202
|
+
- [Security policy](SECURITY.md) — report vulnerabilities privately; responsible-use rules
|
|
203
|
+
- [Contributing](CONTRIBUTING.md) — dev setup, testing requirements, PR process
|
|
204
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md) — Contributor Covenant
|
|
205
|
+
- [Changelog](CHANGELOG.md) — every release
|
|
206
|
+
- [Examples](examples/) — curl / pip / npm / Python / VPS recipes
|
|
56
207
|
|
|
57
208
|
## Relation to the Riciplay CLI
|
|
58
209
|
|
|
@@ -68,11 +219,28 @@ src/miniproxy/
|
|
|
68
219
|
├── app.py # Flask dashboard (API + UI)
|
|
69
220
|
├── intruder.py # §placeholder§ fuzzing engine
|
|
70
221
|
├── server.py # start/stop/status process manager
|
|
222
|
+
├── tui.py # Textual terminal UI (live feed, repeater, filters)
|
|
71
223
|
└── __main__.py # the `miniproxy` entry point (start/stop/status/
|
|
72
|
-
# dashboard/send/log — log
|
|
73
|
-
# any dashboard running)
|
|
224
|
+
# dashboard/tui/send/log/noise — log, noise, send,
|
|
225
|
+
# and the TUI work without any dashboard running)
|
|
74
226
|
```
|
|
75
227
|
|
|
228
|
+
## Development
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
git clone https://github.com/Zaidux/miniproxy && cd miniproxy
|
|
232
|
+
pip install -e ".[dev]"
|
|
233
|
+
pytest # 300+ tests: db, devices, API, exports, intruder,
|
|
234
|
+
# process mgr, TUI, connect, noise, JS/Python parity,
|
|
235
|
+
# dashboard XSS
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
CI runs the suite on Linux/macOS (Python 3.10/3.12) for every push and PR,
|
|
239
|
+
plus a JS syntax check on the dashboard. The web dashboard binds `127.0.0.1`
|
|
240
|
+
by default; LAN exposure is opt-in via `--dashboard-host 0.0.0.0` (pair it
|
|
241
|
+
with `--dashboard-token` for auth on state-changing endpoints) — see
|
|
242
|
+
[docs/web-ui.md](docs/web-ui.md).
|
|
243
|
+
|
|
76
244
|
## License
|
|
77
245
|
|
|
78
246
|
MIT
|
package/package.json
CHANGED