exfil

package
v0.0.0-...-79400b6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ERR_PAYLOAD_INCOMPLETE = errors.New("Payload incomplete")

	TYPE_CONTENT packetType = 0
	TYPE_HEADER  packetType = 0x80000000
)
View Source
var (
	Mapping = map[rune]rune{
		'A': 'α', 'B': 'β', 'C': 'π', 'D': 'δ', 'E': 'ε', 'F': 'ϝ',
		'G': 'γ', 'H': 'σ', 'I': 'ι', 'J': 'φ', 'K': 'κ', 'L': 'λ',
		'M': 'χ', 'N': 'ν', 'O': 'ο', 'P': 'θ', 'Q': 'ψ', 'R': 'ρ',
		'S': 'ς', 'T': 'τ', 'U': 'μ', 'V': 'ω', 'W': 'Ϟ', 'X': 'ξ',
		'Y': 'υ', 'Z': 'ζ', '+': 'ƕ', '/': 'η',
	}

	ReverseMapping map[rune]rune
)
View Source
var (
	ERR_EXISTS        = errors.New("Id already in use")
	ERR_INCOMPLETE    = errors.New("File is incomplete")
	ERR_NOT_DECLARED  = errors.New("Id not declared")
	ERR_OUT_OF_BOUNDS = errors.New("Offset out of bounds")
)
View Source
var Encoding = base64.StdEncoding.WithPadding(base64.NoPadding)

Encoding configures the base64 library

Functions

func Decode

func Decode(payload string) (*packet, error)

Decode takes a partial domain and decodes it to a packat

func Encode

func Encode(data []byte) string

Encode binary data to subdomain(s)

func EncodeFile

func EncodeFile(filePath string) (chan string, error)

EncodeFile transforms a file into a series of messages

func GenContentMsg

func GenContentMsg(id uint32, offset uint32, data []byte) (string, error)

GenContentMsg generates a content message, transporting a chunk of the file

func GenHeaderMsg

func GenHeaderMsg(id uint32, name string, size uint32) (string, error)

GenHeaderMsg generates a header message, announcing the file to the server

func NewReceiver

func NewReceiver(dir string) *receiver

NewReceiver creates a receiver object

Types

type Exfil

type Exfil struct {
	Next plugin.Handler
	// contains filtered or unexported fields
}

Exfil implements a coredns plugin that is the receiver for dns exfiltrated data

func (Exfil) Name

func (e Exfil) Name() string

func (Exfil) ServeDNS

func (e Exfil) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS takes the requests and extracts the payload

Todo:

  • indicate success or failure to the client

type Uint32Slize

type Uint32Slize []uint32

Uint32Slize to make []uint32 sortable

func (Uint32Slize) Len

func (p Uint32Slize) Len() int

func (Uint32Slize) Less

func (p Uint32Slize) Less(i, j int) bool

func (Uint32Slize) Swap

func (p Uint32Slize) Swap(i, j int)

Jump to

Keyboard shortcuts

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