Documentation ¶
Index ¶
- Constants
- Variables
- func EncoderFromNonce(nonce uint64) (uint64, util.Encoder, error)
- func GetRandomID() uint64
- func PopulateID() []uint64
- func RandomEncoder() (uint64, util.Encoder)
- func RemoveTrafficEncoder(name string) error
- func SaveTrafficEncoder(name string, wasmBin []byte) error
- func SetupDefaultEncoders(name string) uint64
- type PassthroughEncoderFS
Constants ¶
View Source
const ( // EncoderModulus - The modulus used to calculate the encoder ID from a C2 request nonce // *** IMPORTANT *** ENCODER IDs MUST BE LESS THAN THE MODULUS EncoderModulus = uint64(65537) MaxN = uint64(9999999) )
Variables ¶
View Source
var ( TrafficEncoderFS = PassthroughEncoderFS{} Base64 = util.Base64{} Base58 = util.Base58{} Base32 = util.Base32{} Hex = util.Hex{} English = util.English{} Gzip = util.Gzip{} PNG = util.PNGEncoder{} Nop = util.NoEncoder{} NoEncoderID = uint64(0) Base64EncoderID = SetupDefaultEncoders("base64") Base58EncoderID = SetupDefaultEncoders("base58") Base32EncoderID = SetupDefaultEncoders("base32") HexEncoderID = SetupDefaultEncoders("hex") EnglishEncoderID = SetupDefaultEncoders("english") GzipEncoderID = SetupDefaultEncoders("gzip") PNGEncoderID = SetupDefaultEncoders("png") NopEncoderID = SetupDefaultEncoders("nop") )
View Source
var EncoderMap = map[uint64]util.Encoder{ Base64EncoderID: Base64, Base58EncoderID: Base58, Base32EncoderID: Base32, HexEncoderID: Hex, EnglishEncoderID: English, GzipEncoderID: Gzip, PNGEncoderID: PNG, }
EncoderMap - A map of all available encoders (native and traffic/wasm)
View Source
var FastEncoderMap = map[uint64]util.Encoder{ Base64EncoderID: Base64, Base58EncoderID: Base58, Base32EncoderID: Base32, HexEncoderID: Hex, GzipEncoderID: Gzip, }
FastEncoderMap - Keeps track of fast native encoders that can be used for large messages
View Source
var TrafficEncoderMap = map[uint64]*traffic.TrafficEncoder{}
TrafficEncoderMap - Keeps track of the loaded traffic encoders (i.e., wasm-based encoder functions)
Functions ¶
func EncoderFromNonce ¶
EncoderFromNonce - Convert a nonce into an encoder
func RandomEncoder ¶
RandomEncoder - Get a random nonce identifier and a matching encoder
func RemoveTrafficEncoder ¶
RemoveTrafficEncoder - Save a traffic encoder to the filesystem
func SaveTrafficEncoder ¶
SaveTrafficEncoder - Save a traffic encoder to the filesystem
func SetupDefaultEncoders ¶
Types ¶
type PassthroughEncoderFS ¶
type PassthroughEncoderFS struct {
// contains filtered or unexported fields
}
PassthroughEncoderFS - Creates an encoder.EncoderFS object from a single local directory
Click to show internal directories.
Click to hide internal directories.