-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathconfig.go
217 lines (205 loc) · 5.91 KB
/
config.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
package Utils
import (
"github.com/tidwall/gjson"
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type ENOptions struct {
KeyWord string // Keyword of Search
CompanyID string // Company ID
GroupID string // Company ID
InputFile string // Scan Input File
Output string
//CookieInfo string
ScanType string
Proxy string
//ISKeyPid bool
IsGroup bool
IsGetBranch bool
IsSearchBranch bool
//IsInvestRd bool
//IsEmailPro bool
InvestNum float64
DelayTime int
DelayMaxTime int64
TimeOut int
//GetFlags string
//Version bool
//IsBiuCreate bool
IsHold bool
IsSupplier bool
IsShow bool
CompanyName string
GetField []string
GetType []string
//IsDebug bool
Deep int
//IsJsonOutput bool
//IsApiMode bool
IsMergeOut bool //合并导出
IsMerge bool //聚合
//ClientMode string //客户端模式
ENConfig *ENConfig
}
func (h *ENOptions) GetDelayRTime() int64 {
if h.DelayTime != 0 {
h.DelayMaxTime = int64(h.DelayTime)
}
if h.DelayMaxTime == 0 {
return 0
}
return RangeRand(1, h.DelayMaxTime)
}
// ENConfig YML配置文件,更改时注意变更 cfgYV 版本
type ENConfig struct {
//Version float64 `yaml:"version"`
Utils struct {
Output string `yaml:"output"`
Field []string `yaml:"field"`
}
Biu struct {
Api string `yaml:"api"`
Key string `yaml:"key"`
Port string `yaml:"port"`
IsPublic bool `yaml:"is-public"`
Tags []string `yaml:"tags"`
}
//Api struct {
// Server string `yaml:"server"`
// Mongodb string `yaml:"mongodb"`
// Redis string `yaml:"redis"`
//}
Cookies struct {
Aldzs string `yaml:"aldzs"`
Xlb string `yaml:"xlb"`
Aiqicha string `yaml:"aiqicha"`
Binaryedge string `yaml:"binaryedge"`
Tianyancha string `yaml:"tianyancha"`
Tycid string `yaml:"tycid"`
Qcc string `yaml:"qcc"`
QiMai string `yaml:"qimai"`
ChinaZ string `yaml:"chinaz"`
Veryvp string `yaml:"veryvp"`
Fullhunt string `yaml:"fullhunt"`
Hunter string `yaml:"hunter"`
Bevigil string `yaml:"bevigil"`
CensysToken string `yaml:"CensysToken"`
CensysSecret string `yaml:"CensysSecret"`
Zoomeye string `yaml:"zoomeye"`
Whoisxmlapi string `yaml:"whoisxmlapi"`
Virustotal string `yaml:"virustotal"`
Shodan string `yaml:"shodan"`
Chaos string `yaml:"chaos"`
Leakix string `yaml:"leakix"`
Netlas string `yaml:"netlas"`
Quake string `yaml:"quake"`
}
Massdns struct {
Resolvers string `yaml:"resolvers"`
Wordlist string `yaml:"wordlist"`
MassdnsPath string `yaml:"massdnsPath"`
}
}
type EnInfos struct {
Id primitive.ObjectID `bson:"_id"`
Name string
Pid string
LegalPerson string
OpenStatus string
Email string
Telephone string
SType string
RegCode string
BranchNum int64
InvestNum int64
InTime time.Time
PidS map[string]string
Infos map[string][]gjson.Result
EnInfos map[string][]map[string]interface{}
EnInfo []map[string]interface{}
}
type DBEnInfos struct {
Id primitive.ObjectID `bson:"_id"`
Name string
RegCode string
InTime time.Time
InvestCount int
InfoCount map[string][]string
Info []map[string]interface{}
}
var ENSMapAQC = map[string]string{
"webRecord": "icp",
"appinfo": "app",
"wechatoa": "wechat",
"enterprisejob": "job",
"microblog": "weibo",
"hold": "holds",
"shareholders": "partner",
}
// // DefaultAllInfos 默认收集信息列表
var DefaultAllInfos = []string{"icp", "weibo", "wechat", "app", "weibo", "job", "wx_app", "copyright"}
// var CanSearchAllInfos = []string{"enterprise_info", "icp", "weibo", "wechat", "app", "weibo", "job", "wx_app", "copyright", "supplier", "invest", "branch", "holds", "partner"}
var ScanTypeKeys = map[string]string{
"aqc": "爱企查",
"qcc": "企查查",
"tyc": "天眼查",
"xlb": "小蓝本",
"all": "全部查询",
"aldzs": "阿拉丁",
"coolapk": "酷安市场",
"qimai": "七麦数据",
"chinaz": "站长之家",
}
//var ScanTypeKeyV = map[string]string{
// "爱企查": "aqc",
// "企查查": "qcc",
// "天眼查": "tyc",
// "小蓝本": "xlb",
// "阿拉丁": "aldzs",
// "酷安市场": "coolapk",
// "七麦数据": "qimai",
// "站长之家": "chinaz",
//}
// // RequestTimeOut 请求超时设置
// var RequestTimeOut = 30 * time.Second
// var (
//
// BuiltAt string
// GoVersion string
// GitAuthor string
// BuildSha string
// GitTag string
//
// )
var cfgYName = GetPathDir() + "/config.yaml"
var configYaml = `
Utils:
output: "" # 导出文件位置
field: [ ] # 查询字段 如["website"]
cookies:
aiqicha: '' # 爱企查 Cookie
tianyancha: '' # 天眼查 Cookie
tycid: '' # 天眼查 CApi ID(capi.tianyancha.com)
aldzs: '' # 阿拉丁 TOKEN(see README)
qimai: '' # 七麦数据 Cookie
chinaz: '' # 站长之家 Cookie
veryvp: '' # veryvp Cookie
binaryedge: '' # binaryedge Cookie 免费查询250次
fullhunt: '' # Fullhunt Cookie 威胁平台 每月免费100次
hunter: '' # Hunter Cookie 威胁平台 每日免费500个数据
bevigil: '' # Bevigil Cookie 威胁平台 每月免费50次
CensysToken: '' # Censys Token 威胁平台 每月免费250次
CensysSecret: '' # Censys Secret 威胁平台 每月免费250次
zoomeye: '' # ZooEye Cookie 每月1000条
whoisxmlapi: '' # whoisxmlapi Cookie 免费500次
virustotal: '' # virustotal Cookie 每分钟4次 每天500次
shodan: '' # shodan Cookie
chaos: '' # chaos Key
leakix: '' # leakix Key
netlas: '' # Netlas key
quake: '' # Quake key
massdns:
resolvers: '' # resolvers 文件名称
wordlist: '' # 子域名爆破文件名称
massdnsPath: '' # Massdns工具名称
`