mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-25 08:21:52 +08:00
refactor: enhance web ux
This commit is contained in:
Binary file not shown.
+13
-13
@@ -13,21 +13,21 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.9.4",
|
"@biomejs/biome": "1.9.4",
|
||||||
"@tanstack/router-plugin": "^1.93.0",
|
"@tanstack/router-plugin": "^1.97.1",
|
||||||
"@types/node": "^22.10.3",
|
"@types/node": "^22.10.7",
|
||||||
"@types/react": "^19.0.2",
|
"@types/react": "^19.0.7",
|
||||||
"@types/react-dom": "^19.0.2",
|
"@types/react-dom": "^19.0.3",
|
||||||
"@vitejs/plugin-react": "^4.3.4",
|
"@vitejs/plugin-react": "^4.3.4",
|
||||||
"@types/react-copy-to-clipboard": "^5.0.7",
|
"@types/react-copy-to-clipboard": "^5.0.7",
|
||||||
"@types/react-syntax-highlighter": "^15.5.13",
|
"@types/react-syntax-highlighter": "^15.5.13",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"postcss": "^8.4.49",
|
"postcss": "^8.5.1",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "^5.7.2",
|
"typescript": "^5.7.3",
|
||||||
"vite": "^6.0.6"
|
"vite": "^6.0.7"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hookform/resolvers": "^3.9.1",
|
"@hookform/resolvers": "^3.10.0",
|
||||||
"@radix-ui/react-alert-dialog": "^1.1.4",
|
"@radix-ui/react-alert-dialog": "^1.1.4",
|
||||||
"@radix-ui/react-checkbox": "^1.1.3",
|
"@radix-ui/react-checkbox": "^1.1.3",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.1.4",
|
"@radix-ui/react-dropdown-menu": "^2.1.4",
|
||||||
@@ -39,19 +39,19 @@
|
|||||||
"@radix-ui/react-switch": "^1.1.2",
|
"@radix-ui/react-switch": "^1.1.2",
|
||||||
"@radix-ui/react-tabs": "^1.1.2",
|
"@radix-ui/react-tabs": "^1.1.2",
|
||||||
"@radix-ui/react-tooltip": "^1.1.6",
|
"@radix-ui/react-tooltip": "^1.1.6",
|
||||||
"@tanstack/react-query": "^5.62.11",
|
"@tanstack/react-query": "^5.64.1",
|
||||||
"@tanstack/react-router": "^1.93.0",
|
"@tanstack/react-router": "^1.97.1",
|
||||||
"@tanstack/router-devtools": "^1.93.0",
|
"@tanstack/router-devtools": "^1.97.1",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"lucide-react": "^0.469.0",
|
"lucide-react": "^0.473.0",
|
||||||
"next-themes": "^0.4.4",
|
"next-themes": "^0.4.4",
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"react-copy-to-clipboard": "^5.1.0",
|
"react-copy-to-clipboard": "^5.1.0",
|
||||||
"react-dom": "^19.0.0",
|
"react-dom": "^19.0.0",
|
||||||
"react-hook-form": "^7.54.2",
|
"react-hook-form": "^7.54.2",
|
||||||
"react-syntax-highlighter": "^15.6.1",
|
"react-syntax-highlighter": "^15.6.1",
|
||||||
"sonner": "^1.7.1",
|
"sonner": "^1.7.2",
|
||||||
"tailwind-merge": "^2.6.0",
|
"tailwind-merge": "^2.6.0",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"zod": "^3.24.1"
|
"zod": "^3.24.1"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Button, ButtonProps } from "@/components/ui/button.tsx";
|
import { Button, ButtonProps } from "@/components/ui/button.tsx";
|
||||||
import { cn } from "@/lib/utils.ts";
|
import { cn } from "@/lib/utils.ts";
|
||||||
import { CheckIcon, ClipboardIcon } from "lucide-react";
|
import { Check, Copy } from "lucide-react";
|
||||||
import { HTMLProps, useEffect, useState } from "react";
|
import { HTMLProps, useEffect, useState } from "react";
|
||||||
import { CopyToClipboard } from "react-copy-to-clipboard";
|
import { CopyToClipboard } from "react-copy-to-clipboard";
|
||||||
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
|
||||||
@@ -35,11 +35,11 @@ export function CopyButton({ value, className, src, variant = "ghost", ...props
|
|||||||
size="icon"
|
size="icon"
|
||||||
type="button"
|
type="button"
|
||||||
variant={variant}
|
variant={variant}
|
||||||
className={cn("relative z-10 h-6 w-6 text-zinc-50 hover:bg-zinc-700 hover:text-zinc-50", className)}
|
className={cn("relative z-10 h-8 w-8 text-zinc-50 hover:bg-zinc-700 hover:text-zinc-50", className)}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
<span className="sr-only">Copy</span>
|
<span className="sr-only">Copy</span>
|
||||||
{hasCopied ? <CheckIcon /> : <ClipboardIcon />}
|
{hasCopied ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />}
|
||||||
</Button>
|
</Button>
|
||||||
</CopyToClipboard>
|
</CopyToClipboard>
|
||||||
);
|
);
|
||||||
@@ -50,11 +50,13 @@ export function CodeViewer({
|
|||||||
language,
|
language,
|
||||||
showLineNumbers = true,
|
showLineNumbers = true,
|
||||||
wrapLongLines = false,
|
wrapLongLines = false,
|
||||||
|
height = 500,
|
||||||
}: {
|
}: {
|
||||||
code: string;
|
code: string;
|
||||||
language: string;
|
language: string;
|
||||||
showLineNumbers?: boolean;
|
showLineNumbers?: boolean;
|
||||||
wrapLongLines?: boolean;
|
wrapLongLines?: boolean;
|
||||||
|
height?: number;
|
||||||
}) {
|
}) {
|
||||||
const lineProps: lineTagPropsFunction | HTMLProps<HTMLElement> | undefined = wrapLongLines
|
const lineProps: lineTagPropsFunction | HTMLProps<HTMLElement> | undefined = wrapLongLines
|
||||||
? { style: { overflowWrap: "break-word", whiteSpace: "pre-wrap" } }
|
? { style: { overflowWrap: "break-word", whiteSpace: "pre-wrap" } }
|
||||||
@@ -73,7 +75,7 @@ export function CodeViewer({
|
|||||||
paddingRight: showLineNumbers ? 0 : 24,
|
paddingRight: showLineNumbers ? 0 : 24,
|
||||||
paddingLeft: showLineNumbers ? 0 : 24,
|
paddingLeft: showLineNumbers ? 0 : 24,
|
||||||
borderRadius: "var(--radius)",
|
borderRadius: "var(--radius)",
|
||||||
height: 500,
|
height: height,
|
||||||
whiteSpace: wrapLongLines ? "pre-wrap" : "pre",
|
whiteSpace: wrapLongLines ? "pre-wrap" : "pre",
|
||||||
overflowWrap: wrapLongLines ? "normal" : "break-word",
|
overflowWrap: wrapLongLines ? "normal" : "break-word",
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import { toast } from "sonner";
|
|||||||
interface CopyableFieldProps {
|
interface CopyableFieldProps {
|
||||||
label: string;
|
label: string;
|
||||||
value?: string;
|
value?: string;
|
||||||
size?: number;
|
text?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function CopyableField({ label, value, size }: CopyableFieldProps) {
|
export function CopyableField({ label, value, text }: CopyableFieldProps) {
|
||||||
const [copied, setCopied] = useState(false);
|
const [copied, setCopied] = useState(false);
|
||||||
|
|
||||||
const copyToClipboard = useCallback(() => {
|
const copyToClipboard = useCallback(() => {
|
||||||
@@ -27,18 +27,18 @@ export function CopyableField({ label, value, size }: CopyableFieldProps) {
|
|||||||
}, [value, label]);
|
}, [value, label]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between h-9">
|
||||||
<div className="flex items-center space-x-2 text-sm">
|
<div className="flex items-center space-x-2 text-sm">
|
||||||
<Label className="w-24 text-right">{label}:</Label>
|
<Label className="w-32 text-right">{label}:</Label>
|
||||||
<p>
|
<p>{text}</p>
|
||||||
{value} {size != null && `(${size} bytes)`}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<CopyToClipboard text={value as string} onCopy={copyToClipboard}>
|
{value && (
|
||||||
<Button variant="ghost" size="icon" type="button">
|
<CopyToClipboard text={value as string} onCopy={copyToClipboard}>
|
||||||
{copied ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />}
|
<Button variant="ghost" size="icon" type="button">
|
||||||
</Button>
|
{copied ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />}
|
||||||
</CopyToClipboard>
|
</Button>
|
||||||
|
</CopyToClipboard>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
import { UrlPatternTip } from "@/components/tips/url-pattern-tip.tsx";
|
import { UrlPatternTip } from "@/components/tips/url-pattern-tip.tsx";
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card.tsx";
|
|
||||||
import { FormControl, FormDescription, FormField, FormItem, FormLabel } from "@/components/ui/form.tsx";
|
import { FormControl, FormDescription, FormField, FormItem, FormLabel } from "@/components/ui/form.tsx";
|
||||||
import { Input } from "@/components/ui/input.tsx";
|
import { Input } from "@/components/ui/input.tsx";
|
||||||
import { Label } from "@/components/ui/label.tsx";
|
import { Label } from "@/components/ui/label.tsx";
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select.tsx";
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select.tsx";
|
||||||
import { Separator } from "@/components/ui/separator.tsx";
|
|
||||||
import { Switch } from "@/components/ui/switch.tsx";
|
import { Switch } from "@/components/ui/switch.tsx";
|
||||||
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
import { FormSchema } from "@/types/schema.ts";
|
import { FormSchema } from "@/types/schema.ts";
|
||||||
import { MainConfig } from "@/types/shell.ts";
|
import { MainConfig } from "@/types/shell.ts";
|
||||||
import { ServerIcon } from "lucide-react";
|
|
||||||
|
|
||||||
|
import { JreTip } from "@/components/tips/jre-tip.tsx";
|
||||||
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card.tsx";
|
||||||
|
import { cn } from "@/lib/utils.ts";
|
||||||
|
import { ArrowUpRightIcon, ServerIcon } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { FormProvider, UseFormReturn } from "react-hook-form";
|
import { FormProvider, UseFormReturn } from "react-hook-form";
|
||||||
|
|
||||||
@@ -32,14 +34,23 @@ export function MainConfigCard({
|
|||||||
servers?: string[];
|
servers?: string[];
|
||||||
}) {
|
}) {
|
||||||
const [shellToolMap, setShellToolMap] = useState<{ [toolName: string]: string[] }>();
|
const [shellToolMap, setShellToolMap] = useState<{ [toolName: string]: string[] }>();
|
||||||
const [shellTools, setShellTools] = useState<string[]>([]);
|
const [shellTools, setShellTools] = useState<string[]>(["Behinder", "Godzilla", "Command"]);
|
||||||
const [shellTypes, setShellTypes] = useState<string[]>([]);
|
const [shellTypes, setShellTypes] = useState<string[]>([]);
|
||||||
|
const shellTool = form.watch("shellTool");
|
||||||
|
|
||||||
const handleServerChange = (value: string) => {
|
const handleServerChange = (value: string) => {
|
||||||
if (mainConfig) {
|
if (mainConfig) {
|
||||||
setShellToolMap(mainConfig[value]);
|
const newShellToolMap = mainConfig[value];
|
||||||
setShellTools(Object.keys(mainConfig[value]));
|
setShellToolMap(newShellToolMap);
|
||||||
setShellTypes([]);
|
const newShellTools = Object.keys(newShellToolMap);
|
||||||
|
setShellTools(newShellTools);
|
||||||
|
if (newShellTools.length > 0) {
|
||||||
|
const firstTool = newShellTools[0];
|
||||||
|
setShellTypes(newShellToolMap[firstTool]);
|
||||||
|
form.setValue("shellTool", firstTool);
|
||||||
|
} else {
|
||||||
|
setShellTypes([]);
|
||||||
|
}
|
||||||
form.resetField("shellTool");
|
form.resetField("shellTool");
|
||||||
form.resetField("shellType");
|
form.resetField("shellType");
|
||||||
}
|
}
|
||||||
@@ -66,6 +77,9 @@ export function MainConfigCard({
|
|||||||
if (shellToolMap) {
|
if (shellToolMap) {
|
||||||
setShellTypes(shellToolMap[value]);
|
setShellTypes(shellToolMap[value]);
|
||||||
form.resetField("urlPattern");
|
form.resetField("urlPattern");
|
||||||
|
form.resetField("shellType");
|
||||||
|
form.resetField("shellClassName");
|
||||||
|
form.resetField("injectorClassName");
|
||||||
if (value === "Godzilla") {
|
if (value === "Godzilla") {
|
||||||
resetGodzilla();
|
resetGodzilla();
|
||||||
} else if (value === "Behinder") {
|
} else if (value === "Behinder") {
|
||||||
@@ -74,17 +88,18 @@ export function MainConfigCard({
|
|||||||
resetCommand();
|
resetCommand();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
form.setValue("shellTool", value);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="w-full">
|
<FormProvider {...form}>
|
||||||
<CardHeader className="pb-1">
|
<Card>
|
||||||
<CardTitle className="text-md flex items-center gap-2">
|
<CardHeader className="pb-1">
|
||||||
<ServerIcon className="h-5" />
|
<CardTitle className="text-md flex items-center gap-2">
|
||||||
<span>核心配置</span>
|
<ServerIcon className="h-5" />
|
||||||
</CardTitle>
|
<span>生成配置</span>
|
||||||
</CardHeader>
|
</CardTitle>
|
||||||
<FormProvider {...form}>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<div className="grid grid-cols-2 gap-2">
|
<div className="grid grid-cols-2 gap-2">
|
||||||
<FormField
|
<FormField
|
||||||
@@ -113,6 +128,18 @@ export function MainConfigCard({
|
|||||||
))}
|
))}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
|
<FormDescription className="flex items-center">
|
||||||
|
下拉列表找不到目标服务 ?
|
||||||
|
<a
|
||||||
|
href="https://github.com/ReaJason/MemShellParty/issues/new?template=%E8%AF%B7%E6%B1%82%E9%80%82%E9%85%8D.md"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="flex items-center underline"
|
||||||
|
>
|
||||||
|
请求适配
|
||||||
|
<ArrowUpRightIcon className="h-4" />
|
||||||
|
</a>
|
||||||
|
</FormDescription>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
@@ -120,8 +147,10 @@ export function MainConfigCard({
|
|||||||
control={form.control}
|
control={form.control}
|
||||||
name="targetJdkVersion"
|
name="targetJdkVersion"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem className="space-y-1">
|
<FormItem className="flex flex-col mt-1">
|
||||||
<FormLabel>JRE(可选)</FormLabel>
|
<Label className="flex items-center">
|
||||||
|
目标 JRE 版本(可选) <JreTip />
|
||||||
|
</Label>
|
||||||
<Select
|
<Select
|
||||||
onValueChange={(v) => {
|
onValueChange={(v) => {
|
||||||
if (Number.parseInt(v) >= 53) {
|
if (Number.parseInt(v) >= 53) {
|
||||||
@@ -150,7 +179,7 @@ export function MainConfigCard({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center space-x-4 mt-2">
|
<div className="flex gap-4 mt-4">
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="debug"
|
name="debug"
|
||||||
@@ -171,234 +200,252 @@ export function MainConfigCard({
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<Switch id="bypassJavaModule" checked={field.value} onCheckedChange={field.onChange} />
|
<Switch id="bypassJavaModule" checked={field.value} onCheckedChange={field.onChange} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<Label htmlFor="bypassJavaModule">bypassJavaModule</Label>
|
<Label htmlFor="bypassJavaModule">绕过 Java 模块系统限制</Label>
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<div className="flex items-center space-x-2">
|
|
||||||
<Switch id="lambda" disabled />
|
|
||||||
<Label htmlFor="lambda">Lambda 类名 (WIP)</Label>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center space-x-2">
|
|
||||||
<Switch id="obfuscate" disabled />
|
|
||||||
<Label htmlFor="obfuscate">开启混淆 (WIP)</Label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Separator className="mt-4 mb-2" />
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="shellClassName"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem className="space-y-1">
|
|
||||||
<FormLabel>内存马类名(可选)</FormLabel>
|
|
||||||
<Input id="shellClassName" {...field} placeholder="请输入" className="h-8" />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<div className="grid grid-cols-3 gap-2 mt-2">
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="shellTool"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem className="space-y-1">
|
|
||||||
<FormLabel>内存马工具类型</FormLabel>
|
|
||||||
<Select
|
|
||||||
value={field.value}
|
|
||||||
onValueChange={(value: string) => {
|
|
||||||
field.onChange(value);
|
|
||||||
handleShellToolChange(value);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<FormControl>
|
|
||||||
<SelectTrigger className="h-8">
|
|
||||||
<SelectValue placeholder="请选择" />
|
|
||||||
</SelectTrigger>
|
|
||||||
</FormControl>
|
|
||||||
<SelectContent>
|
|
||||||
{shellTools.length ? (
|
|
||||||
shellTools.map((v) => (
|
|
||||||
<SelectItem key={v} value={v}>
|
|
||||||
{v}
|
|
||||||
</SelectItem>
|
|
||||||
))
|
|
||||||
) : (
|
|
||||||
<SelectItem value=" ">请先选择目标服务</SelectItem>
|
|
||||||
)}
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="shellType"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem className="space-y-1">
|
|
||||||
<FormLabel>内存马挂载类型</FormLabel>
|
|
||||||
<Select onValueChange={field.onChange} value={field.value}>
|
|
||||||
<FormControl>
|
|
||||||
<SelectTrigger className="h-8">
|
|
||||||
<SelectValue placeholder="请选择" />
|
|
||||||
</SelectTrigger>
|
|
||||||
</FormControl>
|
|
||||||
<SelectContent>
|
|
||||||
{shellTypes.length ? (
|
|
||||||
shellTypes.map((v) => (
|
|
||||||
<SelectItem key={v} value={v}>
|
|
||||||
{v}
|
|
||||||
</SelectItem>
|
|
||||||
))
|
|
||||||
) : (
|
|
||||||
<SelectItem value=" ">请先选择内存马工具类型</SelectItem>
|
|
||||||
)}
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="urlPattern"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem className="flex flex-col mt-1">
|
|
||||||
<Label className="flex items-center">
|
|
||||||
请求路径 <UrlPatternTip />
|
|
||||||
</Label>
|
|
||||||
<Input {...field} placeholder="请输入" className="h-8" />
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-2">
|
</CardContent>
|
||||||
{form.getValues().shellTool === "Godzilla" && (
|
</Card>
|
||||||
<div className="space-y-1">
|
<Tabs
|
||||||
<Label>Godzilla 配置</Label>
|
value={shellTool}
|
||||||
<div className="grid grid-cols-2 gap-2">
|
onValueChange={(v) => {
|
||||||
<FormField
|
handleShellToolChange(v);
|
||||||
control={form.control}
|
}}
|
||||||
name="godzillaPass"
|
className="w-full"
|
||||||
render={({ field }) => (
|
>
|
||||||
<FormItem className="space-y-1 flex items-center justify-start">
|
<TabsList className={cn("grid w-full", `grid-cols-${shellTools.length}`)}>
|
||||||
<Label className="text-xs whitespace-nowrap w-1/2">密码:</Label>
|
{shellTools.map((shellTool) => (
|
||||||
<Input {...field} placeholder="Pass" className="h-8" />
|
<TabsTrigger key={shellTool} value={shellTool}>
|
||||||
</FormItem>
|
{shellTool}
|
||||||
)}
|
</TabsTrigger>
|
||||||
/>
|
))}
|
||||||
<FormField
|
</TabsList>
|
||||||
control={form.control}
|
<BehinderTabContent form={form} shellTypes={shellTypes} />
|
||||||
name="godzillaKey"
|
<GodzillaTabContent form={form} shellTypes={shellTypes} />
|
||||||
render={({ field }) => (
|
<CommandTabContent form={form} shellTypes={shellTypes} />
|
||||||
<FormItem className="space-y-1 flex items-center justify-start">
|
</Tabs>
|
||||||
<Label className="text-xs whitespace-nowrap w-1/2">密钥:</Label>
|
</FormProvider>
|
||||||
<Input {...field} placeholder="Key" className="h-8" />
|
);
|
||||||
</FormItem>
|
}
|
||||||
)}
|
|
||||||
/>
|
function ShellTypeFormField({ form, shellTypes }: { form: UseFormReturn<FormSchema>; shellTypes: Array<string> }) {
|
||||||
<FormField
|
return (
|
||||||
control={form.control}
|
<FormProvider {...form}>
|
||||||
name="godzillaHeaderName"
|
<FormField
|
||||||
render={({ field }) => (
|
control={form.control}
|
||||||
<FormItem className="space-y-1 flex items-center justify-start">
|
name="shellType"
|
||||||
<Label className="text-xs whitespace-nowrap w-1/2">请求头键:</Label>
|
render={({ field }) => (
|
||||||
<Input {...field} placeholder="Header Name" className="h-8" />
|
<FormItem className="space-y-1">
|
||||||
</FormItem>
|
<FormLabel>内存马挂载类型</FormLabel>
|
||||||
)}
|
<Select onValueChange={field.onChange} value={field.value}>
|
||||||
/>
|
<FormControl>
|
||||||
<FormField
|
<SelectTrigger className="h-8">
|
||||||
control={form.control}
|
<SelectValue placeholder="请选择" />
|
||||||
name="godzillaHeaderValue"
|
</SelectTrigger>
|
||||||
render={({ field }) => (
|
</FormControl>
|
||||||
<FormItem className="space-y-1 flex items-center justify-start">
|
<SelectContent key={shellTypes.join(",")}>
|
||||||
<Label className="text-xs whitespace-nowrap w-1/2">请求头值:</Label>
|
{shellTypes.length ? (
|
||||||
<Input {...field} placeholder="Header Value" className="h-8" />
|
shellTypes.map((v) => (
|
||||||
</FormItem>
|
<SelectItem key={v} value={v}>
|
||||||
)}
|
{v}
|
||||||
/>
|
</SelectItem>
|
||||||
</div>
|
))
|
||||||
</div>
|
) : (
|
||||||
)}
|
<SelectItem value=" ">请先选择内存马工具类型</SelectItem>
|
||||||
{form.getValues().shellTool === "Behinder" && (
|
)}
|
||||||
<div className="space-y-1">
|
</SelectContent>
|
||||||
<Label>Behinder 配置</Label>
|
</Select>
|
||||||
<div className="grid grid-cols-2 gap-2">
|
</FormItem>
|
||||||
<FormField
|
)}
|
||||||
control={form.control}
|
/>
|
||||||
name="behinderPass"
|
</FormProvider>
|
||||||
render={({ field }) => (
|
);
|
||||||
<FormItem className="space-y-1 flex items-center justify-start">
|
}
|
||||||
<Label className="text-xs whitespace-nowrap w-1/2">密码:</Label>
|
|
||||||
<Input {...field} placeholder="Pass" className="h-8" />
|
function UrlPatternFormField({ form }: { form: UseFormReturn<FormSchema> }) {
|
||||||
</FormItem>
|
return (
|
||||||
)}
|
<FormProvider {...form}>
|
||||||
/>
|
<FormField
|
||||||
<FormField
|
control={form.control}
|
||||||
control={form.control}
|
name="urlPattern"
|
||||||
name="behinderHeaderName"
|
render={({ field }) => (
|
||||||
render={({ field }) => (
|
<FormItem className="flex flex-col mt-1">
|
||||||
<FormItem className="space-y-1 flex items-center justify-start">
|
<Label className="flex items-center">
|
||||||
<Label className="text-xs whitespace-nowrap w-1/2">请求头键:</Label>
|
请求路径 <UrlPatternTip />
|
||||||
<Input {...field} placeholder="Header Name" className="h-8" />
|
</Label>
|
||||||
</FormItem>
|
<Input {...field} placeholder="请输入" className="h-8" />
|
||||||
)}
|
</FormItem>
|
||||||
/>
|
)}
|
||||||
<FormField
|
/>
|
||||||
control={form.control}
|
</FormProvider>
|
||||||
name="behinderHeaderValue"
|
);
|
||||||
render={({ field }) => (
|
}
|
||||||
<FormItem className="space-y-1 flex items-center justify-start">
|
|
||||||
<Label className="text-xs whitespace-nowrap w-1/2">请求头值:</Label>
|
function OptionalClassFormField({ form }: { form: UseFormReturn<FormSchema> }) {
|
||||||
<Input {...field} placeholder="Header Value" className="h-8" />
|
return (
|
||||||
</FormItem>
|
<FormProvider {...form}>
|
||||||
)}
|
<FormField
|
||||||
/>
|
control={form.control}
|
||||||
</div>
|
name="shellClassName"
|
||||||
</div>
|
render={({ field }) => (
|
||||||
)}
|
<FormItem className="space-y-1">
|
||||||
{form.getValues().shellTool === "Command" && (
|
<FormLabel>内存马类名(可选)</FormLabel>
|
||||||
|
<Input id="shellClassName" {...field} placeholder="请输入" className="h-8" />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="injectorClassName"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className="space-y-1">
|
||||||
|
<FormLabel>注入器类名(可选)</FormLabel>
|
||||||
|
<Input id="injectorClassName" {...field} placeholder="请输入" className="h-8" />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</FormProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function BehinderTabContent({ form, shellTypes }: { form: UseFormReturn<FormSchema>; shellTypes: Array<string> }) {
|
||||||
|
return (
|
||||||
|
<FormProvider {...form}>
|
||||||
|
<TabsContent value="Behinder">
|
||||||
|
<Card>
|
||||||
|
<CardContent className="space-y-2 mt-4">
|
||||||
|
<div className="grid grid-cols-2 gap-2">
|
||||||
|
<ShellTypeFormField form={form} shellTypes={shellTypes} />
|
||||||
|
<UrlPatternFormField form={form} />
|
||||||
|
</div>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="behinderPass"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className="space-y-1">
|
||||||
|
<FormLabel>连接密码</FormLabel>
|
||||||
|
<Input {...field} placeholder="Pass" className="h-8" />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<div className="grid grid-cols-2 gap-2">
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="commandParamName"
|
name="behinderHeaderName"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem className="space-y-1">
|
<FormItem className="space-y-1">
|
||||||
<FormLabel>请求参数</FormLabel>
|
<FormLabel>请求头键</FormLabel>
|
||||||
<FormControl>
|
<Input {...field} placeholder="Header Name" className="h-8" />
|
||||||
<Input {...field} placeholder="请输入" className="h-8" />
|
|
||||||
</FormControl>
|
|
||||||
<FormDescription>填写接收命令的请求参数,例如填 cmd 即 `?cmd=whoami` 来执行命令</FormDescription>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
)}
|
<FormField
|
||||||
</div>
|
control={form.control}
|
||||||
<Separator className="mt-4 mb-2" />
|
name="behinderHeaderValue"
|
||||||
<FormField
|
render={({ field }) => (
|
||||||
control={form.control}
|
<FormItem className="space-y-1">
|
||||||
name="injectorClassName"
|
<FormLabel>请求头值</FormLabel>
|
||||||
render={({ field }) => (
|
<Input {...field} placeholder="Header Value" className="h-8" />
|
||||||
<FormItem className="space-y-1">
|
</FormItem>
|
||||||
<FormLabel>注入器类名(可选)</FormLabel>
|
)}
|
||||||
<Input id="injectorClassName" {...field} placeholder="请输入" className="h-8" />
|
/>
|
||||||
</FormItem>
|
</div>
|
||||||
)}
|
<OptionalClassFormField form={form} />
|
||||||
/>
|
</CardContent>
|
||||||
<div className="space-y-1 mt-2">
|
</Card>
|
||||||
<Label htmlFor="interface" className="flex items-center gap-2">
|
</TabsContent>
|
||||||
注入器类继承(可选)(WIP)
|
</FormProvider>
|
||||||
</Label>
|
);
|
||||||
<Select disabled>
|
}
|
||||||
<SelectTrigger id="interface" className="h-8">
|
|
||||||
<SelectValue placeholder="请选择" />
|
function GodzillaTabContent({ form, shellTypes }: { form: UseFormReturn<FormSchema>; shellTypes: Array<string> }) {
|
||||||
</SelectTrigger>
|
return (
|
||||||
<SelectContent>
|
<FormProvider {...form}>
|
||||||
<SelectItem value="JDK_AbstractTranslet">JDK_AbstractTranslet</SelectItem>
|
<TabsContent value="Godzilla">
|
||||||
<SelectItem value="XALAN_AbstractTranslet">XALAN_AbstractTranslet</SelectItem>
|
<Card>
|
||||||
<SelectItem value="FASTJSON_GroovyASTTransformation">FASTJSON_GroovyASTTransformation</SelectItem>
|
<CardContent className="space-y-2 mt-4">
|
||||||
<SelectItem value="SnakeYaml_ScriptEngineFactory">SnakeYaml_ScriptEngineFactory</SelectItem>
|
<div className="grid grid-cols-2 gap-2">
|
||||||
</SelectContent>
|
<ShellTypeFormField form={form} shellTypes={shellTypes} />
|
||||||
</Select>
|
<UrlPatternFormField form={form} />
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
<div className="grid grid-cols-2 gap-2">
|
||||||
</FormProvider>
|
<FormField
|
||||||
</Card>
|
control={form.control}
|
||||||
|
name="godzillaPass"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className="space-y-1">
|
||||||
|
<FormLabel>密码</FormLabel>
|
||||||
|
<Input {...field} placeholder="Pass" className="h-8" />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="godzillaKey"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className="space-y-1">
|
||||||
|
<FormLabel>密钥</FormLabel>
|
||||||
|
<Input {...field} placeholder="Key" className="h-8" />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="godzillaHeaderName"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className="space-y-1">
|
||||||
|
<FormLabel>请求头键</FormLabel>
|
||||||
|
<Input {...field} placeholder="Header Name" className="h-8" />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="godzillaHeaderValue"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className="space-y-1">
|
||||||
|
<FormLabel>请求头值</FormLabel>
|
||||||
|
<Input {...field} placeholder="Header Value" className="h-8" />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<OptionalClassFormField form={form} />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</TabsContent>
|
||||||
|
</FormProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function CommandTabContent({ form, shellTypes }: { form: UseFormReturn<FormSchema>; shellTypes: Array<string> }) {
|
||||||
|
return (
|
||||||
|
<FormProvider {...form}>
|
||||||
|
<TabsContent value="Command">
|
||||||
|
<Card>
|
||||||
|
<CardContent className="space-y-2 mt-4">
|
||||||
|
<div className="grid grid-cols-2 gap-2">
|
||||||
|
<ShellTypeFormField form={form} shellTypes={shellTypes} />
|
||||||
|
<UrlPatternFormField form={form} />
|
||||||
|
</div>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="commandParamName"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className="space-y-1">
|
||||||
|
<FormLabel>请求参数</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} placeholder="请输入" className="h-8" />
|
||||||
|
</FormControl>
|
||||||
|
<FormDescription>填写接收命令的请求参数,例如填 cmd 即 `?cmd=whoami` 来执行命令</FormDescription>
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<OptionalClassFormField form={form} />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</TabsContent>
|
||||||
|
</FormProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group.tsx";
|
|||||||
import { FormSchema } from "@/types/schema.ts";
|
import { FormSchema } from "@/types/schema.ts";
|
||||||
import { PackerConfig } from "@/types/shell.ts";
|
import { PackerConfig } from "@/types/shell.ts";
|
||||||
import { PackageIcon } from "lucide-react";
|
import { PackageIcon } from "lucide-react";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
import { FormProvider, UseFormReturn } from "react-hook-form";
|
import { FormProvider, UseFormReturn } from "react-hook-form";
|
||||||
|
|
||||||
export function PackageConfigCard({
|
export function PackageConfigCard({
|
||||||
@@ -13,6 +14,26 @@ export function PackageConfigCard({
|
|||||||
packerConfig: PackerConfig | undefined;
|
packerConfig: PackerConfig | undefined;
|
||||||
form: UseFormReturn<FormSchema>;
|
form: UseFormReturn<FormSchema>;
|
||||||
}) {
|
}) {
|
||||||
|
const [options, setOptions] = useState<Array<Array<string>>>([]);
|
||||||
|
|
||||||
|
const shellType = form.watch("shellType");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const filteredOptions = Object.entries(packerConfig ?? {}).filter(([name, _]) => {
|
||||||
|
if (!shellType || shellType === " ") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (shellType.startsWith("Agent")) {
|
||||||
|
return name.startsWith("Agent");
|
||||||
|
}
|
||||||
|
return !name.startsWith("Agent");
|
||||||
|
});
|
||||||
|
setOptions(filteredOptions);
|
||||||
|
if (filteredOptions.length > 0) {
|
||||||
|
form.setValue("packingMethod", filteredOptions[0][0]);
|
||||||
|
}
|
||||||
|
}, [form, packerConfig, shellType]); // Add shellType to the dependency array
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="w-full">
|
<Card className="w-full">
|
||||||
<CardHeader className="pb-1">
|
<CardHeader className="pb-1">
|
||||||
@@ -30,8 +51,8 @@ export function PackageConfigCard({
|
|||||||
<FormItem className="space-y-3">
|
<FormItem className="space-y-3">
|
||||||
<FormLabel>打包方式</FormLabel>
|
<FormLabel>打包方式</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<RadioGroup onValueChange={field.onChange} defaultValue={field.value} className="grid grid-cols-3">
|
<RadioGroup onValueChange={field.onChange} value={field.value} className="grid grid-cols-3">
|
||||||
{Object.entries(packerConfig ?? {}).map(([name, value]) => (
|
{options.map(([name, value]) => (
|
||||||
<FormItem key={value} className="flex items-center space-x-3 space-y-0">
|
<FormItem key={value} className="flex items-center space-x-3 space-y-0">
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<RadioGroupItem value={value} id={value} />
|
<RadioGroupItem value={value} id={value} />
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card.tsx";
|
||||||
|
|
||||||
|
export function QuickUsage() {
|
||||||
|
return (
|
||||||
|
<Card>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle>快速使用</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<ol className="list-decimal list-inside space-y-4 text-sm">
|
||||||
|
<li>选择目标服务</li>
|
||||||
|
<li>选择内存马功能,Godzilla、Behinder 或者其他</li>
|
||||||
|
<li>选择内存马挂载类型,Filter、Listener 或者其他</li>
|
||||||
|
<li>选择打包方式</li>
|
||||||
|
<li>点击生成内存马</li>
|
||||||
|
</ol>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
+251
-159
@@ -1,57 +1,194 @@
|
|||||||
import { CodeViewer } from "@/components/code-viewer.tsx";
|
import { CodeViewer } from "@/components/code-viewer.tsx";
|
||||||
import { CopyableField } from "@/components/copyable-field.tsx";
|
import { CopyableField } from "@/components/copyable-field.tsx";
|
||||||
|
import { QuickUsage } from "@/components/quick-usage.tsx";
|
||||||
|
import {
|
||||||
|
AlertDialog,
|
||||||
|
AlertDialogAction,
|
||||||
|
AlertDialogCancel,
|
||||||
|
AlertDialogContent,
|
||||||
|
AlertDialogDescription,
|
||||||
|
AlertDialogFooter,
|
||||||
|
AlertDialogHeader,
|
||||||
|
AlertDialogTitle,
|
||||||
|
AlertDialogTrigger,
|
||||||
|
} from "@/components/ui/alert-dialog";
|
||||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert.tsx";
|
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert.tsx";
|
||||||
import { Button } from "@/components/ui/button.tsx";
|
import { Button } from "@/components/ui/button.tsx";
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card.tsx";
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card.tsx";
|
||||||
import { Label } from "@/components/ui/label.tsx";
|
|
||||||
import { Separator } from "@/components/ui/separator.tsx";
|
import { Separator } from "@/components/ui/separator.tsx";
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs.tsx";
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs.tsx";
|
||||||
import { downloadBytes } from "@/lib/utils.ts";
|
import { downloadBytes } from "@/lib/utils.ts";
|
||||||
import { GenerateResult } from "@/types/shell.ts";
|
import {
|
||||||
import { TicketsIcon, TriangleAlertIcon } from "lucide-react";
|
BehinderShellToolConfig,
|
||||||
|
CommandShellToolConfig,
|
||||||
|
GenerateResult,
|
||||||
|
GodzillaShellToolConfig,
|
||||||
|
} from "@/types/shell.ts";
|
||||||
|
import { CircleHelpIcon, TriangleAlertIcon } from "lucide-react";
|
||||||
|
import { Fragment } from "react";
|
||||||
|
|
||||||
function AgentResult({ packResult, generateResult }: { packResult: string; generateResult?: GenerateResult }) {
|
function AgentResult({ packResult, generateResult }: { packResult: string; generateResult?: GenerateResult }) {
|
||||||
return (
|
return (
|
||||||
<section>
|
<Card>
|
||||||
<ol className="list-decimal list-inside space-y-4">
|
<CardHeader>
|
||||||
<li className="flex items-center justify-between">
|
<CardTitle>使用方法</CardTitle>
|
||||||
<span>下载 MemShellAgent.jar</span>
|
</CardHeader>
|
||||||
<Button
|
<CardContent>
|
||||||
size="sm"
|
<ol className="list-decimal list-inside space-y-4 text-sm">
|
||||||
variant="outline"
|
<li className="flex items-center justify-between">
|
||||||
className="w-28"
|
<span>下载 MemShellAgent.jar</span>
|
||||||
type="button"
|
<Button
|
||||||
|
size="sm"
|
||||||
|
variant="outline"
|
||||||
|
className="w-28"
|
||||||
|
type="button"
|
||||||
|
onClick={() =>
|
||||||
|
downloadBytes(
|
||||||
|
packResult,
|
||||||
|
undefined,
|
||||||
|
`${generateResult?.shellConfig.server}${generateResult?.shellConfig.shellTool}MemShellAgent`,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
下载 Jar
|
||||||
|
</Button>
|
||||||
|
</li>
|
||||||
|
<li className="flex items-center justify-between">
|
||||||
|
<span>下载 Jattach 工具(后期考虑直接封装在 Jar 中)</span>
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
variant="outline"
|
||||||
|
className="w-28"
|
||||||
|
type="button"
|
||||||
|
onClick={() => window.open("https://github.com/jattach/jattach/releases")}
|
||||||
|
>
|
||||||
|
下载 Jattach
|
||||||
|
</Button>
|
||||||
|
</li>
|
||||||
|
<Separator />
|
||||||
|
<li>将 MemShellAgent.jar 和 jattach 移动到容器中(如果测试环境使用容器部署)</li>
|
||||||
|
<li>获取目标 jvm 的进程 pid (使用 jps 或 ps)</li>
|
||||||
|
<li>执行命令进行注入:/path/to/jattach pid load instrument false /path/to/agent.jar</li>
|
||||||
|
<li>尝试利用内存马</li>
|
||||||
|
</ol>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function FeedbackAlert() {
|
||||||
|
return (
|
||||||
|
<AlertDialog>
|
||||||
|
<AlertDialogTrigger asChild>
|
||||||
|
<Button variant="outline" type="button">
|
||||||
|
<CircleHelpIcon /> 内存马利用失败 ?
|
||||||
|
</Button>
|
||||||
|
</AlertDialogTrigger>
|
||||||
|
<AlertDialogContent>
|
||||||
|
<AlertDialogHeader>
|
||||||
|
<AlertDialogTitle>内存马利用失败 ?</AlertDialogTitle>
|
||||||
|
<AlertDialogDescription>
|
||||||
|
<ol>
|
||||||
|
<li>1. 尝试开启调试模式,重新生成内存马并注入,查看控制台或日志</li>
|
||||||
|
<li>2. 如果出现异常堆栈信息,或未见异常,请截图当前生成界面以及异常日志,并尽可能描述目标环境进行反馈</li>
|
||||||
|
</ol>
|
||||||
|
</AlertDialogDescription>
|
||||||
|
</AlertDialogHeader>
|
||||||
|
<AlertDialogFooter>
|
||||||
|
<AlertDialogCancel>取消</AlertDialogCancel>
|
||||||
|
<AlertDialogAction
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
downloadBytes(
|
window.open(
|
||||||
packResult,
|
"https://github.com/ReaJason/MemShellParty/issues/new?template=%E5%86%85%E5%AD%98%E9%A9%AC%E7%94%9F%E6%88%90-bug-%E4%B8%8A%E6%8A%A5.md",
|
||||||
undefined,
|
|
||||||
`${generateResult?.shellConfig.server}${generateResult?.shellConfig.shellTool}MemShellAgent`,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
下载 Jar
|
反馈
|
||||||
</Button>
|
</AlertDialogAction>
|
||||||
</li>
|
</AlertDialogFooter>
|
||||||
<li className="flex items-center justify-between">
|
</AlertDialogContent>
|
||||||
<span>下载 Jattach 工具(后期考虑直接封装在 Jar 中)</span>
|
</AlertDialog>
|
||||||
<Button
|
);
|
||||||
size="sm"
|
}
|
||||||
variant="outline"
|
|
||||||
className="w-28"
|
function BasicInfo({ generateResult }: { generateResult?: GenerateResult }) {
|
||||||
type="button"
|
return (
|
||||||
onClick={() => window.open("https://github.com/jattach/jattach/releases")}
|
<Card>
|
||||||
>
|
<CardHeader>
|
||||||
下载 Jattach
|
<CardTitle className="flex items-center justify-between">
|
||||||
</Button>
|
基础信息
|
||||||
</li>
|
<FeedbackAlert />
|
||||||
<Separator />
|
</CardTitle>
|
||||||
<h2 className="text-2xl font-bold mb-4">使用方法:</h2>
|
</CardHeader>
|
||||||
<li>将 MemShellAgent.jar 和 jattach 移动到容器中(如果测试环境使用容器部署)</li>
|
<CardContent>
|
||||||
<li>获取目标 jvm 的进程 pid (使用 jps 或 ps)</li>
|
<div className="grid grid-cols-2">
|
||||||
<li>执行命令进行注入:/path/to/jattach pid load instrument false /path/to/agent.jar</li>
|
<CopyableField label="目标服务" text={generateResult?.shellConfig.server} />
|
||||||
<li>尝试连接测试</li>
|
<CopyableField label="内存马功能" text={generateResult?.shellConfig.shellTool} />
|
||||||
</ol>
|
</div>
|
||||||
</section>
|
<CopyableField label="内存马挂载类型" text={generateResult?.shellConfig.shellType} />
|
||||||
|
<CopyableField
|
||||||
|
label="请求路径"
|
||||||
|
text={generateResult?.injectorConfig.urlPattern}
|
||||||
|
value={generateResult?.injectorConfig.urlPattern}
|
||||||
|
/>
|
||||||
|
{generateResult?.shellConfig.shellTool === "Behinder" && (
|
||||||
|
<Fragment>
|
||||||
|
<CopyableField label="脚本类型" text="jsp" />
|
||||||
|
<CopyableField label="加密类型" text="默认" />
|
||||||
|
<CopyableField
|
||||||
|
label="连接密码"
|
||||||
|
text={(generateResult?.shellToolConfig as BehinderShellToolConfig).pass}
|
||||||
|
value={(generateResult?.shellToolConfig as BehinderShellToolConfig).pass}
|
||||||
|
/>
|
||||||
|
<CopyableField
|
||||||
|
label="自定义请求头"
|
||||||
|
text={`${(generateResult?.shellToolConfig as BehinderShellToolConfig).headerName}: ${(generateResult?.shellToolConfig as BehinderShellToolConfig).headerValue}`}
|
||||||
|
value={`${(generateResult?.shellToolConfig as BehinderShellToolConfig).headerName}: ${(generateResult?.shellToolConfig as BehinderShellToolConfig).headerValue}`}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
{generateResult?.shellConfig.shellTool === "Godzilla" && (
|
||||||
|
<Fragment>
|
||||||
|
<CopyableField
|
||||||
|
label="密码"
|
||||||
|
text={(generateResult?.shellToolConfig as GodzillaShellToolConfig).pass}
|
||||||
|
value={(generateResult?.shellToolConfig as GodzillaShellToolConfig).pass}
|
||||||
|
/>
|
||||||
|
<CopyableField
|
||||||
|
label="密钥"
|
||||||
|
text={(generateResult?.shellToolConfig as GodzillaShellToolConfig).key}
|
||||||
|
value={(generateResult?.shellToolConfig as GodzillaShellToolConfig).key}
|
||||||
|
/>
|
||||||
|
<CopyableField label="有效载荷" text="JavaDynamicPayload" />
|
||||||
|
<CopyableField label="加密器" text="JAVA_AES_BASE64" />
|
||||||
|
<CopyableField
|
||||||
|
label="请求配置 -> 请求头"
|
||||||
|
text={`${(generateResult?.shellToolConfig as GodzillaShellToolConfig).headerName}: ${(generateResult?.shellToolConfig as GodzillaShellToolConfig).headerValue}`}
|
||||||
|
value={`${(generateResult?.shellToolConfig as GodzillaShellToolConfig).headerName}: ${(generateResult?.shellToolConfig as GodzillaShellToolConfig).headerValue}`}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
{generateResult?.shellConfig.shellTool === "Command" && (
|
||||||
|
<Fragment>
|
||||||
|
<CopyableField
|
||||||
|
label="接收命令请求参数"
|
||||||
|
text={(generateResult?.shellToolConfig as CommandShellToolConfig).paramName}
|
||||||
|
value={(generateResult?.shellToolConfig as CommandShellToolConfig).paramName}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
<CopyableField
|
||||||
|
label="注入器类名"
|
||||||
|
value={generateResult?.injectorClassName}
|
||||||
|
text={`${generateResult?.injectorClassName} (${generateResult?.injectorSize} bytes)`}
|
||||||
|
/>
|
||||||
|
<CopyableField
|
||||||
|
label="内存马类名"
|
||||||
|
value={generateResult?.shellClassName}
|
||||||
|
text={`${generateResult?.shellClassName} (${generateResult?.shellSize} bytes)`}
|
||||||
|
/>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,125 +200,80 @@ export function ShellResult({
|
|||||||
const showCode = packMethod === "JSP";
|
const showCode = packMethod === "JSP";
|
||||||
const isAgent = packMethod.startsWith("Agent");
|
const isAgent = packMethod.startsWith("Agent");
|
||||||
return (
|
return (
|
||||||
<Card className="h-full">
|
<Tabs defaultValue="packResult">
|
||||||
<CardHeader className="pb-2">
|
<TabsList className="grid w-full grid-cols-3">
|
||||||
<CardTitle className="text-md flex items-center gap-2">
|
<TabsTrigger value="packResult">打包结果</TabsTrigger>
|
||||||
<TicketsIcon className="h-5" />
|
<TabsTrigger value="shell">内存马类</TabsTrigger>
|
||||||
FBI
|
<TabsTrigger value="injector">注入器类</TabsTrigger>
|
||||||
</CardTitle>
|
</TabsList>
|
||||||
</CardHeader>
|
<TabsContent value="packResult" className="my-4">
|
||||||
<CardContent>
|
<div className="mb-4">
|
||||||
<Tabs defaultValue="packResult">
|
{generateResult && <BasicInfo generateResult={generateResult} />}
|
||||||
<TabsList className="grid w-full grid-cols-3">
|
{!generateResult && <QuickUsage />}
|
||||||
<TabsTrigger value="packResult">打包结果</TabsTrigger>
|
</div>
|
||||||
<TabsTrigger value="shell">内存马类</TabsTrigger>
|
{!isAgent && (
|
||||||
<TabsTrigger value="injector">注入器类</TabsTrigger>
|
<CodeViewer
|
||||||
</TabsList>
|
code={packResult}
|
||||||
<TabsContent value="packResult" className="mt-4">
|
wrapLongLines={!showCode}
|
||||||
{generateResult && !isAgent && (
|
showLineNumbers={showCode}
|
||||||
<div className="gap-4 my-2">
|
language={showCode ? "java" : "text"}
|
||||||
<CopyableField
|
height={400}
|
||||||
label="注入器类名"
|
/>
|
||||||
value={generateResult?.injectorClassName}
|
)}
|
||||||
size={generateResult?.injectorSize}
|
{isAgent && <AgentResult packResult={packResult} generateResult={generateResult} />}
|
||||||
/>
|
</TabsContent>
|
||||||
<CopyableField
|
<TabsContent value="shell" className="mt-4">
|
||||||
label="内存马类名"
|
<Alert>
|
||||||
value={generateResult?.shellClassName}
|
<TriangleAlertIcon className="h-4 w-4" />
|
||||||
size={generateResult?.shellSize}
|
<AlertTitle>Warning</AlertTitle>
|
||||||
/>
|
<AlertDescription>反编译还在开发中,因此当前仅能看到 base64 编码格式</AlertDescription>
|
||||||
</div>
|
</Alert>
|
||||||
)}
|
<div className="gap-4 my-2 flex items-center justify-end">
|
||||||
{!isAgent && (
|
{generateResult && (
|
||||||
<CodeViewer
|
<Button
|
||||||
code={packResult}
|
size="sm"
|
||||||
wrapLongLines={!showCode}
|
variant="outline"
|
||||||
showLineNumbers={showCode}
|
className="w-28"
|
||||||
language={showCode ? "java" : "text"}
|
type="button"
|
||||||
/>
|
onClick={() => downloadBytes(generateResult?.shellBytesBase64Str, generateResult?.shellClassName)}
|
||||||
)}
|
>
|
||||||
{isAgent && <AgentResult packResult={packResult} generateResult={generateResult} />}
|
下载 Class
|
||||||
</TabsContent>
|
</Button>
|
||||||
<TabsContent value="shell" className="mt-4">
|
)}
|
||||||
<Alert>
|
</div>
|
||||||
<TriangleAlertIcon className="h-4 w-4" />
|
<CodeViewer
|
||||||
<AlertTitle>Warning</AlertTitle>
|
showLineNumbers={false}
|
||||||
<AlertDescription>反编译还在开发中,因此当前仅能看到 base64 编码格式</AlertDescription>
|
wrapLongLines={true}
|
||||||
</Alert>
|
code={generateResult?.shellBytesBase64Str ?? ""}
|
||||||
<div className="gap-4 my-2 flex items-center justify-between">
|
language="text"
|
||||||
{generateResult && (
|
/>
|
||||||
<div>
|
</TabsContent>
|
||||||
<div className="flex items-center text-sm">
|
<TabsContent value="injector" className="mt-4">
|
||||||
<Label>内存马类名:</Label>
|
<Alert>
|
||||||
<p>{generateResult?.shellClassName}</p>
|
<TriangleAlertIcon className="h-4 w-4" />
|
||||||
</div>
|
<AlertTitle>Warning</AlertTitle>
|
||||||
<div className="flex items-center text-sm">
|
<AlertDescription>反编译还在开发中,因此当前仅能看到 base64 编码格式</AlertDescription>
|
||||||
<Label>内存马字节码大小:</Label>
|
</Alert>
|
||||||
<p>{generateResult?.shellSize ?? 0} bytes</p>
|
<div className="gap-4 my-2 flex items-center justify-end">
|
||||||
</div>
|
{generateResult && (
|
||||||
</div>
|
<Button
|
||||||
)}
|
size="sm"
|
||||||
{generateResult && (
|
className="w-28"
|
||||||
<Button
|
variant="outline"
|
||||||
size="sm"
|
type="button"
|
||||||
variant="outline"
|
onClick={() => downloadBytes(generateResult?.injectorBytesBase64Str, generateResult?.injectorClassName)}
|
||||||
className="w-28"
|
>
|
||||||
type="button"
|
下载 Class
|
||||||
onClick={() => downloadBytes(generateResult?.shellBytesBase64Str, generateResult?.shellClassName)}
|
</Button>
|
||||||
>
|
)}
|
||||||
下载 Class
|
</div>
|
||||||
</Button>
|
<CodeViewer
|
||||||
)}
|
showLineNumbers={false}
|
||||||
</div>
|
wrapLongLines={true}
|
||||||
<CodeViewer
|
code={generateResult?.injectorBytesBase64Str ?? ""}
|
||||||
showLineNumbers={false}
|
language="text"
|
||||||
wrapLongLines={true}
|
/>
|
||||||
code={generateResult?.shellBytesBase64Str ?? ""}
|
</TabsContent>
|
||||||
language="text"
|
</Tabs>
|
||||||
/>
|
|
||||||
</TabsContent>
|
|
||||||
<TabsContent value="injector" className="mt-4">
|
|
||||||
<Alert>
|
|
||||||
<TriangleAlertIcon className="h-4 w-4" />
|
|
||||||
<AlertTitle>Warning</AlertTitle>
|
|
||||||
<AlertDescription>反编译还在开发中,因此当前仅能看到 base64 编码格式</AlertDescription>
|
|
||||||
</Alert>
|
|
||||||
<div className="gap-4 my-2 flex items-center justify-between">
|
|
||||||
{generateResult && (
|
|
||||||
<div>
|
|
||||||
<div className="flex items-center text-sm">
|
|
||||||
<Label>注入器类名:</Label>
|
|
||||||
<p>{generateResult?.injectorClassName}</p>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center text-sm">
|
|
||||||
<Label>注入器字节码大小:</Label>
|
|
||||||
<p>{generateResult?.injectorSize ?? 0} bytes</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{generateResult && (
|
|
||||||
<Button
|
|
||||||
size="sm"
|
|
||||||
className="w-28"
|
|
||||||
variant="outline"
|
|
||||||
type="button"
|
|
||||||
onClick={() =>
|
|
||||||
downloadBytes(generateResult?.injectorBytesBase64Str, generateResult?.injectorClassName)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
下载 Class
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<CodeViewer
|
|
||||||
showLineNumbers={false}
|
|
||||||
wrapLongLines={true}
|
|
||||||
code={generateResult?.injectorBytesBase64Str ?? ""}
|
|
||||||
language="text"
|
|
||||||
/>
|
|
||||||
</TabsContent>
|
|
||||||
</Tabs>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip.tsx";
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip.tsx";
|
||||||
import { InfoIcon } from "lucide-react";
|
import { InfoIcon } from "lucide-react";
|
||||||
|
|
||||||
export function JRETip() {
|
export function JreTip() {
|
||||||
return (
|
return (
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<InfoIcon className="cursor-pointer h-3" />
|
<InfoIcon className="cursor-pointer h-4" />
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent>
|
<TooltipContent>
|
||||||
<p>目标 JRE 版本,一般而言为了最大的兼容性,默认 Java 6 即可。</p>
|
<p>目标 JRE 版本,一般而言为了最大的兼容性,默认 Java 6 即可,Java 高版本能加载低版本的字节码。</p>
|
||||||
<p>特定情况下,例如 JDK8 才能使用 lambda 表达式,JDK9 以上存在模块限制时才需要选择特定的版本。</p>
|
<p>特定情况下,例如 JDK8 才能使用 lambda 表达式,JDK9 以上存在模块限制时才需要选择特定的版本。</p>
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
+6
-2
@@ -2,16 +2,20 @@ import * as z from "zod";
|
|||||||
|
|
||||||
const EnvSchema = z.object({
|
const EnvSchema = z.object({
|
||||||
API_URL: z.optional(z.string()),
|
API_URL: z.optional(z.string()),
|
||||||
|
MODE: z.string(),
|
||||||
});
|
});
|
||||||
|
|
||||||
const createEnv = () => {
|
const createEnv = () => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const envVars = Object.entries(import.meta.env).reduce<Record<string, string>>((acc, curr) => {
|
const envVars = Object.entries(import.meta.env).reduce<Record<string, string>>((acc, curr) => {
|
||||||
const [key, value] = curr;
|
const [key, value] = curr;
|
||||||
if (key.startsWith("VITE_APP_")) {
|
if (typeof value === "string") {
|
||||||
if (typeof value === "string") {
|
if (key.startsWith("VITE_APP_")) {
|
||||||
acc[key.replace("VITE_APP_", "")] = value;
|
acc[key.replace("VITE_APP_", "")] = value;
|
||||||
}
|
}
|
||||||
|
if (key === "MODE") {
|
||||||
|
acc[key] = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|||||||
+2
-1
@@ -4,6 +4,7 @@ import { routeTree } from "./routeTree.gen";
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
import { TailwindIndicator } from "@/components/tailwind-indicator.tsx";
|
import { TailwindIndicator } from "@/components/tailwind-indicator.tsx";
|
||||||
import { Toaster } from "@/components/ui/sonner.tsx";
|
import { Toaster } from "@/components/ui/sonner.tsx";
|
||||||
|
import { env } from "@/config.ts";
|
||||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
@@ -27,7 +28,7 @@ if (!rootElement.innerHTML) {
|
|||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<Toaster />
|
<Toaster />
|
||||||
<RouterProvider router={router} />
|
<RouterProvider router={router} />
|
||||||
<TailwindIndicator />
|
{env.MODE !== "production" && <TailwindIndicator />}
|
||||||
</QueryClientProvider>,
|
</QueryClientProvider>,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-45
@@ -1,7 +1,6 @@
|
|||||||
import { MainConfigCard } from "@/components/main-config-card.tsx";
|
import { MainConfigCard } from "@/components/main-config-card.tsx";
|
||||||
import { PackageConfigCard } from "@/components/package-config-card.tsx";
|
import { PackageConfigCard } from "@/components/package-config-card.tsx";
|
||||||
import { ShellResult } from "@/components/shell-result.tsx";
|
import { ShellResult } from "@/components/shell-result.tsx";
|
||||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert.tsx";
|
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Form } from "@/components/ui/form.tsx";
|
import { Form } from "@/components/ui/form.tsx";
|
||||||
import { env } from "@/config.ts";
|
import { env } from "@/config.ts";
|
||||||
@@ -11,7 +10,7 @@ import { transformToPostData } from "@/utils/transformer.ts";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { createFileRoute } from "@tanstack/react-router";
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
import { ActivityIcon, LoaderCircle, ServerOffIcon, WandSparklesIcon } from "lucide-react";
|
import { LoaderCircle, WandSparklesIcon } from "lucide-react";
|
||||||
import { useState, useTransition } from "react";
|
import { useState, useTransition } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
@@ -21,7 +20,7 @@ export const Route = createFileRoute("/")({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function IndexComponent() {
|
function IndexComponent() {
|
||||||
const { isPending, isError, data } = useQuery<ConfigResponseType>({
|
const { data } = useQuery<ConfigResponseType>({
|
||||||
queryKey: ["config"],
|
queryKey: ["config"],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const response = await fetch(`${env.API_URL}/config`);
|
const response = await fetch(`${env.API_URL}/config`);
|
||||||
@@ -36,7 +35,7 @@ function IndexComponent() {
|
|||||||
debug: false,
|
debug: false,
|
||||||
bypassJavaModule: false,
|
bypassJavaModule: false,
|
||||||
shellClassName: "",
|
shellClassName: "",
|
||||||
shellTool: "",
|
shellTool: "Behinder",
|
||||||
shellType: "",
|
shellType: "",
|
||||||
urlPattern: "/*",
|
urlPattern: "/*",
|
||||||
godzillaPass: "pass",
|
godzillaPass: "pass",
|
||||||
@@ -123,46 +122,20 @@ function IndexComponent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mt-4">
|
<Form {...form}>
|
||||||
<div className="px-4">
|
<form onSubmit={form.handleSubmit(onSubmit)} className="flex flex-col xl:flex-row gap-4 p-4">
|
||||||
{isPending && (
|
<div className="w-full xl:w-1/2 space-y-4">
|
||||||
<Alert>
|
<MainConfigCard servers={data?.servers} mainConfig={data?.core} form={form} />
|
||||||
<LoaderCircle className="animate-spin h-4 w-4" />
|
<PackageConfigCard packerConfig={data?.packers} form={form} />
|
||||||
<AlertTitle>Pending</AlertTitle>
|
<Button className="w-full" type="submit" disabled={isActionPending}>
|
||||||
<AlertDescription>正在全力搜索可用的后端服务~</AlertDescription>
|
{isActionPending ? <LoaderCircle className="animate-spin" /> : <WandSparklesIcon />}
|
||||||
</Alert>
|
生成内存马
|
||||||
)}
|
</Button>
|
||||||
{isError && (
|
</div>
|
||||||
<Alert variant="destructive">
|
<div className="w-full xl:w-1/2 space-y-4">
|
||||||
<ServerOffIcon className="h-4 w-4" />
|
<ShellResult packMethod={packMethod} generateResult={generateResult} packResult={packResult} />
|
||||||
<AlertTitle>Not Work!</AlertTitle>
|
</div>
|
||||||
<AlertDescription>未检测到可用后端服务,生成功能暂不可用.</AlertDescription>
|
</form>
|
||||||
</Alert>
|
</Form>
|
||||||
)}
|
|
||||||
|
|
||||||
{!isError && data && (
|
|
||||||
<Alert>
|
|
||||||
<ActivityIcon className="h-4 w-4" />
|
|
||||||
<AlertTitle>It Work!</AlertTitle>
|
|
||||||
<AlertDescription>Let's start the party! 🎉</AlertDescription>
|
|
||||||
</Alert>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<Form {...form}>
|
|
||||||
<form onSubmit={form.handleSubmit(onSubmit)} className="flex flex-col xl:flex-row gap-4 p-4">
|
|
||||||
<div className="w-full xl:w-1/2 space-y-2">
|
|
||||||
<MainConfigCard servers={data?.servers} mainConfig={data?.core} form={form} />
|
|
||||||
<PackageConfigCard packerConfig={data?.packers} form={form} />
|
|
||||||
<Button className="w-full" type="submit" disabled={isActionPending}>
|
|
||||||
{isActionPending ? <LoaderCircle className="animate-spin" /> : <WandSparklesIcon />}
|
|
||||||
Generate
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
<div className="w-full xl:w-1/2 space-y-4">
|
|
||||||
<ShellResult packMethod={packMethod} generateResult={generateResult} packResult={packResult} />
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</Form>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,16 @@ export interface GodzillaShellToolConfig {
|
|||||||
headerValue?: string;
|
headerValue?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface BehinderShellToolConfig {
|
||||||
|
shellClassName?: string;
|
||||||
|
pass?: string;
|
||||||
|
headerName?: string;
|
||||||
|
headerValue?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface InjectorConfig {
|
export interface InjectorConfig {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
classInheritance?: string;
|
||||||
urlPattern?: string;
|
urlPattern?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,6 +79,6 @@ export interface GenerateResult {
|
|||||||
injectorSize: number;
|
injectorSize: number;
|
||||||
injectorBytesBase64Str: string;
|
injectorBytesBase64Str: string;
|
||||||
shellConfig: ShellConfig;
|
shellConfig: ShellConfig;
|
||||||
shellToolConfig: CommandShellToolConfig | GodzillaShellToolConfig;
|
shellToolConfig: CommandShellToolConfig | GodzillaShellToolConfig | BehinderShellToolConfig;
|
||||||
injectorConfig: InjectorConfig;
|
injectorConfig: InjectorConfig;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export function transformToPostData(formValue: FormSchema) {
|
|||||||
server: formValue.server,
|
server: formValue.server,
|
||||||
shellTool: formValue.shellTool,
|
shellTool: formValue.shellTool,
|
||||||
shellType: formValue.shellType,
|
shellType: formValue.shellType,
|
||||||
|
debug: formValue.debug,
|
||||||
targetJreVersion: formValue.targetJdkVersion,
|
targetJreVersion: formValue.targetJdkVersion,
|
||||||
byPassJavaModule: formValue.bypassJavaModule,
|
byPassJavaModule: formValue.bypassJavaModule,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"root":["./src/config.ts","./src/main.tsx","./src/routetree.gen.ts","./src/components/code-viewer.tsx","./src/components/main-config-card.tsx","./src/components/mode-toggle.tsx","./src/components/package-config-card.tsx","./src/components/shell-result.tsx","./src/components/tailwind-indicator.tsx","./src/components/theme-provider.tsx","./src/components/tips/jre-tip.tsx","./src/components/tips/url-pattern-tip.tsx","./src/components/ui/alert.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/checkbox.tsx","./src/components/ui/dropdown-menu.tsx","./src/components/ui/form.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/radio-group.tsx","./src/components/ui/select.tsx","./src/components/ui/separator.tsx","./src/components/ui/sonner.tsx","./src/components/ui/switch.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/components/ui/tooltip.tsx","./src/lib/utils.ts","./src/routes/__root.tsx","./src/routes/index.tsx","./src/types/schema.ts","./src/types/shell.ts","./src/utils/transformer.ts"],"version":"5.7.2"}
|
{"root":["./src/config.ts","./src/main.tsx","./src/routetree.gen.ts","./src/components/code-viewer.tsx","./src/components/copyable-field.tsx","./src/components/main-config-card.tsx","./src/components/mode-toggle.tsx","./src/components/package-config-card.tsx","./src/components/quick-usage.tsx","./src/components/shell-result.tsx","./src/components/tailwind-indicator.tsx","./src/components/theme-provider.tsx","./src/components/tips/jre-tip.tsx","./src/components/tips/url-pattern-tip.tsx","./src/components/ui/alert-dialog.tsx","./src/components/ui/alert.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/checkbox.tsx","./src/components/ui/dropdown-menu.tsx","./src/components/ui/form.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/radio-group.tsx","./src/components/ui/select.tsx","./src/components/ui/separator.tsx","./src/components/ui/sonner.tsx","./src/components/ui/switch.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/components/ui/tooltip.tsx","./src/lib/utils.ts","./src/routes/__root.tsx","./src/routes/index.tsx","./src/types/schema.ts","./src/types/shell.ts","./src/utils/transformer.ts"],"version":"5.7.3"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"root":["./vite.config.ts"],"version":"5.7.2"}
|
{"root":["./vite.config.ts"],"version":"5.7.3"}
|
||||||
Reference in New Issue
Block a user