Documentation ¶
Index ¶
- Constants
- Variables
- func AppendToFile(path string, s string) error
- func Base32DecodeStr(s string) (string, error)
- func Base32EncodeStr(s string) string
- func Base64DecodeStr(s string) (string, error)
- func Base64EncodeStr(s string) string
- func CheckHooks(path string) ([]string, error)
- func Chmod(path string, perms os.FileMode) error
- func CmdNoOut(command string)
- func CmdReturn(command string) (string, error)
- func CmdStdOUT(command string)
- func CopyFile(sourcePath string, destinationPath string) error
- func DecryptBytes(message []byte, key []byte) ([]byte, error)
- func DecryptString(s string, key []byte) (string, error)
- func DeleteDir(dir string) error
- func DeleteFile(path string) error
- func DoesFileExist(path string) bool
- func DownFile(source string, dest string) error
- func EncryptBytes(message []byte, key []byte) ([]byte, error)
- func EncryptString(s string, key []byte) ([]byte, error)
- func Error(err string)
- func GenerateIV() ([]byte, error)
- func GenerateKey() ([]byte, error)
- func GenerateSecureBytes(l int) ([]byte, error)
- func GetAllUsernames() ([]string, error)
- func GetAllUsers() ([]*user.User, error)
- func GetCurrentGid() (string, error)
- func GetCurrentGids() ([]string, error)
- func GetCurrentPid() int
- func GetCurrentPpid() int
- func GetCurrentProcArch() string
- func GetCurrentProcName() (string, error)
- func GetCurrentProcPath() (string, error)
- func GetCurrentToken() (windows.Token, error)
- func GetCurrentUid() (string, error)
- func GetCurrentUser() (*user.User, error)
- func GetCurrentUsername() (string, error)
- func GetDomainName() (string, error)
- func GetEnvironmentVariables() []string
- func GetHostname() (string, error)
- func GetNameFromPid(pid int) (string, error)
- func GetNameFromUid(uid string) (string, error)
- func GetOS() string
- func GetOSBuild() string
- func GetOSVersion() string
- func GetPidFromName(name string) ([]int, error)
- func GetPipes() ([]string, error)
- func GetPwd() (string, error)
- func GetTokenFromName(procName string) (windows.Token, error)
- func GetTokenFromPid(pid int) (windows.Token, error)
- func GetUidFromName(name string) (string, error)
- func GetUserFromName(name string) (*user.User, error)
- func GetUserFromUid(uid string) (*user.User, error)
- func Info(message string)
- func IsHostUp(host string) (bool, error)
- func IsUrlUp(url string) bool
- func ListFiles(dir string) ([]string, error)
- func ListFilesInPwd() ([]string, error)
- func Md5File(path string) string
- func Md5String(s string) string
- func MoveFile(sourcePath string, destinationPath string) error
- func NewFile(path string) error
- func NewFileWithContent(path string, content string) error
- func Okay(message string)
- func PrependToFile(path string, s string) error
- func PsNoOut(command string)
- func PsNoOutT(command string, token windows.Token)
- func PsReturn(command string) (string, error)
- func PsReturnT(command string, token windows.Token) (string, error)
- func PsStdOut(command string)
- func PsStdOutT(command string, token windows.Token)
- func RandomInt(min int, max int) (int, error)
- func RandomStr(l int) string
- func RandomStrFromCharset(l int, charset string) string
- func RandomStrI(l int) string
- func ReadFileToSlice(path string) ([]string, error)
- func ReadFileToString(path string) (string, error)
- func RotX(s string, shift rune) string
- func ScanPortsAll(host string) []int
- func ScanPortsCommon(host string) []int
- func Sha1File(path string) string
- func Sha1String(s string) string
- func Sha256File(path string) string
- func Sha256String(s string) string
- func Sha512File(path string) string
- func Sha512String(s string) string
- func Uptime() int
- func Warn(message string)
- func WipeFile(path string) error
- func ZipFiles(paths []string, zipFileName string) error
- type WinProcess
Constants ¶
const NTDLL_Path = "C:\\Windows\\System32\\ntdll.dll"
const TH32CS_SNAPPROCESS = 0x00000002
const VER_NT_WORKSTATION = 0x0000001
Variables ¶
var ( ErrFunction_Not_Supported = errors.New("function currently not supported") // function is not currently implemented ErrPid_Not_Found = errors.New("pid not found") // pid was not found on system ErrProcess_Not_Found = errors.New("a process with that name was not found") // process was not found on system ErrFile_Not_Found = errors.New("the provided file path was not found on the system") // a provided path was not found ErrFile_Not_DLL = errors.New("the provided file is not a dll") // file needed is a dll and provided file is not a dll )
Functions ¶
func AppendToFile ¶
append text to a file creates a new last line
func Base32DecodeStr ¶ added in v0.2.0
decode a string from base32
func Base32EncodeStr ¶ added in v0.2.0
encode a string to base32
func CheckHooks ¶ added in v0.2.2
detect whether any functions in a dll are hooked by AV/EDR defaults to NTDLL, leave blank for default otherwise provide a full path to dll
func CmdStdOUT ¶ added in v0.2.0
func CmdStdOUT(command string)
will run cmd.exe and print output to STDOUT
func DecryptBytes ¶ added in v0.2.1
decrypt []byte with given key
func DecryptString ¶ added in v0.2.1
return a decrypted string using given key
func DoesFileExist ¶
check if a file exists returns true if file exists
func EncryptBytes ¶ added in v0.2.1
encrypt a []byte using given key
func EncryptString ¶ added in v0.2.1
return encrypted string using given key
func GenerateSecureBytes ¶ added in v0.2.1
generate a secure []byte of length l
func GetAllUsernames ¶ added in v0.2.0
return a slice of all usernames on the machine
func GetAllUsers ¶ added in v0.2.0
return a slice of all users on the machine
func GetCurrentGid ¶ added in v0.2.0
get the main gid for the current user
func GetCurrentGids ¶ added in v0.2.0
get all gids for the current user
func GetCurrentProcArch ¶ added in v0.2.0
func GetCurrentProcArch() string
get the arch of the current process
func GetCurrentProcName ¶ added in v0.2.0
get the name of the current process
func GetCurrentProcPath ¶ added in v0.2.0
get the path of the current process
func GetCurrentToken ¶ added in v0.2.0
get the token from the current process
func GetCurrentUser ¶ added in v0.2.0
return a user.User for the current user
func GetCurrentUsername ¶ added in v0.2.0
get the current username
func GetEnvironmentVariables ¶ added in v0.2.2
func GetEnvironmentVariables() []string
return a slice of environment variables on system
func GetNameFromPid ¶ added in v0.2.0
get the name from the pid
func GetNameFromUid ¶ added in v0.2.0
return a username from a given uid
func GetPidFromName ¶ added in v0.2.0
return the pid(s) from the process name
func GetTokenFromName ¶ added in v0.2.0
get the token from a process given its process name
func GetTokenFromPid ¶ added in v0.2.0
get the token from a process given its pid
func GetUidFromName ¶ added in v0.2.0
return a uid from a given username
func GetUserFromName ¶ added in v0.2.0
return a user.User from username
func GetUserFromUid ¶ added in v0.2.0
return a user.User from uid
func ListFilesInPwd ¶ added in v0.2.0
return a slice of files in the present working dir
func NewFileWithContent ¶ added in v0.2.0
create a new file containing content
func PrependToFile ¶
prepend text to a file creates a new first line
func PsNoOut ¶ added in v0.2.0
func PsNoOut(command string)
will run powershell command and provide no output
func PsStdOut ¶ added in v0.2.0
func PsStdOut(command string)
will run powershell command and print output to STDOUT
func PsStdOutT ¶ added in v0.2.0
will run powershell command and print output to STDOUT (with token)
func RandomStrFromCharset ¶ added in v0.2.0
returns a random string from provided charset of length l
func RandomStrI ¶ added in v0.2.0
returns a random string combining letters and numbers of length l uses a-zA-Z0-9
func ReadFileToSlice ¶
read a file line by line and return a slice with each line as a value
func ReadFileToString ¶ added in v0.2.0
read a file and return a string of its content
func ScanPortsCommon ¶ added in v0.2.2
scan top 500 most common ports on a host
func Sha256String ¶ added in v0.2.0
get the sha256 hash of a string
func Sha512String ¶ added in v0.2.0
get the sha512 hash of a string
Types ¶
type WinProcess ¶ added in v0.2.0
windows process type structure
func ListAllProcesses ¶ added in v0.2.0
func ListAllProcesses() ([]WinProcess, error)
list all running processes