Help us shape the future of Go! Take the 2026 Go Developer Survey

payload

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package payload renders minimal, protocol-compatible WebShell payloads. It is defensive by itself: it only produces bytes; delivery/execution must be provided by the host through capkit/kits/shellkit/plan sinks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	ShellType ShellType
	Password  string
	Watermark string
	CmdParam  string
	Variant   Variant
	Protocol  string
}

Options 生成参数;Password 为空时随机生成,Watermark 用于投递溯源(如 delivery ID)。 Variant 免杀变体:plain(默认)/ lite(变量随机化+压缩)/ enc(PHP 编码链)。 Protocol 流量协议:plain(默认,pass+cmdParam 明文)/ behinder / godzilla (加密协议,仅 PHP;模板与 webshellproto 客户端执行体配套,variant 对加密协议无效)。

type Payload

type Payload struct {
	Content    []byte
	Password   string
	ShellType  ShellType
	CmdParam   string
	Filename   string
	SHA256     string
	TemplateID string
	Variant    Variant
	Protocol   string
}

Payload 生成结果;Filename 为建议上传文件名(低噪音)。

func Generate

func Generate(opts Options) (*Payload, error)

Generate 按语言渲染模板。模板带密码校验(嵌入内容,随内容一同投递), 命令参数作为系统命令执行——与平台 execParams 的 pass+cmd 双参数协议严格对齐。

type ShellType

type ShellType string

ShellType 支持的目标语言(与 WebShell 连接管理的 type 字段一致)。

const (
	ShellPHP  ShellType = "php"
	ShellASP  ShellType = "asp"
	ShellASPX ShellType = "aspx"
	ShellJSP  ShellType = "jsp"
)

func NormalizeShellType

func NormalizeShellType(s string) (ShellType, error)

NormalizeShellType 归一化语言标识,未知值返回错误。

type Variant

type Variant string

混淆变体(免杀分级)。定位:平台内置通用变形,覆盖常见静态检测; 时效性免杀打法仍由模型按知识库检索(srcall:file-upload/waf 绕过)供给 content_b64。

plain : 原始最小模板(M1 基线,可读性最好,便于教学/排查)
lite  : 变量名随机化 + 去注释压缩 + 噪声填充(静态特征打散)
enc   : 编码链动态解码(PHP):危险函数名 chr 拼接构造、密码藏进编码体,
        抵抗「明文函数名/密码」类静态规则
const (
	VariantPlain Variant = "plain"
	VariantLite  Variant = "lite"
	VariantEnc   Variant = "enc"
)

func NormalizeVariant

func NormalizeVariant(s string) (Variant, error)

NormalizeVariant 归一化变体标识;空值默认 plain,未知值报错。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL