fix wrong token type

This commit is contained in:
wh1te909 2022-08-01 15:42:01 -07:00
parent 5bf3ef5356
commit 0c536f13b0

View File

@ -147,7 +147,7 @@ func (a *Agent) RunScript(code string, shell string, args []string, timeout int,
var timedOut = false
cmd := exec.Command(exe, cmdArgs...)
if runasuser {
token, err := wintoken.GetInteractiveToken(wintoken.TokenLinked)
token, err := wintoken.GetInteractiveToken(wintoken.TokenImpersonation)
if err != nil {
return "", err.Error(), 66, err
}
@ -277,7 +277,7 @@ func CMDShell(shell string, cmdArgs []string, command string, timeout int, detac
}
if runasuser {
token, err := wintoken.GetInteractiveToken(wintoken.TokenLinked)
token, err := wintoken.GetInteractiveToken(wintoken.TokenImpersonation)
if err != nil {
return [2]string{"", CleanString(err.Error())}, err
}