memshell-party-cli 0.1.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 memshell-party-cli contributors
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,167 @@
1
+ # memshell-party-cli
2
+
3
+ Command-line client **and** MCP server for [MemShellParty](https://party.mem.mk) — generate Java
4
+ memory shells and probe shells straight from your terminal (or from an AI agent), talking to the
5
+ same HTTP API that powers `party.mem.mk/ui`.
6
+
7
+ > ⚠️ For authorized security testing, red-team engagements, and research only. You are responsible
8
+ > for how you use it.
9
+
10
+ ## Features
11
+
12
+ - **Interactive wizard** — run `memparty gen` with no flags and pick server / tool / type / packer
13
+ from live, API-driven menus.
14
+ - **Fully scriptable** — every option is also a flag, so generation is reproducible in CI or scripts.
15
+ - **MCP server** — `memparty mcp` exposes generation and config as tools for Claude and other MCP clients.
16
+ - **All endpoints** — memshell generate, probe generate, config listing, class-name parsing, version.
17
+ - **Flexible output** — payload to stdout by default, or `-o file` (auto base64-decodes `.class`/`.jar`).
18
+ - **Any backend** — defaults to the public site, override to your self-hosted instance.
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ npm install -g memshell-party-cli
24
+ # or run without installing:
25
+ npx memshell-party-cli gen
26
+ ```
27
+
28
+ Requires Node.js >= 18.
29
+
30
+ ## Choosing the backend
31
+
32
+ By priority: `--api` flag → `MEMPARTY_API_URL` env var → `~/.mempartyrc` (`{"apiUrl": "..."}`) →
33
+ default `https://party.mem.mk`.
34
+
35
+ Self-hosting is recommended (see the MemShellParty README for the Docker one-liner):
36
+
37
+ ```bash
38
+ memparty --api http://127.0.0.1:8080 gen
39
+ # or
40
+ export MEMPARTY_API_URL=http://127.0.0.1:8080
41
+ ```
42
+
43
+ ## Usage
44
+
45
+ ### Interactive
46
+
47
+ ```bash
48
+ memparty gen # wizard for a memory shell
49
+ memparty probe # wizard for a probe shell
50
+ ```
51
+
52
+ The wizard launches automatically when required flags are missing and you're in a terminal.
53
+ Force it anytime with `-i`, or disable it with `--no-interactive`.
54
+
55
+ ### Scripted generation
56
+
57
+ ```bash
58
+ # Godzilla listener for Tomcat, single Base64 payload to stdout
59
+ memparty gen -s Tomcat -t Godzilla -y Listener -p DefaultBase64 \
60
+ --godzilla-pass pass --godzilla-key key --jdk java8
61
+
62
+ # Write a decoded .class file (base64 decoding is automatic for .class/.jar)
63
+ memparty gen -s Tomcat -t Godzilla -y Listener -p DefaultBase64 \
64
+ --godzilla-pass pass --godzilla-key key -o shell.class
65
+
66
+ # Command shell with an explicit encryptor
67
+ memparty gen -s Tomcat -t Command -y Filter -p DefaultBase64 \
68
+ --command-param-name cmd --encryptor RAW --implementation-class RuntimeExec
69
+
70
+ # Full JSON response (metadata + payload) for further processing
71
+ memparty gen -s Tomcat -t Godzilla -y Listener -p DefaultBase64 --json
72
+ ```
73
+
74
+ `--jdk` accepts `java6/8/9/11/17/21`, a bare number (`8`), or a raw class-file major version (`52`).
75
+
76
+ Note: some packers (e.g. `Base64`) are *aggregate* packers and return several variants at once;
77
+ pick a leaf packer (e.g. `DefaultBase64`, `GzipBase64`) for a single payload.
78
+
79
+ ### Discovering options
80
+
81
+ ```bash
82
+ memparty config servers # servers and their shell types
83
+ memparty config tools Tomcat # tools + types for one server
84
+ memparty config packers # packer parent/child tree
85
+ memparty config command # Command encryptors & implementation classes
86
+ memparty config servers --json # machine-readable
87
+ ```
88
+
89
+ ### Probe shells
90
+
91
+ ```bash
92
+ memparty probe -m ResponseBody -c Command -p DefaultBase64 --server Tomcat --req-param-name cmd
93
+ memparty probe -m Sleep -c Server -p DefaultBase64 --sleep-server Tomcat --seconds 5
94
+ ```
95
+
96
+ ### Parse a class name
97
+
98
+ ```bash
99
+ memparty parse-classname --file shell.class
100
+ memparty parse-classname <base64-of-class-bytes>
101
+ ```
102
+
103
+ ### Version
104
+
105
+ ```bash
106
+ memparty version # CLI version + backend server version
107
+ ```
108
+
109
+ ## MCP server
110
+
111
+ Run the CLI as an MCP server over stdio:
112
+
113
+ ```bash
114
+ memparty mcp --api http://127.0.0.1:8080
115
+ ```
116
+
117
+ Example Claude Code / Claude Desktop config:
118
+
119
+ ```json
120
+ {
121
+ "mcpServers": {
122
+ "memshell-party": {
123
+ "command": "npx",
124
+ "args": ["-y", "memshell-party-cli", "mcp"],
125
+ "env": { "MEMPARTY_API_URL": "http://127.0.0.1:8080" }
126
+ }
127
+ }
128
+ }
129
+ ```
130
+
131
+ Exposed tools: `list_servers`, `list_config`, `list_packers`, `list_command_configs`,
132
+ `generate_memshell`, `generate_probe`, `parse_classname`, `server_version`.
133
+
134
+ ## Programmatic use
135
+
136
+ The package also ships a typed API client:
137
+
138
+ ```ts
139
+ import { MemPartyClient, buildMemShellRequest } from "memshell-party-cli";
140
+
141
+ const client = new MemPartyClient({ baseUrl: "http://127.0.0.1:8080" });
142
+ const res = await client.generateMemShell(
143
+ buildMemShellRequest({
144
+ server: "Tomcat",
145
+ shellTool: "Godzilla",
146
+ shellType: "Listener",
147
+ packer: "DefaultBase64",
148
+ godzillaPass: "pass",
149
+ godzillaKey: "key",
150
+ jdk: "java8",
151
+ }),
152
+ );
153
+ console.log(res.memShellResult.shellClassName, res.packResult);
154
+ ```
155
+
156
+ ## Development
157
+
158
+ ```bash
159
+ npm install
160
+ npm run build # tsup -> dist/
161
+ npm test # vitest
162
+ npm run typecheck # tsc --noEmit
163
+ ```
164
+
165
+ ## License
166
+
167
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export { }