api

package
v0.0.0-...-a8a90e7 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Windows flag for Windows OS
	Windows Os = "windows"
	// Linux flag for Linux OS
	Linux Os = "linux"
	// FreeBSD flag for FreeBSD OS
	FreeBSD Os = "freebsd"
	// Darwin flag for Darwin / Mac OS
	Darwin Os = "darwin"

	// Intel32 flag for Intel/AMD 32 bit architectures
	Intel32 Arch = "x32"
	// Intel64 flag for Intel/AMD 64 bit architectures
	Intel64 Arch = "x64"
	// Intel32y64 flag for Intel/AMD 32+64 bit combo shellcodes
	Intel32y64 Arch = "x32x64"
	// Arm flag for Arm 32 bit shellcodes
	Arm Arch = "arm"
)

Variables

View Source
var (
	// Arches - list of human readable architecture names
	Arches []string = []string{"x32", "x64", "x32x64", "arm"}

	// Oses - list of human readable OS names
	Oses []string = []string{"windows", "linux", "darwin"}
)

Functions

func ApplyPrefixForkIntel64

func ApplyPrefixForkIntel64(shellcode []byte, entryJump uint32, byteOrder binary.ByteOrder) []byte

ApplyPrefixForkIntel64 - Prepends instructions to fork and have the parent jump to a relative 32-bit address (the entryJump argument)

Intel x64 Linux version

Returns the resulting shellcode

func ApplySuffixJmpIntel32

func ApplySuffixJmpIntel32(shellcode []byte, shellcodeVaddr uint32, entryPoint uint32, byteOrder binary.ByteOrder) []byte

ApplySuffixJmpIntel32 - Appends instructions to jump to the original entryPoint (the parameter)

Intel x32 Windows version

Returns the resulting shellcode

func ApplySuffixJmpIntel64

func ApplySuffixJmpIntel64(shellcode []byte, shellcodeVaddr uint32, entryPoint uint32, byteOrder binary.ByteOrder) []byte

ApplySuffixJmpIntel64 - Appends instructions to jump to the original entryPoint (the parameter)

Intel x64 Linux version

Returns the resulting shellcode

func PackIP

func PackIP(ip string) string

PackIP - packs an IP

func PackPort

func PackPort(port uint16) (string, error)

PackPort - packs a port

func PackUint16

func PackUint16(addr uint16) (string, error)

PackUint16 - packs a jump address

func PackUint32

func PackUint32(addr uint32) (string, error)

PackUint32 - packs a jump address

func PackUint64

func PackUint64(addr uint64) (string, error)

PackUint64 - packs a jump address

func PrintShellCodes

func PrintShellCodes(os Os, arch Arch)

PrintShellCodes - looks up shellcode by OS and architecture and prints the output

func RegisterShellCode

func RegisterShellCode(
	os Os,
	arch Arch,
	name string,
	fx func(Parameters) ([]byte, error))

RegisterShellCode - registers a shellcode generating function with the registry

Types

type Arch

type Arch string

Arch - Architecture Options Flag

type Bits

type Bits string

Bits - Bit Width Options Flag

type Generator

type Generator struct {
	Os       Os
	Arch     Arch
	Bit      Bits
	Name     string
	Function func(Parameters) ([]byte, error)
}

Generator - type for a shellcode generator

func LookupShellCode

func LookupShellCode(os Os, arch Arch) []Generator

LookupShellCode - looks up shellcode by OS and architecture

type Os

type Os string

Os - Operating System Options Flag

type ParamType

type ParamType byte
const (
	IP        ParamType = iota
	Port      ParamType = iota
	Entry     ParamType = iota
	Entry64   ParamType = iota
	ShellCode ParamType = iota
)

type Parameters

type Parameters struct {
	IP        string
	Port      uint16
	Entry     uint32
	Entry64   uint64
	ShellCode []byte
}

Parameters - config arguments for shellcode generating modules

func (Parameters) Require

func (p Parameters) Require(types []ParamType) error

Jump to

Keyboard shortcuts

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