Documentation ¶
Index ¶
- Constants
- Variables
- func CallFirstParam(regs syscall.PtraceRegs) uint64
- func CallFourthParam(regs syscall.PtraceRegs) uint64
- func CallNumber(regs syscall.PtraceRegs) uint64
- func CallReturnValue(regs syscall.PtraceRegs) uint64
- func CallSecondParam(regs syscall.PtraceRegs) uint64
- func CallThirdParam(regs syscall.PtraceRegs) uint64
- func IsOSShellsFile(name string) bool
- func IsShellExePath(name string) bool
- func LookupCallName(num uint32) string
- func LookupCallNumber(name string) (uint32, bool)
- func ResolveGroup(identity string) (uint32, error)
- func ResolveUser(identity string) (uid uint32, gid uint32, home string, err error)
- type ArchBits
- type ArchFamily
- type ArchInfo
- type ArchName
- type DistroInfo
- type KernelFeatures
- func (p *KernelFeatures) IsCompiled(name string) (bool, error)
- func (p *KernelFeatures) IsConfigured(name string) bool
- func (p *KernelFeatures) IsFlag(name string) (bool, error)
- func (p *KernelFeatures) IsLoadable(name string) (bool, error)
- func (p *KernelFeatures) RawValue(name string) (string, error)
- type MachineName
- type NameResolverFunc
- type NumberResolverFunc
- type OSShell
- type SystemInfo
Constants ¶
View Source
const ( OSShellAshExePath = "/bin/ash" OSShellBourneExePath = "/bin/sh" OSShellKornExePath = "/bin/ksh93" //usually a link to /bin/ksh93 OSShellRestrictedKornExePath = "/bin/rksh93" //usually a link to /etc/alternatives/ksh //which links to /bin/ksh93 OSShellKorn2ExePath = "/bin/ksh" OSShellBashExePath = "/bin/bash" //usually a link to /bin/bash OSShellRestrictedBashExePath = "/bin/rbash" OSShellDashExePath = "/bin/dash" OSShellZExePath = "/bin/zsh" //usually a link to /bin/zsh OSShellZ2ExePath = "/usr/bin/zsh" OSShellCExePath = "/bin/csh" OSShellTCExePath = "/bin/tcsh" OSShellFishExePath = "/usr/bin/fish" OSShellElvishExePath = "/usr/bin/elvish" OSShellXonshExePath = "/usr/bin/xonsh" OSShellYashExePath = "/usr/bin/yash" OSShellGitShellExePath = "/usr/bin/git-shell" OSShellScreenExePath = "/usr/bin/screen" OSShellTmuxExePath = "/usr/bin/tmux" )
Common linux shell exe paths
View Source
const ( SyscallX86MinNum = 0 SyscallX86UnknownNum = -1 SyscallX86UnknownName = "unknown_syscall" )
View Source
const ( SyscallArmUnknownNum = -1 SyscallArmUnknownName = "unknown_syscall" SyscallArmMinNum32 = 0 SyscallArmMaxNum32 = 462 SyscallArmLastName32 = "mseal" )
View Source
const ( SyscallArmUnknownNum64 = -1 SyscallArmUnknownName64 = "unknown_syscall" SyscallArmMinNum64 = 0 SyscallArmMaxNum64 = 462 SyscallArmLastName64 = "mseal" )
View Source
const ( SyscallX86MaxNum32 = 462 SyscallX86LastName32 = "mseal" )
View Source
const ( SyscallX86MaxNum64 = 462 SyscallX86LastName64 = "mseal" )
View Source
const (
OSShellsFile = "/etc/shells"
)
Variables ¶
View Source
var ( ErrNotConfigured = errors.New("feature is not configured") ErrNoConfigs = errors.New("no kernel configs") ErrArchNotSupported = errors.New("unsupported architecture") )
View Source
var ArmFamily32Arch = ArchInfo{ Name: ArchNameArm32, Family: ArchFamilyArm, Bits: ArchBits32, }
View Source
var ArmFamily64Arch = ArchInfo{ Name: ArchNameArm64, Family: ArchFamilyArm, Bits: ArchBits64, }
View Source
var DefaultKernelFeatures, _ = NewKernelFeatures()
View Source
var OSShellReferences = map[string]string{ OSShellBourneExePath: OSShellBourneExePath, OSShellKornExePath: OSShellKornExePath, OSShellKorn2ExePath: OSShellKornExePath, OSShellRestrictedKornExePath: OSShellKornExePath, OSShellBashExePath: OSShellBashExePath, OSShellRestrictedBashExePath: OSShellBashExePath, OSShellDashExePath: OSShellDashExePath, OSShellZExePath: OSShellZExePath, OSShellZ2ExePath: OSShellZExePath, OSShellCExePath: OSShellCExePath, OSShellTCExePath: OSShellTCExePath, OSShellFishExePath: OSShellFishExePath, OSShellElvishExePath: OSShellElvishExePath, OSShellXonshExePath: OSShellXonshExePath, OSShellYashExePath: OSShellYashExePath, OSShellAshExePath: OSShellAshExePath, OSShellGitShellExePath: OSShellGitShellExePath, OSShellScreenExePath: OSShellScreenExePath, OSShellTmuxExePath: OSShellTmuxExePath, }
View Source
var OSShells = map[string]OSShell{ OSShellBourneExePath: { FullName: "Bourne shell", ShortName: "sh", ExePath: OSShellBourneExePath, }, OSShellKornExePath: { FullName: "Korn shell", ShortName: "ksh", ExePath: OSShellKornExePath, }, OSShellBashExePath: { FullName: "Bash shell", ShortName: "bash", ExePath: OSShellBashExePath, }, OSShellDashExePath: { FullName: "Dash shell", ShortName: "dash", ExePath: OSShellDashExePath, }, OSShellZExePath: { FullName: "Z shell", ShortName: "zsh", ExePath: OSShellZExePath, }, OSShellCExePath: { FullName: "C shell", ShortName: "csh", ExePath: OSShellCExePath, }, OSShellTCExePath: { FullName: "TC shell", ShortName: "tcsh", ExePath: OSShellTCExePath, }, OSShellFishExePath: { FullName: "Fish shell", ShortName: "fish", ExePath: OSShellFishExePath, }, OSShellElvishExePath: { FullName: "Elvish shell", ShortName: "elvish", ExePath: OSShellElvishExePath, }, OSShellXonshExePath: { FullName: "Xonsh shell", ShortName: "xonsh", ExePath: OSShellXonshExePath, }, OSShellYashExePath: { FullName: "Yash shell", ShortName: "yash", ExePath: OSShellYashExePath, }, OSShellAshExePath: { FullName: "Ash shell", ShortName: "ash", ExePath: OSShellAshExePath, }, OSShellGitShellExePath: { FullName: "Git shell", ShortName: "git-shell", ExePath: OSShellGitShellExePath, }, OSShellScreenExePath: { FullName: "Screen", ShortName: "screen", ExePath: OSShellScreenExePath, }, OSShellTmuxExePath: { FullName: "Tmux", ShortName: "tmux", ExePath: OSShellTmuxExePath, }, }
Functions ¶
func CallFirstParam ¶
func CallFirstParam(regs syscall.PtraceRegs) uint64
func CallFourthParam ¶
func CallFourthParam(regs syscall.PtraceRegs) uint64
func CallNumber ¶
func CallNumber(regs syscall.PtraceRegs) uint64
func CallReturnValue ¶
func CallReturnValue(regs syscall.PtraceRegs) uint64
func CallSecondParam ¶
func CallSecondParam(regs syscall.PtraceRegs) uint64
func CallThirdParam ¶
func CallThirdParam(regs syscall.PtraceRegs) uint64
func IsOSShellsFile ¶
func IsShellExePath ¶
func LookupCallName ¶
func LookupCallNumber ¶
func ResolveGroup ¶
Types ¶
type ArchFamily ¶
type ArchFamily string
const ( ArchFamilyX86 ArchFamily = "x86" ArchFamilyArm ArchFamily = "arm" ArchFamilyArm64 ArchFamily = "arm64" )
type ArchInfo ¶
type ArchInfo struct { Name ArchName Family ArchFamily Bits ArchBits }
func MachineToArch ¶
type DistroInfo ¶
type KernelFeatures ¶
func NewKernelFeatures ¶
func NewKernelFeatures() (KernelFeatures, error)
func NewKernelFeaturesWithProps ¶
func NewKernelFeaturesWithProps(location string) (KernelFeatures, error)
func (*KernelFeatures) IsCompiled ¶
func (p *KernelFeatures) IsCompiled(name string) (bool, error)
func (*KernelFeatures) IsConfigured ¶
func (p *KernelFeatures) IsConfigured(name string) bool
func (*KernelFeatures) IsLoadable ¶
func (p *KernelFeatures) IsLoadable(name string) (bool, error)
type MachineName ¶
type MachineName string
const ( MachineNameNamei386 MachineName = "i386" MachineNameNamei586 MachineName = "i586" MachineNameNamei686 MachineName = "i686" MachineNameNamex86_64 MachineName = "x86_64" MachineNameNameArm MachineName = "armv7l" MachineNameNameArm64 MachineName = "aarch64" )
type NameResolverFunc ¶
func CallNameResolver ¶
func CallNameResolver(arch ArchName) NameResolverFunc
type NumberResolverFunc ¶
func CallNumberResolver ¶
func CallNumberResolver(arch ArchName) NumberResolverFunc
type OSShell ¶
type OSShell struct { FullName string `json:"full_name"` ShortName string `json:"short_name,omitempty"` ExePath string `json:"exe_path"` LinkPath string `json:"link_path,omitempty"` Reference string `json:"reference,omitempty"` Verified bool `json:"verified,omitempty"` }
func LookupShellByExePath ¶
func NewOSShells ¶
func NewOSShellsFromData ¶
func ParseOSShells ¶
type SystemInfo ¶
type SystemInfo struct { Sysname string Nodename string Release string Version string Machine string Domainname string OsBuild string Distro DistroInfo }
func GetSystemInfo ¶
func GetSystemInfo() SystemInfo
Source Files ¶
Click to show internal directories.
Click to hide internal directories.