wsm

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WebShellExports = map[string]interface{}{
	"NewWebshell": NewWebShell,

	"tools":       SetShellType,
	"setProxy":    SetProxy,
	"useBehinder": SetBeinderTool,
	"useGodzilla": SetGodzillaTool,
	"useBase64":   SetBase64Aes,
	"useRaw":      SetRawAes,
	"script":      SetShellScript,
	"secretKey":   SetSecretKey,
	"passParams":  SetPass,

	"cmdPath": behinder.SetCommandPath,
}

Functions

func SaveShell

func SaveShell(manager BaseShellManager)

Types

type BaseShellManager

type BaseShellManager interface {
	PacketCodecI
	PayloadCodecI
	Ping(opts ...behinder.ExecParamsConfig) (bool, error)
	BasicInfo(opts ...behinder.ExecParamsConfig) ([]byte, error)
	CommandExec(cmd string, opts ...behinder.ExecParamsConfig) ([]byte, error)
	String() string
	GenWebShell() string
}

func NewWebShell

func NewWebShell(url string, opts ...ShellConfig) (BaseShellManager, error)

func NewWebShellManager

func NewWebShellManager(s *ypb.WebShell) (BaseShellManager, error)

type BehidnerResourceSystemAction

type BehidnerResourceSystemAction struct {
	// contains filtered or unexported fields
}

func (*BehidnerResourceSystemAction) Delete

func (*BehidnerResourceSystemAction) Do

func (*BehidnerResourceSystemAction) Get

func (*BehidnerResourceSystemAction) Head

func (*BehidnerResourceSystemAction) Post

func (*BehidnerResourceSystemAction) Put

type Behinder

type Behinder struct {
	// 连接地址
	Url string
	// 密钥
	SecretKey []byte
	// shell 类型
	ShellScript string

	Proxy string

	// 自定义 header 头
	Headers              map[string]string
	PacketScriptContent  string
	PayloadScriptContent string
	// contains filtered or unexported fields
}

func NewBehinder

func NewBehinder(ys *ypb.WebShell) (*Behinder, error)

func NewBehinderManager

func NewBehinderManager(url string, opts ...ShellConfig) (*Behinder, error)

func (*Behinder) BasicInfo

func (b *Behinder) BasicInfo(opts ...behinder.ExecParamsConfig) ([]byte, error)

func (*Behinder) ClientRequestEncode

func (b *Behinder) ClientRequestEncode(raw []byte) ([]byte, error)

func (*Behinder) ClientRequestEncodeFormGo

func (b *Behinder) ClientRequestEncodeFormGo(en codecFunc)

func (*Behinder) CommandExec

func (b *Behinder) CommandExec(cmd string, opts ...behinder.ExecParamsConfig) ([]byte, error)

func (*Behinder) EchoResultDecodeFormGo

func (b *Behinder) EchoResultDecodeFormGo(de codecFunc)

func (*Behinder) EchoResultDecodeFormYak

func (b *Behinder) EchoResultDecodeFormYak(raw []byte) ([]byte, error)

func (*Behinder) EchoResultEncodeFormGo

func (b *Behinder) EchoResultEncodeFormGo(en codecFunc)

func (*Behinder) EchoResultEncodeFormYak

func (b *Behinder) EchoResultEncodeFormYak(raw []byte) ([]byte, error)

func (*Behinder) GenWebShell

func (b *Behinder) GenWebShell() string

func (*Behinder) Ping

func (b *Behinder) Ping(opts ...behinder.ExecParamsConfig) (bool, error)

func (*Behinder) ServerResponseDecode

func (b *Behinder) ServerResponseDecode(raw []byte) ([]byte, error)

func (*Behinder) SetPacketScriptContent

func (b *Behinder) SetPacketScriptContent(str string)

func (*Behinder) SetPayloadScriptContent

func (b *Behinder) SetPayloadScriptContent(str string)

func (*Behinder) String

func (b *Behinder) String() string

func (*Behinder) Unmarshal

func (b *Behinder) Unmarshal(bts []byte, m map[string]string) error

type FileOperation

type FileOperation interface {
	Execute(base BaseShellManager) ([]byte, error)
}

type Godzilla

type Godzilla struct {
	Url string
	//
	// 连接参数
	Pass string
	// 密钥
	SecretKey []byte
	// shell 类型
	ShellScript string
	// 加密模式
	EncMode string
	Proxy   string
	// 自定义 header 头
	Headers map[string]string
	// request 开头的干扰字符
	ReqLeft string
	// request 结尾的干扰字符
	ReqRight string

	PacketScriptContent  string
	PayloadScriptContent string
	// contains filtered or unexported fields
}

func NewGodzilla

func NewGodzilla(ys *ypb.WebShell) (*Godzilla, error)

func NewGodzillaManager

func NewGodzillaManager(url string, opts ...ShellConfig) (*Godzilla, error)

func (*Godzilla) BasicInfo

func (g *Godzilla) BasicInfo(opts ...behinder.ExecParamsConfig) ([]byte, error)

func (*Godzilla) ClientRequestEncode

func (g *Godzilla) ClientRequestEncode(raw []byte) ([]byte, error)

func (*Godzilla) ClientRequestEncodeFormGo

func (g *Godzilla) ClientRequestEncodeFormGo(en codecFunc)

func (*Godzilla) CommandExec

func (g *Godzilla) CommandExec(cmd string, opts ...behinder.ExecParamsConfig) ([]byte, error)

func (*Godzilla) CustomClassByteCodeDealer

func (g *Godzilla) CustomClassByteCodeDealer(classBytes []byte) (bool, error)

func (*Godzilla) DumpWebappComponent

