vysion 2.0.1__py3-none-any.whl → 2.0.2__py3-none-any.whl

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/client/client.py CHANGED
@@ -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/", channelId)
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
vysion/dto/dto.py CHANGED
@@ -399,8 +399,9 @@ T = TypeVar("T")
399
399
 
400
400
  class Result(BaseModel, Generic[T]):
401
401
  total: int = 0
402
- hits: List[T] = Field(default_factory=lambda: [])
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:
vysion/dto/util.py CHANGED
@@ -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("title", type="text", value=pageTitle)
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 Remove this addition when the vysion-page object works
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" # TODO Esto se tiene que poder hacer de otra manera... Y sólo es necesario en los feeds
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
vysion/version.py CHANGED
@@ -15,4 +15,4 @@ See the License for the specific language governing permissions and
15
15
  limitations under the License.
16
16
  """
17
17
 
18
- __version__ = "2.0.1"
18
+ __version__ = "2.0.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vysion
3
- Version: 2.0.1
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.175)
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.1](https://pypi.org/project/vysion/)
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
 
@@ -1,11 +1,11 @@
1
1
  vysion/__init__.py,sha256=yxJiM-S29q8GB3PBff9tV70P2nvydd8aKLEprLkXw5o,664
2
2
  vysion/client/__init__.py,sha256=aVHmBuetPdybp7TgcNzUx4HkxTjEuXYzSdDYiYfFQd0,630
3
- vysion/client/client.py,sha256=RjsPv5Zrr6CBEC2tWB7xDk7tuF0WAssrhCYp_hXFCd8,11178
3
+ vysion/client/client.py,sha256=qRqBIKRVYrBs-p7-MwKwSlojH3KXxtKg_y1xrNqciQo,11748
4
4
  vysion/client/error.py,sha256=-3NGr9ngTGSy-ctqk6S9eMBAvtY3lnjv9i0KiuRjd5g,1158
5
5
  vysion/dto/__init__.py,sha256=ct8JxVMfJ0APiOTgr9ju-JIuBlXOrPkx7n2qISSXUts,605
6
- vysion/dto/dto.py,sha256=H7uQMwcbFsVh2TTESdCooA-l6cP8XQ8iS9hrNC2F-UQ,13054
6
+ vysion/dto/dto.py,sha256=-NT1v3EPBfF7g77ZnXbuRhxfFCMQeOEEQxQ9rWKCYMk,13160
7
7
  vysion/dto/tag.py,sha256=_Dn4-_xiC1PD4udp3m4FsDdyHVCSgrq7NFJomjsMYtU,1503
8
- vysion/dto/util.py,sha256=UNpy_A7rsfH57xgEmDultCIOtyM0a9OzI1PpWUSJi_U,4571
8
+ vysion/dto/util.py,sha256=WESBTKWWBGtMmXCKL9hqQqLJjAY5MIxyqhbTPEZW3mM,4433
9
9
  vysion/model/__init__.py,sha256=rJX9eNW9-jQGTgwm97W04jhZa-dV_dSTTTFcbWg73w0,606
10
10
  vysion/model/enum/__init__.py,sha256=lhG6rgaYjrFBR8_IfJL0OoT0L7vooR5_ht4zUahQcOc,690
11
11
  vysion/model/enum/languages.py,sha256=yrYDwLEM2lK5iqdLR16n8xeCeSmsCsIj4sTiuNz33FM,4204
@@ -15,8 +15,8 @@ vysion/model/enum/services.py,sha256=fUfZEO0RNNctU4Gzae5TV3c7BU5A_cEwaEb1tzqgcr0
15
15
  vysion/taxonomy/__init__.py,sha256=Bc364AYxRCyjIn26-XBPeEDCPe3Hma4r5RAI8R8eblU,635
16
16
  vysion/taxonomy/flavours.py,sha256=ubImHBE8v0zhzFy_2YozAQk2SzN1XDQwHAxb2RebtCo,2347
17
17
  vysion/taxonomy/taxonomy.py,sha256=mG6vHX5Eyp38AKyJBgfBDqdpEmDMbkv8TA8YUBzko54,12227
18
- vysion/version.py,sha256=UZ0L2QPjFezLeUXGLXw32JOqE2BwkSNth2rnLnRXYlw,610
19
- vysion-2.0.1.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
20
- vysion-2.0.1.dist-info/METADATA,sha256=vlt_td133OtsJuwEo6_58i3alvbhGlPU0Wc1jBE_6Bo,2122
21
- vysion-2.0.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
22
- vysion-2.0.1.dist-info/RECORD,,
18
+ vysion/version.py,sha256=UkNNif4Ixpw4fRy-z1X2d9jMRQGGPz2mhXkT4R6dqRg,610
19
+ vysion-2.0.2.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
20
+ vysion-2.0.2.dist-info/METADATA,sha256=LO1X_shVL_HTZSxJ0sMhJaP-HtcjnU86asZd31ZtQTM,2122
21
+ vysion-2.0.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
22
+ vysion-2.0.2.dist-info/RECORD,,
File without changes