mirror of https://gitee.com/openkylin/genmai.git
64 lines
1.8 KiB
Go
64 lines
1.8 KiB
Go
|
|
package main
|
|
|
|
import (
|
|
"main/src/Parser"
|
|
// "main/Pool"
|
|
"fmt"
|
|
"flag"
|
|
"strconv"
|
|
"main/src/Actuator"
|
|
genmai "main/src/genmai"
|
|
)
|
|
type Vul struct{
|
|
ParserNum int //协程数量
|
|
System string //执行系统漏洞检测
|
|
Web string //Web漏洞检测
|
|
Kernel string //内核漏洞检测
|
|
Fuzz string //Fuzz
|
|
BaseLine string //基线检测
|
|
Update string //更新软件
|
|
Docs string //生成报告
|
|
PoolStatNum int //启动协程任务数
|
|
}
|
|
func main(){
|
|
///////////////////////////////
|
|
// test "main/src/genmai"
|
|
genmai.Test()
|
|
// config := genmai.NewConfig()
|
|
fmt.Println(">>")
|
|
//fmt.Println(config["id"])
|
|
return
|
|
var vul Vul
|
|
result:=Actuator.OsCheck()
|
|
if result=="flase"{
|
|
return
|
|
}
|
|
flag.IntVar(&vul.ParserNum, "POOL_NUMS", 0, "set coprogram nums")
|
|
var System = flag.Bool("system", false, "Use only system")
|
|
var Kernel = flag.Bool("kernel", false, "Use only kernel")
|
|
var Web = flag.Bool("web", false, "Use only web")
|
|
var BaseLine = flag.Bool("baseline", false, "Use only baseline")
|
|
var All = flag.Bool("all", false, "'ALL' is check BaseLine、kernel and system")
|
|
var Update = flag.Bool("update", false, "update entire program")
|
|
vul.PoolStatNum =0
|
|
flag.Parse()
|
|
|
|
//初始化bool值
|
|
vul.System = strconv.FormatBool(*System)
|
|
vul.Kernel = strconv.FormatBool(*Kernel)
|
|
vul.Web = strconv.FormatBool(*Web)
|
|
vul.BaseLine = strconv.FormatBool(*BaseLine)
|
|
sAll :=strconv.FormatBool(*All)
|
|
vul.Update=strconv.FormatBool(*Update)
|
|
Parser.ParameterParser(vul.System,vul.Kernel,vul.Web,vul.BaseLine,sAll,vul.PoolStatNum,vul.ParserNum,vul.Update)
|
|
|
|
///////////////////////////////
|
|
// test "main/src/genmai"
|
|
genmai.Test()
|
|
// config := genmai.NewConfig()
|
|
fmt.Println(">>")
|
|
//fmt.Println(config["id"])
|
|
return
|
|
}
|