rat-king-parser 3.2.2__tar.gz → 3.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 (36) hide show
  1. {rat_king_parser-3.2.2/src/rat_king_parser.egg-info → rat_king_parser-3.2.3}/PKG-INFO +1 -1
  2. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/_version.py +1 -1
  3. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/rat_config_parser.py +4 -3
  4. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/dotnetpe_payload.py +10 -5
  5. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3/src/rat_king_parser.egg-info}/PKG-INFO +1 -1
  6. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/LICENSE +0 -0
  7. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/README.md +0 -0
  8. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/pyproject.toml +0 -0
  9. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/setup.cfg +0 -0
  10. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/__init__.py +0 -0
  11. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/__init__.py +0 -0
  12. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/config_parser_exception.py +0 -0
  13. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/__init__.py +0 -0
  14. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/config_item.py +0 -0
  15. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/data_utils.py +0 -0
  16. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/decryptors/__init__.py +0 -0
  17. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor.py +0 -0
  18. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_aes_ecb.py +0 -0
  19. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_aes_with_iv.py +0 -0
  20. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_decrypt_xor.py +0 -0
  21. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_plaintext.py +0 -0
  22. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_random_hardcoded.py +0 -0
  23. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/config_parser/utils/dotnet_constants.py +0 -0
  24. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/extern/__init__.py +0 -0
  25. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/extern/maco/__init__.py +0 -0
  26. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/extern/maco/rkp_maco.py +0 -0
  27. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/rkp.py +0 -0
  28. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/yara_utils/__init__.py +0 -0
  29. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/yara_utils/recompile.py +0 -0
  30. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/yara_utils/rules.yar +0 -0
  31. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser/yara_utils/rules.yarc +0 -0
  32. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser.egg-info/SOURCES.txt +0 -0
  33. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser.egg-info/dependency_links.txt +0 -0
  34. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser.egg-info/entry_points.txt +0 -0
  35. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser.egg-info/requires.txt +0 -0
  36. {rat_king_parser-3.2.2 → rat_king_parser-3.2.3}/src/rat_king_parser.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rat-king-parser
3
- Version: 3.2.2
3
+ Version: 3.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__ = "3.2.2"
26
+ __version__ = "3.2.3"
@@ -56,7 +56,7 @@ class RATConfigParser:
56
56
  rb"\x7e.{3}\x04(?:\x6f.{3}\x0a){2}\x74.{3}\x01", DOTALL
57
57
  )
58
58
 
59
- def __init__(self, file_path: str, yara_rule: Rules = None) -> None:
59
+ def __init__(self, file_path: str = "", yara_rule: Rules = None, data: bytes = None) -> None:
60
60
  self.report = {
61
61
  "file_path": file_path,
62
62
  "sha256": "",
@@ -66,12 +66,13 @@ class RATConfigParser:
66
66
  "config": {},
67
67
  }
68
68
  try:
69
- if not isfile(file_path):
69
+
70
+ if not data and not isfile(file_path):
70
71
  raise ConfigParserException("File not found")
71
72
  # Filled in _decrypt_and_decode_config()
72
73
  self._incompatible_decryptors: list[int] = []
73
74
  try:
74
- self._dnpp = DotNetPEPayload(file_path, yara_rule)
75
+ self._dnpp = DotNetPEPayload(file_path, yara_rule, data)
75
76
  except Exception as e:
76
77
  raise e
77
78
  self.report["sha256"] = self._dnpp.sha256
@@ -53,9 +53,11 @@ class DotNetPEMethod:
53
53
 
54
54
 
55
55
  class DotNetPEPayload:
56
- def __init__(self, file_path: str, yara_rule: Rules = None) -> None:
56
+ def __init__(self, file_path: str, yara_rule: Rules = None, data: bytes = None) -> None:
57
57
  self.file_path = file_path
58
- self.data = self._get_file_data()
58
+ self.data = data
59
+ if not self.data:
60
+ self.data = self._get_file_data()
59
61
 
60
62
  # Calculate SHA256
61
63
  sha256_obj = sha256()
@@ -64,7 +66,10 @@ class DotNetPEPayload:
64
66
 
65
67
  self.dotnetpe: dnPE = None
66
68
  try:
67
- self.dotnetpe = dnPE(self.file_path, clr_lazy_load=True)
69
+ if self.data:
70
+ self.dotnetpe = dnPE(data=self.data, clr_lazy_load=True)
71
+ else:
72
+ self.dotnetpe = dnPE(self.file_path, clr_lazy_load=True)
68
73
  except Exception:
69
74
  raise ConfigParserException("Failed to load project as dotnet executable")
70
75
 
@@ -162,11 +167,11 @@ class DotNetPEPayload:
162
167
  logger.debug(f"Successfully read {len(data)} bytes")
163
168
  return data
164
169
 
165
- # Tests a given YARA rule object against the file at self.file_path,
170
+ # Tests a given YARA rule object against the file content,
166
171
  # returning the matching rule's name, or "No match"
167
172
  def _match_yara(self, rule: Rules) -> str:
168
173
  try:
169
- match = rule.match(self.file_path)
174
+ match = rule.match(data=self.data)
170
175
  return str(match[0]) if len(match) > 0 else "No match"
171
176
  except Exception as e:
172
177
  logger.exception(e)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rat-king-parser
3
- Version: 3.2.2
3
+ Version: 3.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