-
Notifications
You must be signed in to change notification settings - Fork 0
/
option.go
95 lines (82 loc) · 1.48 KB
/
option.go
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package risk
func Name(v string) func(*Event) {
return func(ev *Event) {
switch v {
case "暴力破解":
ev.Class = TBrute
case "病毒事件":
ev.Class = TVirus
case "弱口令":
ev.Class = TWeakPass
case "数据爬虫":
ev.Class = TCrawler
case "蜜罐应用":
ev.Class = THoneyPot
case "web攻击":
ev.Class = TWeb
case "登录事件":
ev.Class = TLogin
case "监控事件":
ev.Class = TMonitor
case "未知事件":
ev.Class = TUnknown
default:
ev.Class = TUnknown
}
}
}
func Class(v TClass) func(*Event) {
return func(ev *Event) {
ev.Class = v
}
}
func Subject(f string, v ...interface{}) func(*Event) {
return func(ev *Event) {
ev.Subjectf(f, v...)
}
}
func Remote(v interface{}) func(*Event) {
return func(ev *Event) {
ev.Remote(v)
}
}
func RPort(v int) func(*Event) {
return func(ev *Event) {
ev.RemotePort = v
}
}
func Local(v interface{}) func(*Event) {
return func(ev *Event) {
ev.Local(v)
}
}
func LPort(v int) func(*Event) {
return func(ev *Event) {
ev.LocalPort = v
}
}
func Payload(f string, v ...interface{}) func(*Event) {
return func(ev *Event) {
ev.Payloadf(f, v...)
}
}
func Refer(v string) func(*Event) {
return func(ev *Event) {
ev.Reference = v
}
}
func Leve(v string) func(*Event) {
return func(ev *Event) {
ev.Leve(v)
}
}
func From(v interface{}) func(*Event) {
return func(ev *Event) {
ev.From(v)
}
}
func Alert(v bool) func(*Event) {
return func(ev *Event) {
ev.Alert = v
}
}