Golang malware development framework
Introduction
ColdFire provides various methods useful for malware development in Golang.
Most functions are compatible with both Linux and Windows operating systems.
Installation
go get github.com/redcode-labs/ColdFire
Types of functions included
- Logging
- Auxiliary
- Reconnaissance
- Evasion
- Administration
- Sandbox detection
- Disruptive
Documentation
Logging functions
func F(s string, arg ...interface{}) string
Alias for fmt.Sprintffunc PrintGood(msg string)
Print good status message
func PrintInfo(msg string)
Print info status message
func PrintError(msg string)
Print error status message
func PrintWarning(msg string)
Print warning status message
Auxiliary functions
<div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="func FileToSlice(file string) []string Read from file and return slice with lines delimited with newline. func Contains(s interface{}, elem interface{}) bool Check if interface type contains another interface type. func StrToInt(string_integer string) int Convert string to int. func IntToStr(i int) string Converts int to string. func IntervalToSeconds(interval string) int Converts given time interval to seconds. func RandomInt(min int, max int) int Returns a random int from range. func RandomSelectStr(list []string) string Returns a random selection from slice of strings. func RandomSelectInt(list []int) int Returns a random selection from slice of ints. func RandomSelectStrNested(list [][]string) []string Returns a random selection from nested string slice. func RemoveNewlines(s string) string Removes "\n" and "\r" characters from string. func FullRemove(str string, to_remove string) string Removes all occurences of substring. func RemoveDuplicatesStr(slice []string) []string Removes duplicates from string slice. func RemoveDuplicatesInt(slice []int) []int Removes duplicates from int slice. func ContainsAny(str string, elements []string) bool Returns true if slice contains a string. func RandomString(n int) string Generates random string of length [n] func ExitOnError(e error) Handle errors func Md5Hash(str string) string Returns MD5 checksum of a string func MakeZip(zip_file string, files []string) error Creates a zip archive from a list of files func ReadFile(filename string) (string, error) Read contents of a file. func WriteFile(filename string) error Write contents to a file. func B64d(str string) string Returns a base64 decoded string func B64e(str string) string Returns a base64 encoded string func FileExists(file string) bool Check if file exists. func ParseCidr(cidr string) ([]string, error) Returns a slice containing all possible IP addresses in the given range. “>
func FileToSlice(file string) []string
Read from file and return slice with lines delimited with newline.func Contains(s interface{}, elem interface{}) bool
Check if interface type contains another interface type.
func StrToInt(string_integer string) int
Convert string to int.
func IntToStr(i int) string
Converts int to string.
func IntervalToSeconds(interval string) int
Converts given time interval to seconds.
func RandomInt(min int, max int) int
Returns a random int from range.
func RandomSelectStr(list []string) string
Returns a random selection from slice of strings.
func RandomSelectInt(list []int) int
Returns a random selection from slice of ints.
func RandomSelectStrNested(list [][]string) []string
Returns a random selection from nested string slice.
func RemoveNewlines(s string) string
Removes "\n" and "\r" characters from string.
func FullRemove(str string, to_remove string) string
Removes all occurences of substring.
func RemoveDuplicatesStr(slice []string) []string
Removes duplicates from string slice.
func RemoveDuplicatesInt(slice []int) []int
Removes duplicates from int slice.
func ContainsAny(str string, elements []string) bool
Returns true if slice contains a string.
func RandomString(n int) string
Generates random string of length [n]
func ExitOnError(e error)
Handle errors
func Md5Hash(str string) string
Returns MD5 checksum of a string
func MakeZip(zip_file string, files []string) error
Creates a zip archive from a list of files
func ReadFile(filename string) (string, error)
Read contents of a file.
func WriteFile(filename string) error
Write contents to a file.
func B64d(str string) string
Returns a base64 decoded string
func B64e(str string) string
Returns a base64 encoded string
func FileExists(file string) bool
Check if file exists.
func ParseCidr(cidr string) ([]string, error)
Returns a slice containing all possible IP addresses in the given range.