mirror of https://gitee.com/openkylin/genmai.git
update all
This commit is contained in:
parent
7173da7cf7
commit
3ebb97a90a
4
main.go
4
main.go
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -4,8 +4,9 @@ import(
|
|||
"log"
|
||||
)
|
||||
|
||||
func SCPFile(){
|
||||
func SCPFile()string{
|
||||
|
||||
log.Println("SCP File success")
|
||||
|
||||
return ""
|
||||
}
|
Loading…
Reference in New Issue