Use smep/smap settings from artifact config as default value
This commit is contained in:
parent
d425f455bb
commit
08ed3461ad
20
debug.go
20
debug.go
@ -106,8 +106,18 @@ func debugHandler(kcfg config.KernelConfig, workPath, kernRegex, gdb string,
|
||||
}
|
||||
|
||||
q.SetKASLR(kaslr)
|
||||
q.SetSMEP(smep)
|
||||
q.SetSMAP(smap)
|
||||
|
||||
if !smep {
|
||||
q.SetSMEP(false)
|
||||
} else {
|
||||
q.SetSMEP(!ka.Mitigations.DisableSmep)
|
||||
}
|
||||
|
||||
if !smap {
|
||||
q.SetSMAP(false)
|
||||
} else {
|
||||
q.SetSMAP(!ka.Mitigations.DisableSmap)
|
||||
}
|
||||
|
||||
redgreen := func(name string, enabled bool) aurora.Value {
|
||||
if enabled {
|
||||
@ -117,8 +127,10 @@ func debugHandler(kcfg config.KernelConfig, workPath, kernRegex, gdb string,
|
||||
return aurora.BgRed(aurora.Gray(name))
|
||||
}
|
||||
|
||||
fmt.Printf("[*] %s %s %s\n", redgreen("KASLR", kaslr),
|
||||
redgreen("SMEP", smep), redgreen("SMAP", smap))
|
||||
fmt.Printf("[*] %s %s %s\n",
|
||||
redgreen("KASLR", q.GetKASLR()),
|
||||
redgreen("SMEP", q.GetSMEP()),
|
||||
redgreen("SMAP", q.GetSMAP()))
|
||||
|
||||
q.Debug(gdb)
|
||||
coloredGdbAddress := aurora.BgGreen(aurora.Black(gdb))
|
||||
|
@ -402,6 +402,21 @@ func (q *System) SetSMAP(state bool) {
|
||||
q.noSMAP = !state
|
||||
}
|
||||
|
||||
// GetKASLR is retrieve KASLR settings
|
||||
func (q *System) GetKASLR() bool {
|
||||
return !q.noKASLR
|
||||
}
|
||||
|
||||
// GetSMEP is retrieve SMEP settings
|
||||
func (q *System) GetSMEP() bool {
|
||||
return !q.noSMEP
|
||||
}
|
||||
|
||||
// GetSMAP is retrieve SMAP settings
|
||||
func (q *System) GetSMAP() bool {
|
||||
return !q.noSMAP
|
||||
}
|
||||
|
||||
// GetSSHCommand returns command for connect to qemu machine over ssh
|
||||
func (q System) GetSSHCommand() (cmd string) {
|
||||
addrPort := strings.Split(q.sshAddrPort, ":")
|
||||
|
Loading…
Reference in New Issue
Block a user