vysion 2.0.1__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vysion-2.0.1 → vysion-2.0.2}/PKG-INFO +3 -3
- {vysion-2.0.1 → vysion-2.0.2}/README.md +1 -1
- {vysion-2.0.1 → vysion-2.0.2}/pyproject.toml +2 -2
- {vysion-2.0.1 → vysion-2.0.2}/vysion/client/client.py +33 -15
- {vysion-2.0.1 → vysion-2.0.2}/vysion/dto/dto.py +3 -2
- {vysion-2.0.1 → vysion-2.0.2}/vysion/dto/util.py +4 -6
- {vysion-2.0.1 → vysion-2.0.2}/vysion/version.py +1 -1
- {vysion-2.0.1 → vysion-2.0.2}/LICENSE +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/__init__.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/client/__init__.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/client/error.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/dto/__init__.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/dto/tag.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/model/__init__.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/model/enum/__init__.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/model/enum/languages.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/model/enum/networks.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/model/enum/ransom_groups.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/model/enum/services.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/taxonomy/__init__.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/taxonomy/flavours.py +0 -0
- {vysion-2.0.1 → vysion-2.0.2}/vysion/taxonomy/taxonomy.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vysion
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: The official Python client library for Vysion
|
|
5
5
|
Home-page: https://vysion.ai
|
|
6
6
|
License: Apache-2.0
|
|
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Requires-Dist: pydantic (>=2.0.1,<3.0.0)
|
|
19
|
-
Requires-Dist: pymisp (==2.4.
|
|
19
|
+
Requires-Dist: pymisp (==2.4.194)
|
|
20
20
|
Requires-Dist: requests (>=2.28.1,<3.0.0)
|
|
21
21
|
Requires-Dist: softenum (==1.0.1)
|
|
22
22
|
Project-URL: Documentation, https://developers.vysion.ai
|
|
@@ -29,7 +29,7 @@ Welcome to the PyPi webpage for Vysion, our implementation as a Python library t
|
|
|
29
29
|
|
|
30
30
|
You can request a demo for the web app or an API-key to use in this library at [vysion.ai](https://vysion.ai).
|
|
31
31
|
|
|
32
|
-
Latest version: [2.0.
|
|
32
|
+
Latest version: [2.0.2](https://pypi.org/project/vysion/)
|
|
33
33
|
|
|
34
34
|
You can visit [the documentation](https://developers.vysion.ai/?python) for more information on the searches and requests performed with the library or directly on the API.
|
|
35
35
|
|
|
@@ -4,7 +4,7 @@ Welcome to the PyPi webpage for Vysion, our implementation as a Python library t
|
|
|
4
4
|
|
|
5
5
|
You can request a demo for the web app or an API-key to use in this library at [vysion.ai](https://vysion.ai).
|
|
6
6
|
|
|
7
|
-
Latest version: [2.0.
|
|
7
|
+
Latest version: [2.0.2](https://pypi.org/project/vysion/)
|
|
8
8
|
|
|
9
9
|
You can visit [the documentation](https://developers.vysion.ai/?python) for more information on the searches and requests performed with the library or directly on the API.
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "vysion"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.2"
|
|
4
4
|
description = "The official Python client library for Vysion"
|
|
5
5
|
homepage = "https://vysion.ai"
|
|
6
6
|
repository = "https://gitlab.com/byronlabs/vysion/vysion-py"
|
|
@@ -21,9 +21,9 @@ classifiers=[
|
|
|
21
21
|
python = "^3.8.0"
|
|
22
22
|
|
|
23
23
|
pydantic = "^2.0.1"
|
|
24
|
-
pymisp = "2.4.175"
|
|
25
24
|
softenum = "1.0.1"
|
|
26
25
|
requests = "^2.28.1"
|
|
26
|
+
pymisp = "2.4.194"
|
|
27
27
|
|
|
28
28
|
[tool.poetry.dev-dependencies]
|
|
29
29
|
pytest = "7.1.2"
|
|
@@ -221,6 +221,26 @@ class Client(BaseClient):
|
|
|
221
221
|
result = self._make_request(url)
|
|
222
222
|
return result.data
|
|
223
223
|
|
|
224
|
+
@vysion_error_manager
|
|
225
|
+
def find_phone(
|
|
226
|
+
self,
|
|
227
|
+
country_code: str,
|
|
228
|
+
phone_number: str,
|
|
229
|
+
page: int = 1,
|
|
230
|
+
lte: datetime = None,
|
|
231
|
+
gte: datetime = None,
|
|
232
|
+
) -> dto.VysionResponse:
|
|
233
|
+
url = self._build_api_url__(
|
|
234
|
+
"document/phone",
|
|
235
|
+
country_code + "/" + phone_number,
|
|
236
|
+
page=page,
|
|
237
|
+
lte=lte,
|
|
238
|
+
gte=gte,
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
result = self._make_request(url)
|
|
242
|
+
return result.data
|
|
243
|
+
|
|
224
244
|
@vysion_error_manager
|
|
225
245
|
def find_wallet(
|
|
226
246
|
self,
|
|
@@ -276,6 +296,13 @@ class Client(BaseClient):
|
|
|
276
296
|
result = self._make_request(url)
|
|
277
297
|
return result.data
|
|
278
298
|
|
|
299
|
+
@vysion_error_manager
|
|
300
|
+
def get_ransomware_victim(self, document_id: str) -> dto.VysionResponse:
|
|
301
|
+
url = self._build_api_url__("victim", document_id)
|
|
302
|
+
|
|
303
|
+
result = self._make_request(url)
|
|
304
|
+
return result.data
|
|
305
|
+
|
|
279
306
|
#
|
|
280
307
|
# Ransomware Stats
|
|
281
308
|
#
|
|
@@ -283,10 +310,11 @@ class Client(BaseClient):
|
|
|
283
310
|
@vysion_error_manager
|
|
284
311
|
def ransomware_countries_stats(
|
|
285
312
|
self,
|
|
313
|
+
countries: str = None,
|
|
286
314
|
gte: datetime = None,
|
|
287
315
|
lte: datetime = None,
|
|
288
316
|
) -> dto.VysionResponse[dto.Stat]:
|
|
289
|
-
url = self._build_api_url__("stats/countries", gte=gte, lte=lte)
|
|
317
|
+
url = self._build_api_url__("stats/countries", countries=countries, gte=gte, lte=lte)
|
|
290
318
|
|
|
291
319
|
result = self._make_request(url)
|
|
292
320
|
return result.data
|
|
@@ -294,21 +322,11 @@ class Client(BaseClient):
|
|
|
294
322
|
@vysion_error_manager
|
|
295
323
|
def ransomware_groups_stats(
|
|
296
324
|
self,
|
|
325
|
+
countries: str = None,
|
|
297
326
|
gte: datetime = None,
|
|
298
327
|
lte: datetime = None,
|
|
299
328
|
) -> dto.VysionResponse[dto.Stat]:
|
|
300
|
-
url = self._build_api_url__("stats/groups", gte=gte, lte=lte)
|
|
301
|
-
|
|
302
|
-
result = self._make_request(url)
|
|
303
|
-
return result.data
|
|
304
|
-
|
|
305
|
-
@vysion_error_manager
|
|
306
|
-
def ransomware_attacks_stats(
|
|
307
|
-
self,
|
|
308
|
-
gte: datetime = None,
|
|
309
|
-
lte: datetime = None,
|
|
310
|
-
) -> dto.VysionResponse[dto.Stat]:
|
|
311
|
-
url = self._build_api_url__("stats/attacks", gte=gte, lte=lte)
|
|
329
|
+
url = self._build_api_url__("stats/groups", countries=countries, gte=gte, lte=lte)
|
|
312
330
|
|
|
313
331
|
result = self._make_request(url)
|
|
314
332
|
return result.data
|
|
@@ -341,9 +359,9 @@ class Client(BaseClient):
|
|
|
341
359
|
|
|
342
360
|
@vysion_error_manager
|
|
343
361
|
def get_im_chat(
|
|
344
|
-
self, platform: str, channelId: str
|
|
362
|
+
self, platform: str, channelId: str, gte: datetime = None, lte: datetime = None
|
|
345
363
|
) -> dto.VysionResponse[dto.ImMessageHit]:
|
|
346
|
-
url = self._build_api_url__("im/" + platform + "/chat/",
|
|
364
|
+
url = self._build_api_url__("im/" + platform + "/chat/" + channelId, gte=gte, lte=lte)
|
|
347
365
|
|
|
348
366
|
result = self._make_request(url)
|
|
349
367
|
return result.data
|
|
@@ -399,8 +399,9 @@ T = TypeVar("T")
|
|
|
399
399
|
|
|
400
400
|
class Result(BaseModel, Generic[T]):
|
|
401
401
|
total: int = 0
|
|
402
|
-
hits: List[
|
|
403
|
-
|
|
402
|
+
hits: Union[List[DocumentHit],List[Stat],List[ImChannelHit],List[ImMessageHit],
|
|
403
|
+
List[ImProfileHit]] = Field(default_factory=lambda: [])
|
|
404
|
+
|
|
404
405
|
def __init__(self, **kwargs):
|
|
405
406
|
super().__init__(**kwargs)
|
|
406
407
|
if self.total <= 0:
|
|
@@ -33,7 +33,6 @@ class MISPProcessor:
|
|
|
33
33
|
def parse_hit(self, hit: DocumentHit, ref_attribute: MISPAttribute = None, **_):
|
|
34
34
|
page: Page = hit.page
|
|
35
35
|
|
|
36
|
-
# TODO Add more page parameters
|
|
37
36
|
misp_object = MISPObject("vysion-page")
|
|
38
37
|
misp_object.template_uuid = "4d0b66f1-5268-47e0-9d29-f2e4f3db8e7f"
|
|
39
38
|
|
|
@@ -47,7 +46,7 @@ class MISPProcessor:
|
|
|
47
46
|
misp_object.add_attribute("network", type="text", value=network)
|
|
48
47
|
|
|
49
48
|
pageTitle = page.pageTitle
|
|
50
|
-
misp_object.add_attribute("
|
|
49
|
+
misp_object.add_attribute("pageTitle", type="text", value=pageTitle)
|
|
51
50
|
|
|
52
51
|
url_vysion: URL = "https://app.vysion.ai/document/" + page.id
|
|
53
52
|
misp_object.add_attribute("url_vysion", type="url", value=url_vysion)
|
|
@@ -59,7 +58,7 @@ class MISPProcessor:
|
|
|
59
58
|
|
|
60
59
|
vysion_reference_id = misp_object.uuid
|
|
61
60
|
|
|
62
|
-
# TODO
|
|
61
|
+
# TODO Add more page parameters into misp objects
|
|
63
62
|
self.misp_event.add_attribute("url", value=url.build())
|
|
64
63
|
|
|
65
64
|
self.misp_event.add_attribute("domain", value=url.domainName)
|
|
@@ -94,9 +93,8 @@ class MISPProcessor:
|
|
|
94
93
|
misp_object = MISPObject("vysion-ransomware-feed")
|
|
95
94
|
misp_object.template_uuid = "e0bfa994-c184-4894-bfaa-73b1350746e1"
|
|
96
95
|
misp_object["meta-category"] = (
|
|
97
|
-
"misc"
|
|
96
|
+
"misc"
|
|
98
97
|
)
|
|
99
|
-
|
|
100
98
|
misp_object.add_attribute("id", type="text", value=hit.id)
|
|
101
99
|
misp_object.add_attribute("companyName", type="target-org", value=hit.companyName)
|
|
102
100
|
misp_object.add_attribute("companyLink", type="link", value=hit.companyLink)
|
|
@@ -123,4 +121,4 @@ class MISPProcessor:
|
|
|
123
121
|
for hit in result.hits:
|
|
124
122
|
processor(hit, **kwargs)
|
|
125
123
|
|
|
126
|
-
return self.misp_event
|
|
124
|
+
return self.misp_event
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|