Documentation ¶
Index ¶
- func AppendTextToFile(filename string, text string) (err error)
- func AppendToFile(filename string, data []byte) (err error)
- func CheckProduct(info *ghw.ProductInfo) (product string)
- func Copy(src, dst string) error
- func DigEmbeddedData(data []byte) (embedded_data []byte, err error)
- func DigEmbeddedDataFromExe() ([]byte, error)
- func DigEmbededDataFromMem() (data []byte, err error)
- func DumpSelfMem() ([][]byte, error)
- func ExtractData() (data []byte, err error)
- func FileAllocate(filepath string, n int64) (err error)
- func FileBaseName(filepath string) (filename string)
- func FileSize(path string) (size int64)
- func FindHolesInBinary(fdata []byte, size int64) (indexes []int64, err error)
- func GetCPUInfo() (info string)
- func GetChildren(pid int) (children []int, err error)
- func GetGPUInfo() (info string)
- func GetHostID(info *ghw.ProductInfo, fallbackUUID string) (id string)
- func GetMemSize() int
- func GetProcessExe(pid int) (exe_data []byte, err error)
- func GetProductInfo() (product *ghw.ProductInfo, err error)
- func GetUsername() string
- func HexEncode(s string) (result string)
- func IntArrayToStringArray(arr []int) []string
- func IsCommandExist(exe string) bool
- func IsDirExist(path string) bool
- func IsExist(path string) bool
- func IsFileExist(path string) bool
- func IsPIDAlive(pid int) (alive bool)
- func IsProcAlive(procName string) (alive bool, procs []*os.Process)
- func IsStrInFile(text, filepath string) bool
- func LogFilePrintf(filepath, format string, v ...any)
- func LsPath(path string) (res string, err error)
- func MemFDWrite(data []byte) int
- func ParseCmd(cmd string) (parsed_cmd []string)
- func PidOf(name string) []int
- func ProcCmdline(pid int) string
- func ProcCwd(pid int) string
- func ProcExePath(pid int) string
- func RandBytes(n int) []byte
- func RandInt(min, max int) int
- func RandStr(n int) string
- func RemoveDupsFromArray[T string | int](sliceList []T) []T
- func RemoveItemFromArray[T string | int](to_remove T, sliceList []T) []T
- func ReplaceBytesInFile(path string, old []byte, replace_with []byte) (err error)
- func ReverseString(s string) string
- func ScanPATH() (exes []string)
- func SplitLongLine(line string, linelen int) (ret string)
- func TakeABlink()
- func TakeASnap()
- func TarXZ(dir, outfile string) error
- type Dentry
- type FileStat
- type ProcEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendTextToFile ¶
AppendTextToFile append text to a file
func AppendToFile ¶
AppendToFile append bytes to a file
func CheckProduct ¶
func CheckProduct(info *ghw.ProductInfo) (product string)
CheckProduct check machine details
func DigEmbeddedData ¶
DigEmbeddedData search for embedded data in given []byte buffer
func DigEmbeddedDataFromExe ¶
DigEmbededDataFromFile search args[0] file content for data embeded between two separators separator is MagicString*3
func DigEmbededDataFromMem ¶
DigEmbededDataFromMem search process memory for data embeded between two separators separator is MagicString*3
func DumpSelfMem ¶
DumpSelfMem dump all mapped memory regions of current process
func ExtractData ¶
ExtractData extract embedded data from args[0] or process memory
func FileAllocate ¶
FileAllocate allocate n bytes for a file, will delete the target file if already exists
func FileBaseName ¶
FileBaseName /path/to/foo -> foo
func FindHolesInBinary ¶
FindHolesInBinary find holes in a binary file that are big enough for a payload
func GetCPUInfo ¶
func GetCPUInfo() (info string)
func GetChildren ¶
Get children processes of a process
func GetGPUInfo ¶
func GetGPUInfo() (info string)
func GetHostID ¶
func GetHostID(info *ghw.ProductInfo, fallbackUUID string) (id string)
GetHostID unique identifier of the host
func GetMemSize ¶
func GetMemSize() int
func GetProcessExe ¶
GetProcessExe dump executable of target process
func GetProductInfo ¶
func GetProductInfo() (product *ghw.ProductInfo, err error)
func GetUsername ¶
func GetUsername() string
func IntArrayToStringArray ¶
IntArrayToStringArray convert int array to string array
func IsCommandExist ¶
IsCommandExist check if an executable is in $PATH
func IsProcAlive ¶
IsProcAlive check if a process name exists, returns its process(es)
func IsStrInFile ¶
IsStrInFile works like grep, check if a string is in a text file
func LogFilePrintf ¶
func MemFDWrite ¶
MemFDWrite create a memfd and write data to it returns the fd
func RemoveDupsFromArray ¶
RemoveDupsFromArray remove duplicated string/int from slice
func RemoveItemFromArray ¶
RemoveItemFromArray remove string/int from slice
func ReplaceBytesInFile ¶
func ReverseString ¶
Types ¶
type Dentry ¶
type Dentry struct { Name string `json:"name"` // filename Ftype string `json:"ftype"` // file/dir Size string `json:"size"` // 100 Date string `json:"date"` // 2021-01-01 Owner string `json:"owner"` // jm33 Permission string `json:"perm"` // -rwxr-xr-x }
Dentry Directory entry
type FileStat ¶
type FileStat struct { Name string `json:"name"` Permission string `json:"permission"` Checksum string `json:"checksum"` Size int64 `json:"size"` }
FileStat stat info of a file