func (g *Godzilla) DumpWebappComponent(classname string) ([]byte, error)

func (*Godzilla) EchoResultDecodeFormGo

func (g *Godzilla) EchoResultDecodeFormGo(de codecFunc)

func (*Godzilla) EchoResultDecodeFormYak

func (g *Godzilla) EchoResultDecodeFormYak(raw []byte) ([]byte, error)

func (*Godzilla) EchoResultEncodeFormGo

func (g *Godzilla) EchoResultEncodeFormGo(en codecFunc)

func (*Godzilla) EchoResultEncodeFormYak

func (g *Godzilla) EchoResultEncodeFormYak(raw []byte) ([]byte, error)

func (*Godzilla) EvalFunc

func (g *Godzilla) EvalFunc(className, funcName string, parameter *godzilla.Parameter) ([]byte, error)

EvalFunc 个人简单理解为调用远程 shell 的一个方法,以及对指令的序列化,并且发送指令

func (*Godzilla) FileManagement

func (g *Godzilla) FileManagement()

func (*Godzilla) GenWebShell

func (g *Godzilla) GenWebShell() string

func (*Godzilla) Include

func (g *Godzilla) Include(codeName string, binCode []byte) (bool, error)

Include 远程 shell 加载插件

func (*Godzilla) InjectPayload

func (g *Godzilla) InjectPayload() error

func (*Godzilla) InjectPayloadIfNoCookie

func (g *Godzilla) InjectPayloadIfNoCookie() error

func (*Godzilla) InvokeCustomPlugin

func (g *Godzilla) InvokeCustomPlugin() ([]byte, error)

func (*Godzilla) KillWebappComponent

func (g *Godzilla) KillWebappComponent(componentType string, name string) ([]byte, error)

KillWebappComponent will unload component given kill `Servlet` need to provide `servletName` eg: `HelloServlet` kill `Filter` need to provide `filterName` eg: `HelloFilter` kill `Listener` need to provide `listenerClass` eg: `com.example.HelloListener` kill `Valve` need to provide `valveID` eg: `1` kill `Timer` need to provide `threadName` kill `Websocket` need to provide `websocketPattern` eg: `/websocket/EchoEndpoint` kill `Upgrade` need to provide `upgradeKey` eg: `version.txt` from goby ysoserial plugin generated kill `Executor` use a fixed value `recovery`

func (*Godzilla) LoadPotatoPlugin

func (g *Godzilla) LoadPotatoPlugin(cmd string) ([]byte, error)

func (*Godzilla) LoadScanWebappComponentInfoPlugin

func (g *Godzilla) LoadScanWebappComponentInfoPlugin(className string) ([]byte, error)

func (*Godzilla) LoadSuo5Plugin

func (g *Godzilla) LoadSuo5Plugin(className string, memshellType string, path string) ([]byte, error)

LoadSuo5Plugin load suo5 proxy with default memshell type as filter type

func (*Godzilla) Ping

func (g *Godzilla) Ping(opts ...behinder.ExecParamsConfig) (bool, error)

func (*Godzilla) ScanWebappComponentInfo

func (g *Godzilla) ScanWebappComponentInfo() ([]byte, error)

ScanWebappComponentInfo will return target webapp servlet, filter info

func (*Godzilla) ServerResponseDecode

func (g *Godzilla) ServerResponseDecode(raw []byte) ([]byte, error)

func (*Godzilla) SetPacketScriptContent

func (g *Godzilla) SetPacketScriptContent(content string)

func (*Godzilla) SetPayloadScriptContent

func (g *Godzilla) SetPayloadScriptContent(content string)

func (*Godzilla) String

func (g *Godzilla) String() string

type GodzillaFileSystemAction

type GodzillaFileSystemAction struct {
	// contains filtered or unexported fields
}

func (*GodzillaFileSystemAction) Delete

func (*GodzillaFileSystemAction) Do

func (*GodzillaFileSystemAction) Get

func (*GodzillaFileSystemAction) Head

func (*GodzillaFileSystemAction) Post

func (*GodzillaFileSystemAction) Put

type IResult

type IResult interface {
	Unmarshal([]byte, map[string]string) error
}

type PacketCodecI

type PacketCodecI interface {
	// ClientRequestEncode 对请求包的 payload 进行编码
	ClientRequestEncode(raw []byte) ([]byte, error)
	// ServerResponseDecode webshell server 获取请求包中的 payload
	ServerResponseDecode(raw []byte) ([]byte, error)
	SetPacketScriptContent(content string)
}

type PayloadCodecI

type PayloadCodecI interface {
	// EchoResultEncodeFormYak payload 内部对回显结果的编码,混合编程,执行 yaklang
	EchoResultEncodeFormYak(raw []byte) ([]byte, error)
	// EchoResultDecodeFormYak 对 payload 回显结果的解码
	EchoResultDecodeFormYak(raw []byte) ([]byte, error)
	SetPayloadScriptContent(content string)
}

type ShellConfig

type ShellConfig func(info *ypb.WebShell)

func SetBase64Aes

func SetBase64Aes() ShellConfig

func SetBeinderTool

func SetBeinderTool() ShellConfig

func SetGodzillaTool

func SetGodzillaTool() ShellConfig

func SetHeaders

func SetHeaders(headers map[string]string) ShellConfig

SetHeaders TODO

func SetPass

func SetPass(pass string) ShellConfig

func SetProxy

func SetProxy(p string) ShellConfig

SetProxy TODO

func SetRawAes

func SetRawAes() ShellConfig

func SetSecretKey

func SetSecretKey(key string) ShellConfig

func SetShellScript

func SetShellScript(script string) ShellConfig

func SetShellType

func SetShellType(tools string) ShellConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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