-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobjects.go
363 lines (329 loc) · 12.7 KB
/
objects.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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
package OtxApiClient
type BaseIndicator struct {
AccessReason string `json:"access_reason"`
AccessType string `json:"access_type"`
Content string `json:"content"`
Description string `json:"description"`
Id int `json:"id"`
Indicator string `json:"indicator"`
Title string `json:"title"`
Type string `json:"type"`
}
type PulseInfo struct {
Count int `json:"count"`
Pulses []Pulse `json:"pulses"`
References []string `json:"references"`
}
type PulseAuthor struct {
AvatarUrl string `json:"avatar_url"`
Id string `json:"id"`
IsFollowing bool `json:"is_following"`
IsSubscribed bool `json:"is_subscribed"`
Username string `json:"username"`
}
type PulseGroup struct {
Id int `json:"id"`
Name string `json:"name"`
}
type IndicatorTypeCounts struct {
IPv4 int `json:"ipv4"`
SHA256 int `json:"sha256"`
Domain int `json:"domain"`
Hostname int `json:"hostname"`
}
type Observation struct {
AccessReason string `json:"access_reason"`
AccessType string `json:"access_type"`
Content string `json:"content"`
Description string `json:"description"`
Expiration string `json:"expiration"`
IsActive bool `json:"is_active"`
ObservationCreated string `json:"observation_created"`
PulseKey string `json:"pulse_key"`
Role string `json:"role"`
Title string `json:"title"`
}
type Pulse struct {
TLP string `json:"tlp"`
Adversary string `json:"adversay"`
Author PulseAuthor `json:"author"`
ClonedFrom interface{} `json:"cloned_from"`
CommentCount int `json:"comment_count"`
Created string `json:"created"`
Description string `json:"description"`
DownvotesCount int `json:"downvote_count"`
ExportCount int `json:"export_count"`
FollwerCount int `json:"follower_count"`
Groups []PulseGroup `json:"groups"`
Id string `json:"id"`
InGroup bool `json:"in_group"`
IndicatorCount int `json:"indicator_count"`
IndicatorTypeCounts IndicatorTypeCounts `json:"indicator_type_counts"`
Industries []string `json:"industries"`
IsAuthor bool `json:"is_author"`
IsFollowing bool `json:"is_following"`
IsModified bool `json:"is_modified"`
IsSubscribing bool `json:"is_subscribing"`
Locked bool `json:"locked"`
Modified string `json:"modified"`
ModifiedText string `json:"modified_text"`
Name string `json:"name"`
Observation Observation `json:"observation"`
Public int `json:"public"`
PulseSource string `json:"pulse_source"`
Reference []string `json:"reference"`
SubscriberCount int `json:"subscriber_count"`
Tags []string `json:"tags"`
TargetCountries []string `json:"target_countries"`
UpvoteCount int `json:"upvote_count"`
ValidatorCount int `json:"validator_count"`
Vote int `json:"vote"`
VoteCount int `json:"vote_count"`
}
type Validation struct {
Message string `json:"message"`
Name string `json:"name"`
Source string `json:"source"`
}
type DomainGeneral struct {
Alexa string `json:"alexa"`
BaseIndicator BaseIndicator `json:"base_indicator"`
Indicator string `json:"indicator"`
PulseInfo PulseInfo `json:"pulse_info"`
Sections []string `json:"sections"`
Type string `json:"type"`
Validation []Validation `json:"validation"`
Whois string "json:`whois`"
}
func (d DomainGeneral) GetIndicatorName() string {
return "domain"
}
type IPv4General struct {
AreaCode int `json:"area_code"`
Asn string `json:"asn"`
BaseIndicator BaseIndicator `json:"base_indicator"`
Charset int `json:"charset"`
City string `json:"city"`
CityData bool `json:"city_data"`
ContinentCode string `json:"continet_code"`
CountryCode string `json:"country_code"`
CountryCode3 string `json:"country_code3"`
CountryName string `json:"country_name"`
DmaCode int `json:"dma_code"`
FlagTitle string `json:"flag_title"`
FlagUrl string `json:"flag_url"`
Latitude float32 `json:"latitude"`
Longitude float32 `json:"longitude"`
PostalCode string `json:"postal_code"`
PulseInfo PulseInfo `json:"pulse_info"`
Region string `json:"region"`
Sections []string `json:"sections"`
Type string `json:"type"`
TypeTitle string `json:"type_title"`
Validation []Validation `json:"validation"`
Whois string "json:`whois`"
}
type IPv4Reputation struct {
}
type Malware struct {
Count int `json:"count"`
Data []MalwareData `json:"data"`
Next string `json:"next"`
Previous string `json:"previous"`
Size int `json:"size"`
}
type IPv4UrlList struct {
ActualSize int `json:"actual_size"`
FullSize int `json:"full_size"`
HasNext bool `json:"has_next"`
Limit int `json:limit"`
PageNum int `json:page_num"`
Paged bool `json:"paged"`
UrlList []UrlEntry `json:"url_list"`
}
type GenPassiveDns struct {
Count int `json:"count"`
PassiveDns []PassiveDns `json:"passive_dns"`
}
type Geo struct {
AreaCode int `json:"area_code"`
Asn string `json:"asn"`
Charset int `json:"charset"`
City string `json:"city"`
CityData bool `json:"city_data"`
ContinentCode string `json:"continet_code"`
CountryCode string `json:"country_code"`
CountryCode3 string `json:"country_code3"`
CountryName string `json:"country_name"`
DmaCode int `json:"dma_code"`
FlagTitle string `json:"flag_title"`
FlagUrl string `json:"flag_url"`
Latitude float32 `json:"latitude"`
Longitude float32 `json:"longitude"`
PostalCode string `json:"postal_code"`
Region string `json:"region"`
}
type MalwareData struct {
DatetimeInt int `json:"datetime_int"`
Hash string `json:"hash"`
}
type UrlEntry struct {
Date string `json:"data"`
Domain string `json:"domain"`
Encoded string `json:"encoded"`
Hostname string `json:hostname"`
Httpcode string `json.httpcode"`
Result interface{} `json:"result"`
Url string `json:"url"`
}
type DomainUrlList struct {
ActualSize int `json:"actual_size"`
FullSize int `json:"full_size"`
HasNext bool `json:"has_next"`
Limit int `json:limit"`
PageNum int `json:page_num"`
Paged bool `json:"paged"`
UrlList []UrlEntry `json:"url_list"`
}
type PassiveDns struct {
Address string `json:"address"`
AssetType string `json:"asset_type"`
First string `json:"first"`
FlagTitle string `json:"flag_title"`
FlagUrl string `json:"flag_url"`
Hostname string `json:"hostname"`
IndicatorLink string `json:"indicator_link"`
Last string `json:"last"`
}
type DomainFull struct {
PassiveDns GenPassiveDns
UrlList DomainUrlList
Malware Malware
}
type IPv6General struct {
BaseIndicator BaseIndicator `json:"base_indicator"`
Indicator string `json:"indicator"`
PulseInfo PulseInfo `json:"pulse_info"`
Reputatioin int `json:"reputation"`
Sections []string `json:"sections"`
Type string `json:"type"`
TypeTitle string `json:"type_title"`
Validation []Validation `json:"validation"`
Whois string "json:`whois`"
}
type IPv6Reputation struct {
}
type IPv6UrlList struct {
ActualSize int `json:"actual_size"`
FullSize int `json:"full_size"`
HasNext bool `json:"has_next"`
Limit int `json:limit"`
PageNum int `json:page_num"`
Paged bool `json:"paged"`
UrlList []UrlEntry `json:"url_list"`
}
type HostnameGeneral struct {
Alexa string `json:"alexa"`
BaseIndicator BaseIndicator `json:"base_indicator"`
Indicator string `json:"indicator"`
PulseInfo PulseInfo `json:"pulse_info"`
Sections []string `json:"sections"`
Type string `json:"type"`
TypeTitle string `json:"type_title"`
Validation []Validation `json:"validation"`
Whois string "json:`whois`"
}
type HostnameUrlList struct {
ActualSize int `json:"actual_size"`
FullSize int `json:"full_size"`
HasNext bool `json:"has_next"`
Limit int `json:limit"`
PageNum int `json:page_num"`
Paged bool `json:"paged"`
UrlList []UrlEntry `json:"url_list"`
}
type FileGeneral struct {
BaseIndicator BaseIndicator `json:"base_indicator"`
Indicator string `json:"indicator"`
PulseInfo PulseInfo `json:"pulse_info"`
Sections []string `json:"sections"`
Type string `json:"type"`
TypeTitle string `json:"type_title"`
Validation []Validation `json:"validation"`
}
type FileAnalysis struct {
Analysis map[string]interface{} `json:"analysis"`
Malware map[string]interface{} `json:"malware"`
PageType string `json:"page_type"`
}
type UrlGeneral struct {
Alexa string `json:"alexa"`
BaseIndicator BaseIndicator `json:"base_indicator"`
Indicator string `json:"indicator"`
PulseInfo PulseInfo `json:"pulse_info"`
Sections []string `json:"sections"`
Type string `json:"type"`
TypeTitle string `json:"type_title"`
Validation []Validation `json:"validation"`
Whois string "json:`whois`"
}
type UrlUrlList struct {
AreaCode int `json:"area_code"`
Asn string `json:"asn"`
Charset int `json:"charset"`
City string `json:"city"`
CityData bool `json:"city_data"`
ContinentCode string `json:"continet_code"`
CountryCode string `json:"country_code"`
CountryCode3 string `json:"country_code3"`
CountryName string `json:"country_name"`
DmaCode int `json:"dma_code"`
FlagTitle string `json:"flag_title"`
FlagUrl string `json:"flag_url"`
Latitude float32 `json:"latitude"`
Longitude float32 `json:"longitude"`
PostalCode string `json:"postal_code"`
Region string `json:"region"`
UrlList []UrlEntry `json:"url_list"`
}
type Reference struct {
ExternalSource string `json:"external_source"`
Href string `json:"href"`
Name string `json:"name"`
Type string `json:"type"`
}
type CveGeneral struct {
BaseIndicator BaseIndicator `json:"base_indicator"`
Cve string `json:"cve"`
Cvss map[string]string `json:"cvss"`
Cwe string `json:"cwe"`
DateCreated string `json:"date_created"`
DateModified string `json:"date_modified"`
Description string `json:"description"`
Indicator string `json:"indicator"`
MitreUrl string `json:"mitre_url"`
NvdUrl string `json:"nvd_url"`
Products []string `json:"products"`
PulseInfo PulseInfo `json:"pulse_info"`
References []Reference `json:"references"`
Sections []string `json:"sections"`
}
type NidsGeneral struct {
BaseIndicator BaseIndicator `json:"base_indicator"`
Category string `json:"category"`
Cve string `json:"cve"`
EventActivity interface{} `json:"event_activity"`
Indicator string `json:"indicator"`
MalwareName []string `json:"malware_name"`
Name string `json:"name"`
PulseInfo PulseInfo `json:"pulse_info"`
Sections []string `json:"sections"`
Subcategory string `json:"subcategory"`
}
type CorrelationRuleGeneral struct {
BaseIndicator BaseIndicator `json:"base_indicator"`
Cve string `json:"cve"`
Indicator string `json:"indicator"`
PulseInfo PulseInfo `json:"pulse_info"`
Sections []string `json:"sections"`
}