util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64DecodeContent

func Base64DecodeContent(buf *string) (*bytes.Buffer, error)

func DownloadSample added in v0.2.0

func DownloadSample(hash string, apiKey string) (types.SampleState, error)

Download will take in a single hash and return potentially multiple states of the sample

func DumpRaw added in v0.2.0

func DumpRaw(states types.SampleState, hash string) error

DumpRaw will take the malware states object and dump all the files to the current directory

func DumpZip added in v0.2.0

func DumpZip(states types.SampleState, hash string, outZip string) error

DumpZip will take the malware states object and dump a single zip file to disk that contains all of the samples

func GetActorName

func GetActorName(inputActor string, apikey string) (string, error)

func GetFamilyName

func GetFamilyName(inputFamily string, apikey string) (string, error)

func HttpGetQuery

func HttpGetQuery(p types.Endpoint, apiKey string) ([]byte, error)

func HttpMultipartFileUpload

func HttpMultipartFileUpload(p types.Endpoint, apiKey string, body io.Reader, filename string) ([]byte, error)

func HttpRawFileUpload

func HttpRawFileUpload(p types.Endpoint, apiKey string, body io.Reader, filename string) ([]byte, error)

func IsAPIKeyValid added in v0.2.0

func IsAPIKeyValid(key string) bool

IsAPIKeyValid is a convenience function to check if there is an api key value

func PrettyPrintJson

func PrettyPrintJson(buf []byte) error

func Unzip

func Unzip(src string, dest string) error

Types

type Hash

type Hash int

Hash is a enum to support different types of hashes

const (
	// MD5 is the enum to compare against for MD5 hashes
	MD5 Hash = iota
	// SHA1 is the enum to compare against for SHA1 hashes
	SHA1
	// SHA256 is the enum to compare against for SHA256 hashes
	SHA256
)

func GetHashType

func GetHashType(hash string) (Hash, error)

Jump to

Keyboard shortcuts

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