diff --git a/boot/src/main/java/com/reajason/javaweb/boot/dto/GenerateRequest.java b/boot/src/main/java/com/reajason/javaweb/boot/dto/GenerateRequest.java index 152bc8ae..819c7523 100644 --- a/boot/src/main/java/com/reajason/javaweb/boot/dto/GenerateRequest.java +++ b/boot/src/main/java/com/reajason/javaweb/boot/dto/GenerateRequest.java @@ -20,39 +20,37 @@ public class GenerateRequest { private String shellClassName; private String godzillaPass; private String godzillaKey; - private String godzillaHeaderName; - private String godzillaHeaderValue; private String commandParamName; private String behinderPass; - private String behinderHeaderName; - private String behinderHeaderValue; + private String headerName; + private String headerValue; } public ShellToolConfig parseShellToolConfig() { - if (shellConfig.getShellTool().equals(ShellTool.Godzilla)) { - return GodzillaConfig.builder() + return switch (shellConfig.getShellTool()) { + case Godzilla -> GodzillaConfig.builder() .shellClassName(shellToolConfig.getShellClassName()) .pass(shellToolConfig.getGodzillaPass()) .key(shellToolConfig.getGodzillaKey()) - .headerName(shellToolConfig.getGodzillaHeaderName()) - .headerValue(shellToolConfig.getGodzillaHeaderValue()) + .headerName(shellToolConfig.getHeaderName()) + .headerValue(shellToolConfig.getHeaderValue()) .build(); - } - if (shellConfig.getShellTool().equals(ShellTool.Command)) { - return CommandConfig.builder() + case Behinder -> BehinderConfig.builder() + .shellClassName(shellToolConfig.getShellClassName()) + .pass(shellToolConfig.getBehinderPass()) + .headerName(shellToolConfig.getHeaderName()) + .headerValue(shellToolConfig.getHeaderValue()) + .build(); + case Command -> CommandConfig.builder() .shellClassName(shellToolConfig.getShellClassName()) .paramName(shellToolConfig.getCommandParamName()) .build(); - } - - if (shellConfig.getShellTool().equals(ShellTool.Behinder)) { - return BehinderConfig.builder() + case Suo5 -> Suo5Config.builder() .shellClassName(shellToolConfig.getShellClassName()) - .pass(shellToolConfig.getBehinderPass()) - .headerName(shellToolConfig.getBehinderHeaderName()) - .headerValue(shellToolConfig.getBehinderHeaderValue()) + .headerName(shellToolConfig.getHeaderName()) + .headerValue(shellToolConfig.getHeaderValue()) .build(); - } - throw new UnsupportedOperationException("unknown shell tool " + shellConfig.getShellTool()); + default -> throw new UnsupportedOperationException("unknown shell tool " + shellConfig.getShellTool()); + }; } } \ No newline at end of file diff --git a/web/src/components/main-config-card.tsx b/web/src/components/main-config-card.tsx index c364275c..5fbf3d4a 100644 --- a/web/src/components/main-config-card.tsx +++ b/web/src/components/main-config-card.tsx @@ -246,7 +246,7 @@ export function MainConfigCard({ - + @@ -364,7 +364,7 @@ function BehinderTabContent({ form, shellTypes }: { form: UseFormReturn ( {t("shellToolConfig.headerName")} @@ -374,7 +374,7 @@ function BehinderTabContent({ form, shellTypes }: { form: UseFormReturn ( {t("shellToolConfig.headerValue")} @@ -425,7 +425,7 @@ function GodzillaTabContent({ form, shellTypes }: { form: UseFormReturn ( {t("shellToolConfig.headerName")} @@ -435,7 +435,7 @@ function GodzillaTabContent({ form, shellTypes }: { form: UseFormReturn ( {t("shellToolConfig.headerValue")} @@ -497,17 +497,44 @@ function AntSwordTabContent() { ); } -function Suo5TabContent() { +function Suo5TabContent({ form, shellTypes }: { form: UseFormReturn; shellTypes: Array }) { + const { t } = useTranslation(); return ( - - - -
- WIP -
-
-
-
+ + + + +
+ + +
+
+ ( + + {t("shellToolConfig.headerName")} + + + )} + /> + ( + + {t("shellToolConfig.headerValue")} + + + )} + /> +
+ +
+
+
+
); } diff --git a/web/src/components/shell-result.tsx b/web/src/components/shell-result.tsx index cc3726ad..ea99524f 100644 --- a/web/src/components/shell-result.tsx +++ b/web/src/components/shell-result.tsx @@ -24,6 +24,7 @@ import { CommandShellToolConfig, GenerateResult, GodzillaShellToolConfig, + Suo5ShellToolConfig, } from "@/types/shell.ts"; import { TFunction } from "i18next"; import { CircleHelpIcon, TriangleAlertIcon } from "lucide-react"; @@ -206,6 +207,15 @@ function BasicInfo({ generateResult }: { generateResult?: GenerateResult }) { /> )} + {generateResult?.shellConfig.shellTool === "Suo5" && ( + + + + )} Request Header", + "godzillaPayload": "Payload", + "godzillaEncryptor": "Encryptor", + "behinderPass": "Pass", + "behinderScriptType": "Script Type", + "behinderEncryptType": "Encrypt Type", + "behinderDefaultEncryptType": "Default", + "paramName": "Param Name", + "suo5Header": "AdvanceConfiguration -> Request Header" + }, + "packageConfig": { + "title": "Package Method", + "packer": { + "Base64": "Base64", + "GzipBase64": "GzipBase64", + "BCEL": "BCEL", + "JSP": "JSP", + "Jar": "Jar", + "EL": "EL", + "SpEL": "SpEL", + "OGNL": "OGNL", + "MVEL": "MVEL", + "Freemarker": "Freemarker", + "Velocity": "Velocity", + "Groovy": "Groovy", + "AgentJar": "AgentJar", + "Deserialize": "Deserialize(Only CB4, 1.9.x)", + "ScriptEngine": "ScriptEngine", + "XxlJob": "XXL-JOB Executor", + "JinJava": "JinJava", + "Aviator": "Aviator", + "JXPath": "JXPath", + "JEXL": "JEXL", + "Rhino": "Rhino", + "BeanShell": "BeanShell" + } + }, + "tips": { + "shellToolNotSelected": "Please select a shell tool type first", + "targetServerNotFound": "Target server not found?", + "waitingForGeneration": "// Waiting for generation...", + "targetServerRequest": "Request", + "servletUrlPattern": "Servlet type requires a specific URL Pattern, e.g., /hello_servlet", + "controllerUrlPattern": "ControllerHandler type requires a specific URL Pattern, e.g., /hello_controller", + "handlerUrlPattern": "HandlerMethod/HandlerFunction type requires a specific URL Pattern, e.g., /hello_handler", + "jreTip": "Target JRE version, generally speaking, Java 6 is the default version for maximum compatibility, and Java high versions can load low version bytecode.", + "jreTip2": "In specific cases, such as JDK8 being able to use lambda expressions, and JDK9 and above having module restrictions, a specific version is required.", + "decompileTip": "Decompilation is still under development, so the current only sees the base64 encoding format", + "shellBytesEmpty": "Shell bytes is empty, please generate shell first" + }, + "quickUsage": { + "title": "Quick Usage", + "step1": "Select Target Server", + "step2": "Select Shell Tool, Godzilla, Behinder, etc.", + "step3": "Select Shell Mount Type, Filter, Listener, etc.", + "step4": "Select Packing Method", + "step5": "Click Generate Shell" + }, + "generateResult": { + "basicInfo": "Basic Info", + "usage": "Usage", + "title1": "Generate Result", + "title2": "Shell Class", + "title3": "Injector Class" + }, + "shellNotWork": { + "title": "Shell Not Work ?", + "step1": "1. Try to enable the debug mode, regenerate the memory shell and inject it, check the console or log", + "step2": "2. If an exception stack trace is displayed, or no exception is seen, please take a screenshot of the current generation interface and the exception log, and describe the target environment as much as possible for feedback" + }, + "buttons": { + "generate": "Generate Shell" + }, + "success": { + "generated": "Generation successful" + }, + "errors": { + "generationFailed": "Generation failed, {{error}}" + } +} diff --git a/web/src/i18n/translations.ts b/web/src/i18n/translations.ts index 8ad1743a..62b42318 100644 --- a/web/src/i18n/translations.ts +++ b/web/src/i18n/translations.ts @@ -1,222 +1,10 @@ +import en from "./en.json"; +import zh from "./zh-CN.json"; export const resources = { en: { - translation: { - download: "Downlaod", - feedback: "Feedback", - cancel: "Cancel", - placeholders: { - select: "Please select", - input: "Please input", - }, - configs: { - "main-config": "Main Config", - "package-config": "Package Config", - }, - optional: "(Optional)", - mainConfig: { - server: "Target Server", - jre: "Target JRE Version", - debug: "Debug Mode", - bypassJavaModule: "Bypass Java Module", - shellMountType: "Shell Mount Type", - shellTool: "Shell Tool", - urlPattern: "URL Pattern", - shellClassName: "Shell ClassName", - injectorClassName: "Injector ClassName", - }, - shellToolConfig: { - godzilla: "Godzilla", - behinder: "Behinder", - command: "Command", - customHeader: "Custom Header", - headerName: "Header Name", - headerValue: "Header Value", - pass: "Pass", - key: "Key", - godzillaHeader: "Request Config -> Request Header", - godzillaPayload: "Payload", - godzillaEncryptor: "Encryptor", - behinderPass: "Pass", - behinderScriptType: "Script Type", - behinderEncryptType: "Encrypt Type", - behinderDefaultEncryptType: "Default", - paramName: "Param Name", - }, - packageConfig: { - title: "Package Method", - packer: { - Base64: "Base64", - GzipBase64: "GzipBase64", - BCEL: "BCEL", - JSP: "JSP", - Jar: "Jar", - EL: "EL", - SpEL: "SpEL", - OGNL: "OGNL", - MVEL: "MVEL", - Freemarker: "Freemarker", - Velocity: "Velocity", - Groovy: "Groovy", - AgentJar: "AgentJar", - Deserialize: "Deserialize(Only CB4, 1.9.x)", - ScriptEngine: "ScriptEngine", - XxlJob: "XXL-JOB Executor", - JinJava: "JinJava", - Aviator: "Aviator", - JXPath: "JXPath", - JEXL: "JEXL", - Rhino: "Rhino", - BeanShell: "BeanShell", - }, - }, - tips: { - shellToolNotSelected: "Please select a shell tool type first", - targetServerNotFound: "Target server not found?", - waitingForGeneration: "// Waiting for generation...", - targetServerRequest: "Request", - servletUrlPattern: "Servlet type requires a specific URL Pattern, e.g., /hello_servlet", - controllerUrlPattern: "ControllerHandler type requires a specific URL Pattern, e.g., /hello_controller", - handlerUrlPattern: "HandlerMethod/HandlerFunction type requires a specific URL Pattern, e.g., /hello_handler", - jreTip: - "Target JRE version, generally speaking, Java 6 is the default version for maximum compatibility, and Java high versions can load low version bytecode.", - jreTip2: - "In specific cases, such as JDK8 being able to use lambda expressions, and JDK9 and above having module restrictions, a specific version is required.", - decompileTip: "Decompilation is still under development, so the current only sees the base64 encoding format", - shellBytesEmpty: "Shell bytes is empty, please generate shell first", - }, - quickUsage: { - title: "Quick Usage", - step1: "Select Target Server", - step2: "Select Shell Tool, Godzilla, Behinder, etc.", - step3: "Select Shell Mount Type, Filter, Listener, etc.", - step4: "Select Packing Method", - step5: "Click Generate Shell", - }, - generateResult: { - basicInfo: "Basic Info", - usage: "Usage", - title1: "Generate Result", - title2: "Shell Class", - title3: "Injector Class", - }, - shellNotWork: { - title: "Shell Not Work ?", - step1: "1. Try to enable the debug mode, regenerate the memory shell and inject it, check the console or log", - step2: - "2. If an exception stack trace is displayed, or no exception is seen, please take a screenshot of the current generation interface and the exception log, and describe the target environment as much as possible for feedback", - }, - buttons: { - generate: "Generate Shell", - }, - success: { - generated: "Generation successful", - }, - errors: { - generationFailed: "Generation failed, {{error}}", - }, - }, + translation: en, }, zh: { - translation: { - download: "下载", - feedback: "反馈", - cancel: "取消", - placeholders: { - select: "请选择", - input: "请输入", - }, - configs: { - "main-config": "核心配置", - "package-config": "打包配置", - }, - optional: "(可选)", - mainConfig: { - server: "目标服务", - jre: "目标 JRE 版本", - debug: "调试模式", - bypassJavaModule: "绕过 Java 模块限制", - shellMountType: "内存马挂载类型", - shellTool: "内存马功能", - urlPattern: "请求路径", - shellClassName: "内存马类名", - injectorClassName: "注入器类名", - }, - shellToolConfig: { - godzilla: "哥斯拉", - behinder: "冰蝎", - command: "命令回显", - customHeader: "自定义请求头", - headerName: "请求头键", - headerValue: "请求头值", - pass: "密码", - key: "密钥", - godzillaPayload: "有效载荷", - godzillaEncryptor: "加密器", - godzillaHeader: "请求配置 -> 请求头", - behinderPass: "连接密码", - behinderScriptType: "脚本类型", - behinderEncryptType: "加密类型", - behinderDefaultEncryptType: "默认", - paramName: "请求参数", - }, - packageConfig: { - title: "打包方式", - packer: { - EL: "EL 表达式", - SpEL: "SpEL 表达式", - OGNL: "OGNL 表达式", - MVEL: "MVEL 表达式", - JEXL: "JEXL 表达式", - BeanShell: "BeanShell 表达式", - Aviator: "Aviator 表达式", - JXPath: "JXPath 表达式", - Deserialize: "反序列化(仅支持 CB4, 1.9.x)", - ScriptEngine: "内置脚本引擎", - Rhino: "Rhino 脚本引擎", - }, - }, - tips: { - shellToolNotSelected: "请先选择内存马工具类型", - targetServerNotFound: "找不到目标服务 ?", - targetServerRequest: "请求适配", - waitingForGeneration: "// 等待填写参数生成中...", - servletUrlPattern: "Servlet 类型的需要填写具体的 URL Pattern,例如 /hello_servlet", - controllerUrlPattern: "ControllerHandler 类型的需要填写具体的 URL Pattern,例如 /hello_controller", - handlerUrlPattern: "HandlerMethod/HandlerFunction 类型的需要填写具体的 URL Pattern,例如 /hello_handler", - jreTip: "目标 JRE 版本,一般而言为了最大的兼容性,默认 Java 6 即可,Java 高版本能加载低版本的字节码。", - jreTip2: "特定情况下,例如 JDK8 才能使用 lambda 表达式,JDK9 以上存在模块限制时才需要选择特定的版本。", - decompileTip: "反编译还在开发中,因此当前仅能看到 base64 编码格式", - shellBytesEmpty: "内存马字节码为空,无法下载, 请先生成内存马", - }, - quickUsage: { - title: "快速使用", - step1: "选择目标服务", - step2: "选择内存马功能,Godzilla、Behinder 或者其他", - step3: "选择内存马挂载类型,Filter、Listener 或者其他", - step4: "选择打包方式", - step5: "点击生成内存马", - }, - generateResult: { - basicInfo: "基本信息", - usage: "使用方法", - title1: "生成结果", - title2: "内存马类", - title3: "注入器类", - }, - shellNotWork: { - title: "内存马利用失败 ?", - step1: "1. 尝试开启调试模式,重新生成内存马并注入,查看控制台或日志", - step2: "2. 如果出现异常堆栈信息,或未见异常,请截图当前生成界面以及异常日志,并尽可能描述目标环境进行反馈", - }, - buttons: { - generate: "生成内存马", - }, - success: { - generated: "生成成功", - }, - errors: { - generationFailed: "生成失败,{{error}}", - }, - }, + translation: zh, }, }; diff --git a/web/src/i18n/zh-CN.json b/web/src/i18n/zh-CN.json new file mode 100644 index 00000000..4e126aa7 --- /dev/null +++ b/web/src/i18n/zh-CN.json @@ -0,0 +1,102 @@ +{ + "download": "下载", + "feedback": "反馈", + "cancel": "取消", + "placeholders": { + "select": "请选择", + "input": "请输入" + }, + "configs": { + "main-config": "核心配置", + "package-config": "打包配置" + }, + "optional": "(可选)", + "mainConfig": { + "server": "目标服务", + "jre": "目标 JRE 版本", + "debug": "调试模式", + "bypassJavaModule": "绕过 Java 模块限制", + "shellMountType": "内存马挂载类型", + "shellTool": "内存马功能", + "urlPattern": "请求路径", + "shellClassName": "内存马类名", + "injectorClassName": "注入器类名" + }, + "shellToolConfig": { + "godzilla": "哥斯拉", + "behinder": "冰蝎", + "command": "命令回显", + "customHeader": "自定义请求头", + "headerName": "请求头键", + "headerValue": "请求头值", + "pass": "密码", + "key": "密钥", + "godzillaPayload": "有效载荷", + "godzillaEncryptor": "加密器", + "godzillaHeader": "请求配置 -> 请求头", + "behinderPass": "连接密码", + "behinderScriptType": "脚本类型", + "behinderEncryptType": "加密类型", + "behinderDefaultEncryptType": "默认", + "paramName": "请求参数", + "suo5Header": "高级配置 -> 请求头" + }, + "packageConfig": { + "title": "打包方式", + "packer": { + "EL": "EL 表达式", + "SpEL": "SpEL 表达式", + "OGNL": "OGNL 表达式", + "MVEL": "MVEL 表达式", + "JEXL": "JEXL 表达式", + "BeanShell": "BeanShell 表达式", + "Aviator": "Aviator 表达式", + "JXPath": "JXPath 表达式", + "Deserialize": "反序列化(仅支持 CB4, 1.9.x)", + "ScriptEngine": "内置脚本引擎", + "Rhino": "Rhino 脚本引擎" + } + }, + "tips": { + "shellToolNotSelected": "请先选择内存马工具类型", + "targetServerNotFound": "找不到目标服务 ?", + "targetServerRequest": "请求适配", + "waitingForGeneration": "// 等待填写参数生成中...", + "servletUrlPattern": "Servlet 类型的需要填写具体的 URL Pattern,例如 /hello_servlet", + "controllerUrlPattern": "ControllerHandler 类型的需要填写具体的 URL Pattern,例如 /hello_controller", + "handlerUrlPattern": "HandlerMethod/HandlerFunction 类型的需要填写具体的 URL Pattern,例如 /hello_handler", + "jreTip": "目标 JRE 版本,一般而言为了最大的兼容性,默认 Java 6 即可,Java 高版本能加载低版本的字节码。", + "jreTip2": "特定情况下,例如 JDK8 才能使用 lambda 表达式,JDK9 以上存在模块限制时才需要选择特定的版本。", + "decompileTip": "反编译还在开发中,因此当前仅能看到 base64 编码格式", + "shellBytesEmpty": "内存马字节码为空,无法下载, 请先生成内存马" + }, + "quickUsage": { + "title": "快速使用", + "step1": "选择目标服务", + "step2": "选择内存马功能,Godzilla、Behinder 或者其他", + "step3": "选择内存马挂载类型,Filter、Listener 或者其他", + "step4": "选择打包方式", + "step5": "点击生成内存马" + }, + "generateResult": { + "basicInfo": "基本信息", + "usage": "使用方法", + "title1": "生成结果", + "title2": "内存马类", + "title3": "注入器类" + }, + "shellNotWork": { + "title": "内存马利用失败 ?", + "step1": "1. 尝试开启调试模式,重新生成内存马并注入,查看控制台或日志", + "step2": "2. 如果出现异常堆栈信息,或未见异常,请截图当前生成界面以及异常日志,并尽可能描述目标环境进行反馈" + }, + "buttons": { + "generate": "生成内存马" + }, + "success": { + "generated": "生成成功" + }, + "errors": { + "generationFailed": "生成失败,{{error}}" + } +} diff --git a/web/src/routes/index.tsx b/web/src/routes/index.tsx index b9b98f6e..0249ec51 100644 --- a/web/src/routes/index.tsx +++ b/web/src/routes/index.tsx @@ -42,12 +42,10 @@ function IndexComponent() { urlPattern: "/*", godzillaPass: "pass", godzillaKey: "key", - godzillaHeaderName: "User-Agent", - godzillaHeaderValue: "test", commandParamName: "cmd", behinderPass: "pass", - behinderHeaderName: "User-Agent", - behinderHeaderValue: "test", + headerName: "User-Agent", + headerValue: "test", injectorClassName: "", packingMethod: "Base64", }, diff --git a/web/src/types/schema.ts b/web/src/types/schema.ts index f73ae952..136afd3f 100644 --- a/web/src/types/schema.ts +++ b/web/src/types/schema.ts @@ -11,14 +11,12 @@ export const formSchema = z.object({ urlPattern: z.optional(z.string()), godzillaPass: z.optional(z.string()), godzillaKey: z.optional(z.string()), - godzillaHeaderName: z.optional(z.string()), - godzillaHeaderValue: z.optional(z.string()), behinderPass: z.optional(z.string()), - behinderHeaderName: z.optional(z.string()), - behinderHeaderValue: z.optional(z.string()), commandParamName: z.optional(z.string()), + headerName: z.optional(z.string()), + headerValue: z.optional(z.string()), injectorClassName: z.optional(z.string()), - packingMethod: z.string().min(1, { message: "请选择打包方式" }), + packingMethod: z.string().min(1), }); export type FormSchema = z.infer; diff --git a/web/src/types/shell.ts b/web/src/types/shell.ts index 3886a80a..a9e448e9 100644 --- a/web/src/types/shell.ts +++ b/web/src/types/shell.ts @@ -12,12 +12,10 @@ export interface ShellToolConfig { shellClassName?: string; godzillaPass?: string; godzillaKey?: string; - godzillaHeaderName?: string; - godzillaHeaderValue?: string; commandParamName?: string; behinderPass?: string; - behinderHeaderName?: string; - behinderHeaderValue?: string; + headerName?: string; + headerValue?: string; } export interface CommandShellToolConfig { @@ -40,6 +38,12 @@ export interface BehinderShellToolConfig { headerValue?: string; } +export interface Suo5ShellToolConfig { + shellClassName?: string; + headerName?: string; + headerValue?: string; +} + export interface InjectorConfig { className?: string; classInheritance?: string; diff --git a/web/src/utils/transformer.ts b/web/src/utils/transformer.ts index ddeb85a8..20d26dc9 100644 --- a/web/src/utils/transformer.ts +++ b/web/src/utils/transformer.ts @@ -14,12 +14,10 @@ export function transformToPostData(formValue: FormSchema) { shellClassName: formValue.shellClassName, godzillaPass: formValue.godzillaPass, godzillaKey: formValue.godzillaKey, - godzillaHeaderName: formValue.godzillaHeaderName, - godzillaHeaderValue: formValue.godzillaHeaderValue, commandParamName: formValue.commandParamName, behinderPass: formValue.behinderPass, - behinderHeaderName: formValue.behinderHeaderName, - behinderHeaderValue: formValue.behinderHeaderValue, + headerName: formValue.headerName, + headerValue: formValue.headerValue, }; const injectorConfig: InjectorConfig = {