-
Notifications
You must be signed in to change notification settings - Fork 23
/
swagger.yaml
425 lines (424 loc) · 11.4 KB
/
swagger.yaml
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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
openapi: "3.0.0"
info:
version: 1.0.0
title: tknk_scanner API
servers:
- url: http://0.0.0.0/api
paths:
/analyze:
post:
tags:
- analyze
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/conf"
responses:
'200':
description: "OK response"
content:
application/json:
schema:
$ref: "#/components/schemas/analyze_response"
'404':
description: "something wrong"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/upload:
post:
tags:
- upload
requestBody:
content:
application/exe:
schema:
type: string
format: binary
example:
responses:
'200':
description: "OK response"
content:
application/json:
schema:
$ref: "#/components/schemas/upload_response"
'404':
description: "something wrong"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/download/{UUID}:
get:
tags:
- download
parameters:
- name: UUID
in: path
description: MongoDB's UUID
required: true
schema:
type: string
responses:
'200':
description: "OK response"
content:
application/zip:
schema:
type: string
format: binary
example:
'404':
description: "something wrong"
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/results/{UUID}:
get:
tags:
- results
parameters:
- name: UUID
in: path
description: MongoDB's UUID
required: true
schema:
type: string
responses:
200:
description:
Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/result_response"
404:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/jobs:
get:
tags:
- jobs
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/jobs"
'404':
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/page/{page_num}:
get:
tags:
- results
parameters:
- name: page_num
in: path
required: true
description: The nuber of page
schema:
type: string
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/page"
'404':
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/yara/{rule_name}:
get:
tags:
- yara
parameters:
- name: rule_name
in: path
required: true
description: detect rule name
schema:
type: string
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/yara"
'404':
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
'400':
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/search/{type}/{value}:
get:
tags:
- results
parameters:
- name: type
in: path
required: true
description: md5 or sha1 or sha256
schema:
type: string
- name: value
in: path
required: true
description: hash value
schema:
type: string
responses:
'200':
description: Expected response to a valid request
content:
application/json:
schema:
$ref: "#/components/schemas/search_results"
'404':
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
conf:
required:
- path
- mode
- time
properties:
path:
type: string
example: "target/gandcrab.exe"
mode:
type: string
example: "hollows_hunter"
time:
type: integer
format: int32
example: 20
upload_response:
properties:
status_code:
type: integer
format: int32
example: 0
path:
type: string
example: "target/hoge.exe"
result_response:
type: object
required:
- status_code
- result
properties:
status_code:
type: integer
format: int32
example: 0
report:
$ref: "#/components/schemas/report"
report:
properties:
mode:
type: string
example: "hollows_hunter"
timestamp:
type: string
example: "2018-11-23T20:42:23.749302"
run_time:
type: integer
format: int32
example: 20
scans:
type: array
items:
$ref: "#/components/schemas/scans"
target_scan:
$ref: "#/components/schemas/target_scan"
status_code:
type: integer
format: int32
example: 0
UUID:
type: string
example: "41ad0e99-f982-4355-abf9-b6a85078efc4"
magic:
type: string
example: "PE32 executable (GUI) Intel 80386, for MS Windows"
virus_total:
type: boolean
format: int32
example: 1
avclass:
$ref: "#/components/schemas/avclass_key"
die:
type: string
example:
- "PE: compiler: MASM32(8-11)[-]"
- "PE: linker: Microsoft Linker(12.0)[EXE32]"
avclass_key:
type: object
properties:
flag:
type: integer
format: int32
example: 1
data:
type: array
items:
$ref: "#/components/schemas/data"
data:
properties:
family_name:
type: string
example: "nymaim"
count:
type: integer
format: int32
example: 2
target_scan:
properties:
md5:
type: string
example: "b45cea3d89ee2f7087e6a6180d10b494"
sha1:
type: string
example: "ba74895fbf97bb6d88e2ed2df0853c21b6a93a33"
sha256:
type: string
example: "27c064b345343c9d3152164b8ea0f777e71ce9c4bd7b79ae39fd716533dd8b49"
detect_rule:
type: array
items:
type: string
example: "nymaim"
file_name:
type: string
example: "TempuzL51.exe"
size:
type: string
example: "86.0KB"
scans:
properties:
detect_rule:
type: array
items:
type: string
example: "nymaim"
file_name:
type: string
example: "TempuzL51.exe"
size:
type: string
example: "4.1KB"
page:
properties:
page:
type: array
items:
$ref: "#/components/schemas/report"
page_size:
type: integer
format: int32
example: 1
search_results:
properties:
results:
type: array
items:
$ref: "#/components/schemas/report"
jobs:
properties:
current_job:
$ref: "#/components/schemas/current_job"
queued_jobs:
type: array
items:
$ref: "#/components/schemas/queued_jobs"
current_job:
properties:
config:
$ref: "#/components/schemas/job_conf"
id:
type: string
example: "de9e01a2-7603-4098-8503-e82742a4b2c1"
queued_jobs:
properties:
config:
$ref: "#/components/schemas/job_conf"
id:
type: string
example: "f5f5f39d-6421-4824-b724-e532704b1d83"
job_conf:
properties:
target_file:
type: string
example: "netwire1"
mode:
type: string
example: "hollows_hunter"
time:
type: integer
format: int32
example: 20
timestamp:
type: integer
format: int32
example: 1542780044
yara:
properties:
status_code:
type: integer
format: int32
example: 0
rule:
type: string
example: "rule Emotet\n{\n meta:\n author = \"kevoreilly\"\n description = \"Emotet Payload\"\n cape_type = \"Emotet Payload\"\n strings:\n $snippet1 = {FF 15 ?? ?? ?? ?? 83 C4 0C 68 40 00 00 F0 6A 18}\n $snippet2 = {6A 13 68 01 00 01 00 FF 15 ?? ?? ?? ?? 85 C0}\n $snippet3 = {83 3D ?? ?? ?? ?? 00 C7 05 ?? ?? ?? ?? ?? ?? ?? ?? C7 05 ?? ?? ?? ?? ?? ?? ?? ?? 74 0A 51 E8 ?? ?? ?? ?? 83 C4 04 C3 33 C0 C3}\n $snippet4 = {33 C0 C7 05 ?? ?? ?? ?? ?? ?? ?? ?? C7 05 ?? ?? ?? ?? ?? ?? ?? ?? A3 ?? ?? ?? ?? A3 ?? ?? ?? ?? A3 ?? ?? ?? ?? 39 05 ?? ?? ?? ?? 74 1D 8D 49 00 40 A3 ?? ?? ?? ?? 83 3C C5 ?? ?? ?? ?? 00 75 F0 51 E8 ?? ?? ?? ?? 83 C4 04 C3}\n condition:\n //check for MZ Signature at offset 0\n uint16(0) == 0x5A4D and (($snippet1) and ($snippet2)) or ($snippet3) or ($snippet4)\n}\n"
analyze_response:
properties:
UUID:
type: string
example: "41ad0e99-f982-4355-abf9-b6a85078efc4"
message:
type: string
example: "Submission Success!"
status_code:
type: integer
format: int32
example: 0
Error:
required:
- status_code
- message
properties:
status_code:
type: integer
format: int32
example: 2
message:
type: string