update all

This commit is contained in:
宋帮诚晋 2022-11-16 17:58:01 +08:00
parent 7173da7cf7
commit 3ebb97a90a
3 changed files with 15 additions and 5 deletions

View File

@ -76,8 +76,8 @@ func main(){
checkResult:=ArgParser.RemoteArgParser(vul.SSHHost,vul.SSHUser,vul.SSHPassword)
checkResult=strings.TrimSpace(checkResult)
if checkResult=="true"{
fmt.Println("不允许登录root用户进行验证")
log.Println("不允许登录root用户进行验证")
fmt.Println("不允许登录root/administrator用户进行验证")
log.Println("不允许登录root/administrator用户进行验证")
}else if checkResult=="false"{
ArgParser.ParameterParser(vul.System,vul.Kernel,vul.Web,vul.BaseLine,sAll,vul.PoolStatNum,vul.ParserNum,vul.Update,vul.IP)
}

View File

@ -7,7 +7,7 @@ import(
"main/src/genmai/RemoteCheck"
"strings"
"strconv"
// "log"
"log"
)
var RequestsWeb string
@ -148,10 +148,19 @@ func RemoteArgParser(SSHHost string,SSHUser string,SSHPassword string)(checkResu
if SSHHostCheck !="true"{
fmt.Println("host错误")
}else{
//解析远程连接的架构
command:="whoami"
result:=RemoteCheck.SSHConnect(SSHHost,SSHUser,SSHPassword,command)
checkResult=strconv.FormatBool(strings.Contains(result, "root"))
//windows高权校验
if checkResult!="true"{
checkResult=strconv.FormatBool(strings.Contains(result, "administrator"))
}else{
//SCP 文件
SCPFile:=RemoteCheck.SCPFile()
if SCPFile =="true"{
log.Println("scp file success")
}
}
}
}
return checkResult

View File

@ -4,8 +4,9 @@ import(
"log"
)
func SCPFile(){
func SCPFile()string{
log.Println("SCP File success")
return ""
}