utils

package
v0.0.0-...-c72ab7c Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDirExists

func CheckDirExists(dirName string) bool

CheckDirExists - Check if the directory exists

func CheckElfExists

func CheckElfExists(fileName string) bool

CheckElfExists - Check if file exists and is an Elf file

func CheckFileExists

func CheckFileExists(fileName string) bool

CheckFileExists - check if the file exists

func CheckIfElf

func CheckIfElf(fileName string) bool

CheckIfElf - Check if the file is an Elf file

func FilePrinter

func FilePrinter(outputFormat string, data interface{}, colors interface{})

func FortifyPrinter

func FortifyPrinter(outputFormat string, data interface{}, colors interface{})

FortifyPrinter - Print the output from FortifyFile function

func GetAllFilesFromDir

func GetAllFilesFromDir(dirName string, recursive bool) []string

GetAllFilesFromDir - get the list of all elf files from a directory (or recursively)

func GetBinary

func GetBinary(fileName string) *elf.File

GetBinary - Return the binary details

func KernelPrinter

func KernelPrinter(outputFormat string, kernel any, kernelColors any)

func ParseKernel

func ParseKernel(filename string) (any, any)

ParseKernel - Parses the kernel config and runs the checks

func PrintLogo()

func RunFileChecks

func RunFileChecks(filename string) ([]interface{}, []interface{})

RunFileChecks - Run the file checks

Types

type FortifyCheck

type FortifyCheck struct {
	Name   string `json:"name"`
	Checks struct {
		Fortified     string `json:"fortified"`
		FortifyAble   string `json:"fortifyable"`
		FortifySource string `json:"fortify_source"`
		NoFortify     string `json:"noFortify"`
		LibcSupport   string `json:"libcSupport"`
		NumLibcFunc   string `json:"numLibcFunc"`
		NumFileFunc   string `json:"numFileFunc"`
	} `json:"checks"`
}

FortifyCheck struct for non-colored data, keeping a dedicated struct allows conversion without removing the colors

type FortifyCheckColor

type FortifyCheckColor struct {
	Name   string `json:"name"`
	Checks struct {
		Fortified          string `json:"fortified"`
		FortifyAble        string `json:"fortifyable"`
		FortifySource      string `json:"fortify_source"`
		FortifySourceColor string `json:"fortify_sourceColor"`
		NoFortify          string `json:"noFortify"`
		LibcSupport        string `json:"libcSupport"`
		LibcSupportColor   string `json:"libcSupportColor"`
		NumLibcFunc        string `json:"numLibcFunc"`
		NumFileFunc        string `json:"numFileFunc"`
	} `json:"checks"`
}

FortifyCheckColor struct for colored data

type KernelCheck

type KernelCheck struct {
	Name        string `json:"name"`
	Description string `json:"desc"`
	Value       string `json:"value"`
	CheckType   string `json:"type"`
}

type KernelCheckColor

type KernelCheckColor struct {
	Name        string `json:"name"`
	Description string `json:"desc"`
	Color       string `json:"color"`
	Value       string `json:"value"`
	CheckType   string `json:"type"`
}

type SecurityCheck

type SecurityCheck struct {
	Name   string `json:"name"`
	Checks struct {
		Canary        string `json:"canary"`
		Fortified     string `json:"fortified"`
		FortifyAble   string `json:"fortifyable"`
		FortifySource string `json:"fortify_source"`
		NX            string `json:"nx"`
		PIE           string `json:"pie"`
		Relro         string `json:"relro"`
		RPath         string `json:"rpath"`
		RunPath       string `json:"runpath"`
		Symbols       string `json:"symbols"`
	} `json:"checks"`
}

type SecurityCheckColor

type SecurityCheckColor struct {
	Name   string `json:"name"`
	Checks struct {
		Canary             string `json:"canary"`
		CanaryColor        string `json:"canaryColor"`
		Fortified          string `json:"fortified"`
		FortifyAble        string `json:"fortifyable"`
		FortifySource      string `json:"fortify_source"`
		FortifySourceColor string `json:"fortify_sourceColor"`
		NX                 string `json:"nx"`
		NXColor            string `json:"nxColor"`
		PIE                string `json:"pie"`
		PIEColor           string `json:"pieColor"`
		Relro              string `json:"relro"`
		RelroColor         string `json:"relroColor"`
		RPath              string `json:"rpath"`
		RPathColor         string `json:"rpathColor"`
		RunPath            string `json:"runpath"`
		RunPathColor       string `json:"runpathColor"`
		Symbols            string `json:"symbols"`
		SymbolsColor       string `json:"symbolsColor"`
	} `json:"checks"`
}

Jump to

Keyboard shortcuts

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