-
Notifications
You must be signed in to change notification settings - Fork 116
/
lib.go
82 lines (72 loc) · 2.4 KB
/
lib.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
package main
import (
"github.com/logrusorgru/aurora"
"github.com/yhy0/Jie/SCopilot"
"github.com/yhy0/Jie/conf"
"github.com/yhy0/Jie/crawler"
"github.com/yhy0/Jie/pkg/mode"
"github.com/yhy0/Jie/pkg/output"
"github.com/yhy0/logging"
"net/url"
)
/**
@author: yhy
@since: 2023/12/28
@desc: //TODO
**/
func lib() {
logging.Logger = logging.New(conf.GlobalConfig.Debug, "", "Jie", true)
conf.Init()
conf.GlobalConfig.Http.Proxy = ""
conf.GlobalConfig.WebScan.Craw = "k"
conf.GlobalConfig.WebScan.Poc = nil
conf.GlobalConfig.Reverse.Host = "https://dig.pm/"
conf.GlobalConfig.Passive.WebPort = "9088"
conf.GlobalConfig.Passive.WebUser = "yhy"
conf.GlobalConfig.Passive.WebPass = "123456" // 注意修改为强口令
conf.Preparations()
// 全部插件开启
for k := range conf.Plugin {
// if k == "nuclei" || k == "poc" {
// continue
// }
conf.Plugin[k] = true
}
if conf.GlobalConfig.Passive.WebPort != "" {
go SCopilot.Init()
}
// 初始化爬虫
crawler.NewCrawlergo(false)
go func() {
for v := range output.OutChannel {
// SCopilot 显示
if conf.GlobalConfig.Passive.WebPort != "" {
parse, err := url.Parse(v.VulnData.Target)
if err != nil {
logging.Logger.Errorln(err)
continue
}
msg := output.SCopilotData{
Target: v.VulnData.Target,
}
if v.Level == "Low" {
msg.InfoMsg = []output.PluginMsg{
{
Url: v.VulnData.Target,
Plugin: v.Plugin,
Result: []string{v.VulnData.Payload},
Request: v.VulnData.Request,
Response: v.VulnData.Response,
},
}
} else {
msg.VulMessage = append(msg.VulMessage, v)
}
output.SCopilot(parse.Host, msg)
logging.Logger.Infoln(aurora.Red(v.PrintScreen()).String())
}
logging.Logger.Infoln(aurora.Red(v.PrintScreen()).String())
}
}()
mode.Active("http://testphp.vulnweb.com/", nil)
}