rat-king-parser 4.2.2__tar.gz → 4.2.3__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.
Files changed (40) hide show
  1. {rat_king_parser-4.2.2/src/rat_king_parser.egg-info → rat_king_parser-4.2.3}/PKG-INFO +1 -1
  2. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/_version.py +1 -1
  3. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/config_item.py +1 -1
  4. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/dotnetpe_payload.py +8 -3
  5. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/extern/maco/rkp_maco.py +4 -5
  6. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3/src/rat_king_parser.egg-info}/PKG-INFO +1 -1
  7. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/LICENSE +0 -0
  8. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/README.md +0 -0
  9. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/pyproject.toml +0 -0
  10. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/setup.cfg +0 -0
  11. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/__init__.py +0 -0
  12. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/__init__.py +0 -0
  13. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/config_parser_exception.py +0 -0
  14. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/rat_config_parser.py +0 -0
  15. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/__init__.py +0 -0
  16. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/config_normalization.py +0 -0
  17. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/data_utils.py +0 -0
  18. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/decryptors/__init__.py +0 -0
  19. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor.py +0 -0
  20. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_aes_with_iv.py +0 -0
  21. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_aes_with_iv_pbkdf.py +0 -0
  22. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_decrypt_xor.py +0 -0
  23. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_ecb.py +0 -0
  24. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_plaintext.py +0 -0
  25. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_random_hardcoded.py +0 -0
  26. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_rijndael.py +0 -0
  27. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/config_parser/utils/dotnet_constants.py +0 -0
  28. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/extern/__init__.py +0 -0
  29. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/extern/maco/__init__.py +0 -0
  30. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/rkp.py +0 -0
  31. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/yara_utils/__init__.py +0 -0
  32. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/yara_utils/recompile.py +0 -0
  33. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/yara_utils/rules.yar +0 -0
  34. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser/yara_utils/rules.yarc +0 -0
  35. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser.egg-info/SOURCES.txt +0 -0
  36. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser.egg-info/dependency_links.txt +0 -0
  37. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser.egg-info/entry_points.txt +0 -0
  38. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser.egg-info/requires.txt +0 -0
  39. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/src/rat_king_parser.egg-info/top_level.txt +0 -0
  40. {rat_king_parser-4.2.2 → rat_king_parser-4.2.3}/tests/test_known_samples.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rat-king-parser
3
- Version: 4.2.2
3
+ Version: 4.2.3
4
4
  Summary: A robust, multiprocessing-capable, multi-family RAT config parser/config extractor for AsyncRAT, DcRAT, VenomRAT, QuasarRAT, XWorm, Xeno RAT, and cloned/derivative RAT families.
5
5
  Author-email: jeFF0Falltrades <8444166+jeFF0Falltrades@users.noreply.github.com>
6
6
  Maintainer-email: jeFF0Falltrades <8444166+jeFF0Falltrades@users.noreply.github.com>
@@ -23,4 +23,4 @@
23
23
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
24
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
25
  # SOFTWARE.
26
- __version__ = "4.2.2"
26
+ __version__ = "4.2.3"
@@ -132,7 +132,7 @@ class SpecialFolderConfigItem(ConfigItem):
132
132
  try:
133
133
  return SpecialFolder(bytes_to_int(folder_id)).name
134
134
  except ValueError:
135
- return None
135
+ return f"UnknownFolder({bytes_to_int(folder_id)})"
136
136
 
137
137
  class EncryptedStringConfigItem(ConfigItem):
138
138
  def __init__(self) -> None:
@@ -211,7 +211,12 @@ class DotNetPEPayload:
211
211
 
212
212
  # Given an RVA, derives the corresponding User String
213
213
  def user_string_from_rva(self, rva: int) -> str:
214
- return self.dotnetpe.net.user_strings.get(rva ^ MDT_STRING).value
214
+ result = self.dotnetpe.net.user_strings.get(rva ^ MDT_STRING)
215
+ if result is None:
216
+ raise ConfigParserException(
217
+ f"Could not find user string for RVA {hex(rva)}"
218
+ )
219
+ return result.value
215
220
 
216
221
  def custom_attribute_from_type(self, typespacename: str, typename: str) -> dict:
217
222
  """
@@ -250,7 +255,7 @@ class DotNetPEPayload:
250
255
  for pd_row_index, pd in enumerate(
251
256
  self.dotnetpe.net.mdtables.Property.rows
252
257
  ):
253
- if pd.Name.value.startswith(
258
+ if pd.Name.value.startswith((
254
259
  "Boolean_",
255
260
  "BorderStyle_",
256
261
  "Color_",
@@ -258,7 +263,7 @@ class DotNetPEPayload:
258
263
  "Int32_",
259
264
  "SizeF_",
260
265
  "String_",
261
- ):
266
+ )):
262
267
  continue
263
268
  # CustomAttribute Parent index is 1-based
264
269
  target_index = pd_row_index + 1
@@ -30,7 +30,6 @@ from enum import Enum, auto
30
30
  from logging import getLogger
31
31
  from pathlib import Path
32
32
  from re import search
33
- from typing import Optional
34
33
 
35
34
  import validators
36
35
  from maco import extractor, model
@@ -64,13 +63,13 @@ class RKPMACO(extractor.Extractor):
64
63
  author = "jeFF0Falltrades"
65
64
  last_modified = "2024-10-18"
66
65
  sharing = "TLP:WHITE"
67
- yara_rule = open(str(Path(__file__).parent / YARA_PATH)).read()
66
+ yara_rule = (Path(__file__).parent / YARA_PATH).read_text()
68
67
 
69
68
  def run(
70
69
  self, stream: typing.BinaryIO, matches: typing.List[Match]
71
70
  ) -> typing.Optional[model.ExtractorModel]:
72
71
  report = RATConfigParser(
73
- load(str(Path(__file__).parent / YARC_PATH)),
72
+ yara_rule=load(str(Path(__file__).parent / YARC_PATH)),
74
73
  data=stream.read(),
75
74
  remap_config=True,
76
75
  ).report
@@ -191,7 +190,7 @@ class RKPMACO(extractor.Extractor):
191
190
 
192
191
  # Helper function to handle both IPv4 and IPv6 values
193
192
  def _add_tcp_ip(
194
- self, model: model.ExtractorModel, server_ip: str, server_port: Optional[int]
193
+ self, model: model.ExtractorModel, server_ip: str, server_port: typing.Optional[int]
195
194
  ) -> None:
196
195
  model.tcp.append(
197
196
  model.Connection(server_ip=server_ip, server_port=server_port, usage="c2")
@@ -201,7 +200,7 @@ class RKPMACO(extractor.Extractor):
201
200
  # suffixed to the host/IP
202
201
  def _split_network_value(
203
202
  self, network_value: str
204
- ) -> typing.Tuple[str, Optional[int]]:
203
+ ) -> typing.Tuple[str, typing.Optional[int]]:
205
204
  match = search(r":([0-9]+)$", network_value)
206
205
  if match is not None:
207
206
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rat-king-parser
3
- Version: 4.2.2
3
+ Version: 4.2.3
4
4
  Summary: A robust, multiprocessing-capable, multi-family RAT config parser/config extractor for AsyncRAT, DcRAT, VenomRAT, QuasarRAT, XWorm, Xeno RAT, and cloned/derivative RAT families.
5
5
  Author-email: jeFF0Falltrades <8444166+jeFF0Falltrades@users.noreply.github.com>
6
6
  Maintainer-email: jeFF0Falltrades <8444166+jeFF0Falltrades@users.noreply.github.com>
File without changes