stager

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package stager generates TCP stager binaries at runtime.

Shellcode is assembled directly in Go (like Metasm) and wrapped in a minimal ELF with fake section headers. No external compiler needed. The payload stream is XOR-encrypted with a per-generation random key.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func XOREncrypt

func XOREncrypt(data []byte, key [4]byte)

XOREncrypt applies the XOR key cyclically to data in-place.

Types

type Result

type Result struct {
	Binary []byte
	XORKey [4]byte
}

Result holds a generated stager binary and its XOR key. The server must XOR the size prefix and payload with this key before sending.

func Generate

func Generate(targetOS, arch, host string, port uint16) (*Result, error)

Generate builds a TCP stager ELF for the given OS/arch with host:port baked into the shellcode. Returns the binary and its XOR key - the server must encrypt the payload stream with this key.

Jump to

Keyboard shortcuts

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