bj

package
v0.0.0-...-605d46e Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: GPL-3.0 Imports: 15 Imported by: 8

Documentation

Index

Constants

View Source
const (
	PtNoteInject int = iota
	SilvioInject     = iota
)

Injection Methods

View Source
const (
	// ERROR - constant for an error
	ERROR = iota
	// ELF - constant for ELF binary format
	ELF = iota
	// MACHO - constant for Mach-O binary format
	MACHO = iota
	// FAT - constant for FAT/Mach-O binary format
	FAT = iota
	// PE - constant for PE binary format
	PE = iota
	// MIN_CAVE_SIZE - the smallest a code cave can be
	MIN_CAVE_SIZE = 94
)

Variables

This section is empty.

Functions

func BinaryMagic

func BinaryMagic(buf []byte) (int, error)

BinaryMagic - Identifies the Binary Format of a file by looking at its magic number

func BinaryMagicFile

func BinaryMagicFile(filename string) (int, error)

BinaryMagicFile - Identifies the Binary Format of a file by looking at its magic number

func Binject

func Binject(sourceBytes []byte, shellcodeBytes []byte, config *BinjectConfig) ([]byte, error)

Binject - Inject shellcode into a byte array

func BinjectFile

func BinjectFile(sourceFile string, destFile string, shellcodeFile string, config *BinjectConfig) error

BinjectFile - Inject shellcode into a binary file

func ElfBinject

func ElfBinject(sourceBytes []byte, shellcodeBytes []byte, config *BinjectConfig) ([]byte, error)

ElfBinject - Inject shellcode into an ELF binary

func MachoBinject

func MachoBinject(sourceBytes []byte, shellcodeBytes []byte, config *BinjectConfig) ([]byte, error)

MachoBinject - Inject shellcode into an Mach-O binary

func NoteToLoad

func NoteToLoad(elfFile *elf.File, userShellCode []byte, fsize int64) ([]byte, error)

NoteToLoad - PT_NOTE to PT_LOAD infection method *********************************** ***********************************

func PeBinject

func PeBinject(sourceBytes []byte, shellcodeBytes []byte, config *BinjectConfig) ([]byte, error)

PeBinject - Inject shellcode into an PE binary

func RandomString

func RandomString(len int) string

RandomString - generates random string of given length

Types

type BinjectConfig

type BinjectConfig struct {
	CodeCaveMode    bool
	InjectionMethod int

	Repo *shellcode.Repo
}

BinjectConfig - Configuration Settings for the Binject modules

type Cave

type Cave struct {
	Start, End uint64
}

Cave - structure describing a code cave

func FindCaves

func FindCaves(sourceBytes []byte) ([]Cave, error)

FindCaves - finds code caves in a byte array

func FindCavesFile

func FindCavesFile(sourceFile string) ([]Cave, error)

FindCavesFile - finds code caves in a file

Jump to

Keyboard shortcuts

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