forked from lcvvvv/kscan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkscan.go
More file actions
60 lines (53 loc) · 1.4 KB
/
Copy pathkscan.go
File metadata and controls
60 lines (53 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package main
import (
"github.com/lcvvvv/gonmap"
"kscan/app"
"kscan/lib/httpfinger"
"kscan/lib/params"
"kscan/lib/slog"
"kscan/run"
"os"
"time"
)
func main() {
switch os.Args[1] {
case "fofa":
fofa()
case "ctl":
ctl()
default:
kscan()
}
}
func kscan() {
startTime := time.Now()
//参数初始化
params.InitKscan()
//日志初始化
slog.Init(params.Params.Debug)
//参数合法性校验
params.KscanCheckParams()
//配置文件初始化
app.Config.Load(params.Params)
slog.Warning("开始读取扫描对象...")
slog.Infof("成功读取URL地址:[%d]个\n", len(app.Config.UrlTarget))
slog.Infof("成功读取主机地址:[%d]个,待检测端口:[%d]个\n", len(app.Config.HostTarget), len(app.Config.HostTarget)*len(app.Config.Port))
//HTTP指纹库初始化
r := httpfinger.Init()
slog.Infof("成功加载favicon指纹:[%d]条,keyword指纹:[%d]条\n", r["FaviconHash"], r["KeywordFinger"])
//加载gonmap探针/指纹库
r = gonmap.Init(5, app.Config.Timeout)
slog.Infof("成功加载NMAP探针:[%d]个,指纹[%d]条\n", r["PROBE"], r["MATCH"])
slog.Warningf("本次扫描将使用NMAP探针:[%d]个,指纹[%d]条\n", r["USED_PROBE"], r["USED_MATCH"])
//校验升级情况
//app.CheckUpdate()
//开始扫描
run.Start()
//计算程序运行时间
elapsed := time.Since(startTime)
slog.Infof("程序执行总时长为:[%s]", elapsed.String())
}
func ctl() {
}
func fofa() {
}