ssce

package module
v0.0.0-...-2da3c40 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

README

SSCE

A simple shellcode encoder, build and erase decoder at runtime and erase shellcode after execution.

Usage

ssce -arch 64 -i shellcode.bin -o shellcode_x64.bin

Development

package main

import (
    "encoding/hex"
    "fmt"
    "os"

    "github.com/RSSU-Shellcode/SSCE"
)

func main() {
    encoder := ssce.NewEncoder(0)

    shellcode, err := os.ReadFile("shellcode.bin")
    checkError(err)

    opts := ssce.Options{
        NumIterator: 4,
        NumTailInst: 64,
        MinifyMode:  false,
        SaveContext: false,
        EraseInst:   false,
        NoIterator:  false,
        NoGarbage:   false,
    }

    shellcode, err = encoder.Encode(shellcode, 64, &opts)
    checkError(err)

    out := hex.EncodeToString(shellcode)
    fmt.Println(out)

    err = encoder.Close()
    checkError(err)
}

func checkError(err error) {
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

Encoder is a simple shellcode encoder.

func NewEncoder

func NewEncoder(seed int64) *Encoder

NewEncoder is used to create a simple shellcode encoder.

func (*Encoder) Close

func (e *Encoder) Close() error

Close is used to close shellcode encoder.

func (*Encoder) Encode

func (e *Encoder) Encode(shellcode []byte, arch int, opts *Options) ([]byte, error)

Encode is used to encode input shellcode to a unique shellcode.

func (*Encoder) Seed

func (e *Encoder) Seed() int64

Seed is used to get the random seed for debug.

type Options

type Options struct {
	NumIterator int
	NumTailInst int

	MinifyMode  bool
	SaveContext bool
	EraseInst   bool
	NoIterator  bool
	NoGarbage   bool

	RandSeed int64
	TrimSeed bool

	X86MiniDecoder string
	X64MiniDecoder string
	X86Loader      string
	X64Loader      string
}

Options contains options about encode shellcode.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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