vysion 2.0.1__py3-none-any.whl → 2.0.3__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
@@ -108,7 +108,6 @@ class BaseClient:
108
108
 
109
109
  def _make_request(self, url: str) -> dto.VysionResponse:
110
110
  session = self.__get_session__()
111
- print(url)
112
111
  r = session.get(url)
113
112
 
114
113
  # TODO Improve this
@@ -221,6 +220,26 @@ class Client(BaseClient):
221
220
  result = self._make_request(url)
222
221
  return result.data
223
222
 
223
+ @vysion_error_manager
224
+ def find_phone(
225
+ self,
226
+ country_code: str,
227
+ phone_number: str,
228
+ page: int = 1,
229
+ lte: datetime = None,
230
+ gte: datetime = None,
231
+ ) -> dto.VysionResponse:
232
+ url = self._build_api_url__(
233
+ "document/phone",
234
+ country_code + "/" + phone_number,
235
+ page=page,
236
+ lte=lte,
237
+ gte=gte,
238
+ )
239
+
240
+ result = self._make_request(url)
241
+ return result.data
242
+
224
243
  @vysion_error_manager
225
244
  def find_wallet(
226
245
  self,
@@ -276,6 +295,13 @@ class Client(BaseClient):
276
295
  result = self._make_request(url)
277
296
  return result.data
278
297
 
298
+ @vysion_error_manager
299
+ def get_ransomware_victim(self, document_id: str) -> dto.VysionResponse:
300
+ url = self._build_api_url__("victim", document_id)
301
+
302
+ result = self._make_request(url)
303
+ return result.data
304
+
279
305
  #
280
306
  # Ransomware Stats
281
307
  #
@@ -283,10 +309,11 @@ class Client(BaseClient):
283
309
  @vysion_error_manager
284
310
  def ransomware_countries_stats(
285
311
  self,
312
+ countries: str = None,
286
313
  gte: datetime = None,
287
314
  lte: datetime = None,
288
315
  ) -> dto.VysionResponse[dto.Stat]:
289
- url = self._build_api_url__("stats/countries", gte=gte, lte=lte)
316
+ url = self._build_api_url__("stats/countries", countries=countries, gte=gte, lte=lte)
290
317
 
291
318
  result = self._make_request(url)
292
319
  return result.data
@@ -294,21 +321,11 @@ class Client(BaseClient):
294
321
  @vysion_error_manager
295
322
  def ransomware_groups_stats(
296
323
  self,
324
+ countries: str = None,
297
325
  gte: datetime = None,
298
326
  lte: datetime = None,
299
327
  ) -> 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)
328
+ url = self._build_api_url__("stats/groups", countries=countries, gte=gte, lte=lte)
312
329
 
313
330
  result = self._make_request(url)
314
331
  return result.data
@@ -341,9 +358,9 @@ class Client(BaseClient):
341
358
 
342
359
  @vysion_error_manager
343
360
  def get_im_chat(
344
- self, platform: str, channelId: str
361
+ self, platform: str, channelId: str, gte: datetime = None, lte: datetime = None
345
362
  ) -> dto.VysionResponse[dto.ImMessageHit]:
346
- url = self._build_api_url__("im/" + platform + "/chat/", channelId)
363
+ url = self._build_api_url__("im/" + platform + "/chat/" + channelId, gte=gte, lte=lte)
347
364
 
348
365
  result = self._make_request(url)
349
366
  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],List[RansomFeedHit],List[RansomwareHit]] = 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.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vysion
3
- Version: 2.0.1
3
+ Version: 2.0.3
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.3](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=HUUePwG7btGVwQWSN8atxf0scMbOOAKyLwFGMOblZZ4,11729
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=ud5Kk1xz48_sRfVYe4K7gtg1LrnTh5P4neiLRNx4mD8,13200
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=TooJDNm5IH_y6jx2DbfRXgSqx_Mum1MW68HyMQcSLO4,610
19
+ vysion-2.0.3.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
20
+ vysion-2.0.3.dist-info/METADATA,sha256=XIc4kKDHD7MrzxPaZQ6UKdnT3NIL7-Uq_LMpJsWByec,2122
21
+ vysion-2.0.3.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
22
+ vysion-2.0.3.dist-info/RECORD,,
File without changes