[ Server ] [ Server ] - 增加服务器角色部分的内容

This commit is contained in:
zeaslity
2023-10-08 14:30:17 +08:00
parent 9197031e81
commit 2594514a87
29 changed files with 416 additions and 209 deletions

View File

@@ -67,9 +67,9 @@ func Execute(em *ExecutionMessage) ([]string, error) {
resultLog = append(resultLog, "↓↓↓ 命令 Error 如下 ↓↓↓", err.Error())
}
// debug
commandResult := fmt.Sprintf("Excution Comand are=> %v, Executor Result: %v", realCommand, resultLog)
log.Info(commandResult)
log.Debug(commandResult)
return resultLog, err
}
@@ -119,12 +119,10 @@ func MultiLineCommandExecutor(multiLineCommandExecutor [][]string) ([]string, er
for _, singleLineCommand := range multiLineCommandExecutor {
singleLogs, err := AllOutputCommandExecutor(singleLineCommand)
res = append(res, singleLogs...)
if err != nil {
log.Error(fmt.Sprintf("Execution error ! command is %v, error is %v", singleLineCommand, err))
return res, err
}
}
return res, nil

View File

@@ -9,7 +9,8 @@ import (
)
var (
user32DLL = syscall.NewLazyDLL("user32.dll")
user32DLL = syscall.NewLazyDLL("user32.dll")
messageBox = user32DLL.NewProc("MessageBoxW")
)
@@ -24,6 +25,8 @@ func FindPublicIpAddress() {
ip := strings.TrimSpace(string(output))
fmt.Println("公网IP地址:", ip)
fmt.Println("")
}
func CallAgent() {
@@ -46,4 +49,5 @@ func CallAgent() {
}
fmt.Println("MessageBox returned:", ret)
}