-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathconfig.go
267 lines (250 loc) · 7.59 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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
package Utils
import (
"github.com/tidwall/gjson"
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type LongOptions struct {
NoBao bool
NoPoc bool
NoPort bool
Low bool
Port string
Domain string
KeyWord string // Keyword of Search
CompanyID string // Company ID
GroupID string // Company ID
InputFile string // Scan Input File
Output string
ScanType string
Proxy string
IsGetBranch bool //分支机构(分公司)信息
IsSearchBranch bool
InvestNum float64
DelayTime int
DelayMaxTime int64
TimeOut int
IsHold bool //控股公司
IsSupplier bool //供应商信息
IsShow bool
CompanyName string
GetField []string
GetType []string
Deep int
IsMergeOut bool //合并导出
IsMerge bool //聚合
ICP []string
LongConfig *LongConfig
}
func (h *LongOptions) GetDelayRTime() int64 {
if h.DelayTime != 0 {
h.DelayMaxTime = int64(h.DelayTime)
}
if h.DelayMaxTime == 0 {
return 0
}
return RangeRand(1, h.DelayMaxTime)
}
// LongConfig YML配置文件,更改时注意变更 cfgYV 版本
type LongConfig struct {
//Version float64 `yaml:"version"`
Utils struct {
Output string `yaml:"output"`
}
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"`
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"`
Securitytrails string `yaml:"securitytrails"`
GoogleID string `yaml:"googleid"`
GoogleApi string `yaml:"googleapi"`
FofaKey string `yaml:"fofaKey"`
FofaEmail string `yaml:"fofaEmail"`
Github string `yaml:"githubtoken"`
Racent string `yaml:"racent"`
}
Massdns struct {
Resolvers string `yaml:"resolvers"`
Wordlist string `yaml:"wordlist"`
MassdnsPath string `yaml:"massdnsPath"`
Thread int `yaml:"thread"`
}
Email struct {
Emailhunter string `yaml:"emailhunter"`
EmailIntelx string `yaml:"intelxEmail"`
TombaKey string `yaml:"tombaKey"`
TombaSecret string `yaml:"tombaSecret"`
}
Port struct {
Masscan struct {
Masscanpath string `yaml:"masscanpath"`
Rate int `yaml:"rate"`
Port string `yaml:"port"`
Routermac string `yaml:"routermac"`
}
NmapPath string `yaml:"nmappath"`
}
}
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: "" # 导出文件位置
cookies:
aiqicha: '' # 爱企查 Cookie
tianyancha: '' # 天眼查 Cookie
tycid: '' # 天眼查 CApi ID(capi.tianyancha.com)
aldzs: '' # 阿拉丁 TOKEN(see README)
qimai: '' # 七麦数据 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
securitytrails: '' # securitytrails 需要企业邮箱,每个月50次
googleid: '' # google id 免费的API只能查询前100条结果,每天免费提供 100 次搜索查询
googleapi: '' # google Api 免费的API只能查询前100条结果,每天免费提供 100 次搜索查询
fofaKey: '' # Fofa key
fofaEmail: '' # Fofa Email
githubtoken: '' # Github Token
racent: '' # racent Token
massdns:
resolvers: 'resolvers.txt' # resolvers 文件名称
wordlist: 'names.txt' # 子域名爆破文件名称
massdnsPath: 'massdns.exe' # Massdns工具名称
thread: 3000
email:
emailhunter: '' # Email hunter Token
intelxEmail: '' # Email Intelx Token
tombaKey: '' # Email tombaKey
tombaSecret: '' # Email tombaSecret
port:
masscan:
masscanpath: 'masscan' # Masscan放的位置如果是在环境变量中则默认就行
rate: 5000 # Masscan速率,速率如果太大很有可能直接带宽占满
routermac: '' # 如果masscan出现这个问题 https://github.com/M0nster3/OneLong/issues/5 尝试加入网关 mac 的参数例如 66-55-44-33-22-11但是这里要添加你自己的
nmappath: 'nmap'
#Afrog配置
reverse:
alphalog:
domain: ""
api_url: ""
ceye:
api-key: ""
domain: ""
dnslogcn:
domain: dnslog.cn
xray:
x_token: ""
domain: ""
api_url: http://x.x.x.x:8777
`