pakkero

package
v0.0.0-...-8632201 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package pakkero will pack, compress and encrypt any type of executable. Encryption library

Package pakkero will pack, compress and encrypt any type of executable. Obfuscation library

Package pakkero will pack, compress and encrypt any type of executable.

Package pakkero will pack, compress and encrypt any type of executable. Utilities library

Index

Constants

View Source
const (
	SuccessColor = "\033[1;32m%s\033[0m"
	WarningColor = "\033[1;33m%s\033[0m"
	ErrorColor   = "\033[1;31m%s\033[0m"
)

Colors for strings.

View Source
const ERR = 1

ERR Is the exit Code 1.

View Source
const OK = 0

OK Is the exit Code 0.

Variables

View Source
var LauncherStub = "unset"

LauncherStub Stub of the Launcher.go, put here during compilation time.

View Source
var Secrets = map[string][]string{}

Secrets are the group of strings that we want to obfuscate.

Functions

func EncryptAESReversed

func EncryptAESReversed(plaintext []byte, outfile string) (string, error)

EncryptAESReversed Wrapper around AESGCM encryption

this will not only encrypt the payload but: - generate a password using the randomized UPX Binary's sha512_256 sum - cipher the payload with AESGCM using the generated password - swap endianess on all the encrypted bytes - reverse the complete payload.

func ExecCommand

func ExecCommand(name string, args []string) bool

ExecCommand is a wrapper arount exec.Command to execute a command and ensure it's result is not err.

func GenerateNullString

func GenerateNullString(n int) string

GenerateNullString will return a string with only void chars.

func GenerateRandomAntiDebug

func GenerateRandomAntiDebug(input string) string

GenerateRandomAntiDebug will Insert random order of anti-debug check together with inline compilation to induce big number of instructions in random order.

func GenerateRandomGarbage

func GenerateRandomGarbage(size int64) string

GenerateRandomGarbage creates random garbage to rise entropy.

func GenerateStringFunc

func GenerateStringFunc(txt string, function string) string

GenerateStringFunc will hide a string creating a function that returns that value as a string encoded with a series of length calculation of randomic string arrays generated.

func GenerateTyposquatName

func GenerateTyposquatName(length int) string

GenerateTyposquatName is a typosquat name generator based on a length (128 default) this will create a random uniqe string composed only of letters and zeroes that are lookalike.

func GzipContent

func GzipContent(input []byte) []byte

GzipContent an input byte slice and return it compressed.

func ObfuscateFuncVars

func ObfuscateFuncVars(input string) string

ObfuscateFuncVars will:

  • extract all obfuscation-enabled func and var names:
  • those start with "ob*" and will be listed
  • for each matching string generate a typosquatted random string and replace all string with that

func ObfuscateLauncher

func ObfuscateLauncher(infile string) error

ObfuscateLauncher the go code of the runner before compiling it.

Basic techniques are applied: - GenerateRandomAntiDebug - ObfuscateStrings - ObfuscateFuncVars.

func ObfuscateStrings

func ObfuscateStrings(input string) string

ObfuscateStrings will extract all plaintext strings denotet with backticks and obfuscate them using byteshift wise operations.

func Pakkero

func Pakkero(infile string, offset int64, outfile string, dependency string, compress bool, stdout bool)

Pakkero will Encrypt and pack the payload for a secure execution.

func Random

func Random(min, max int64) int64

Random will return a random number in a range.

func RandomInt64

func RandomInt64(max int64) int64

RandomInt64 will return a random number in a range.

func RegisterDependency

func RegisterDependency(dependency string)

RegisterDependency will take a file in input and register the Byte Frequency Distribution (BFD) and some other data to let the launcher do statystical analysis of the found files.

func ReverseByte

func ReverseByte(b byte) byte

ReverseByte will change a byte endianess.

func ReverseByteArray

func ReverseByteArray(input []byte) []byte

ReverseByteArray will reverse a slice of bytes.

func ReverseString

func ReverseString(input string) string

ReverseString reverse a string.

func ReverseStringArray

func ReverseStringArray(ss []string) []string

ReverseStringArray reverse a slice of strings.

func ShuffleSlice

func ShuffleSlice(in []string) []string

ShuffleSlice will shuffle a slice.

func StripFile

func StripFile(infile string, launcherFile string) bool

StripFile will strip out all unneeded headers from and ELF file in input.

func StripUPXHeaders

func StripUPXHeaders(infile string) bool

StripUPXHeaders will ensure no trace of UPX headers are left so that reversing will be more challenging and break simple attempts like "upx -d" in case of compression.

func Unique

func Unique(slice []string) []string

Unique will deduplicate a given slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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