rat-king-parser 4.0.2__tar.gz → 4.1.0__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.
- {rat_king_parser-4.0.2/src/rat_king_parser.egg-info → rat_king_parser-4.1.0}/PKG-INFO +27 -3
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/README.md +22 -1
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/pyproject.toml +4 -1
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/_version.py +1 -1
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/decryptors/__init__.py +3 -0
- rat_king_parser-4.1.0/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_aes_with_iv_bpkdf2.py +155 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/dotnetpe_payload.py +64 -1
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0/src/rat_king_parser.egg-info}/PKG-INFO +27 -3
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser.egg-info/SOURCES.txt +1 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser.egg-info/requires.txt +3 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/LICENSE +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/setup.cfg +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/__init__.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/__init__.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/config_parser_exception.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/rat_config_parser.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/__init__.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/config_item.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/config_normalization.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/data_utils.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_aes_with_iv.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_decrypt_xor.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_ecb.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_plaintext.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_random_hardcoded.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/dotnet_constants.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/extern/__init__.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/extern/maco/__init__.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/extern/maco/rkp_maco.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/rkp.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/yara_utils/__init__.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/yara_utils/recompile.py +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/yara_utils/rules.yar +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/yara_utils/rules.yarc +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser.egg-info/dependency_links.txt +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser.egg-info/entry_points.txt +0 -0
- {rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: rat-king-parser
|
|
3
|
-
Version: 4.0
|
|
3
|
+
Version: 4.1.0
|
|
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>
|
|
@@ -29,9 +29,12 @@ License-File: LICENSE
|
|
|
29
29
|
Requires-Dist: dnfile
|
|
30
30
|
Requires-Dist: pycryptodomex
|
|
31
31
|
Requires-Dist: yara-python
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
32
34
|
Provides-Extra: maco
|
|
33
35
|
Requires-Dist: maco; extra == "maco"
|
|
34
36
|
Requires-Dist: validators; extra == "maco"
|
|
37
|
+
Dynamic: license-file
|
|
35
38
|
|
|
36
39
|

|
|
37
40
|
|
|
@@ -597,9 +600,30 @@ $ rat-king-parser -n dangerzone/* | jq
|
|
|
597
600
|
]
|
|
598
601
|
```
|
|
599
602
|
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
## Development Guide
|
|
606
|
+
**More Verbose Guide To Be Published**
|
|
607
|
+
|
|
608
|
+
### Development Dependencies
|
|
609
|
+
|
|
610
|
+
RKP uses `pre-commit` to enforce formatting.
|
|
611
|
+
|
|
612
|
+
To begin development and install `pre-commit`, use the following command:
|
|
613
|
+
|
|
614
|
+
```bash
|
|
615
|
+
pip install .[dev]
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
Then, ensure you install the pre-commit hook:
|
|
619
|
+
|
|
620
|
+
```bash
|
|
621
|
+
pre-commit install
|
|
622
|
+
```
|
|
623
|
+
|
|
600
624
|
## Feedback, Issues, and Additions
|
|
601
625
|
|
|
602
|
-
If you have suggestions for improvement, bugs, feedback, or additional RAT families that use a similar configuration format as AsyncRAT, QuasarRAT, VenomRAT, DcRAT, etc. that are not yet supported, please send me a message on [
|
|
626
|
+
If you have suggestions for improvement, bugs, feedback, or additional RAT families that use a similar configuration format as AsyncRAT, QuasarRAT, VenomRAT, DcRAT, etc. that are not yet supported, please send me a message on [Bluesky](https://bsky.app/profile/jeff0falltrades.bsky.social), [YouTube](https://www.youtube.com/c/jeff0falltrades), or submit an Issue or PR in this repo.
|
|
603
627
|
|
|
604
628
|
Also, if this tool or video tutorial was helpful to you, that's always nice to hear as well!
|
|
605
629
|
|
|
@@ -562,9 +562,30 @@ $ rat-king-parser -n dangerzone/* | jq
|
|
|
562
562
|
]
|
|
563
563
|
```
|
|
564
564
|
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
## Development Guide
|
|
568
|
+
**More Verbose Guide To Be Published**
|
|
569
|
+
|
|
570
|
+
### Development Dependencies
|
|
571
|
+
|
|
572
|
+
RKP uses `pre-commit` to enforce formatting.
|
|
573
|
+
|
|
574
|
+
To begin development and install `pre-commit`, use the following command:
|
|
575
|
+
|
|
576
|
+
```bash
|
|
577
|
+
pip install .[dev]
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
Then, ensure you install the pre-commit hook:
|
|
581
|
+
|
|
582
|
+
```bash
|
|
583
|
+
pre-commit install
|
|
584
|
+
```
|
|
585
|
+
|
|
565
586
|
## Feedback, Issues, and Additions
|
|
566
587
|
|
|
567
|
-
If you have suggestions for improvement, bugs, feedback, or additional RAT families that use a similar configuration format as AsyncRAT, QuasarRAT, VenomRAT, DcRAT, etc. that are not yet supported, please send me a message on [
|
|
588
|
+
If you have suggestions for improvement, bugs, feedback, or additional RAT families that use a similar configuration format as AsyncRAT, QuasarRAT, VenomRAT, DcRAT, etc. that are not yet supported, please send me a message on [Bluesky](https://bsky.app/profile/jeff0falltrades.bsky.social), [YouTube](https://www.youtube.com/c/jeff0falltrades), or submit an Issue or PR in this repo.
|
|
568
589
|
|
|
569
590
|
Also, if this tool or video tutorial was helpful to you, that's always nice to hear as well!
|
|
570
591
|
|
|
@@ -36,7 +36,7 @@ classifiers = [
|
|
|
36
36
|
]
|
|
37
37
|
dynamic = [ "version" ]
|
|
38
38
|
dependencies = [ "dnfile", "pycryptodomex", "yara-python" ]
|
|
39
|
-
|
|
39
|
+
optional-dependencies.dev = [ "pre-commit" ]
|
|
40
40
|
optional-dependencies.maco = [ "maco", "validators" ]
|
|
41
41
|
urls."Bug Reports" = "https://github.com/jeFF0Falltrades/rat_king_parser/issues"
|
|
42
42
|
urls."Homepage" = "https://github.com/jeFF0Falltrades/rat_king_parser"
|
|
@@ -56,3 +56,6 @@ namespaces = false
|
|
|
56
56
|
|
|
57
57
|
[tool.ruff]
|
|
58
58
|
lint.extend-select = [ "I" ]
|
|
59
|
+
|
|
60
|
+
[tool.pre-commit]
|
|
61
|
+
hook-config = "file:.pre-commit-config.yaml"
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
# SOFTWARE.
|
|
26
26
|
from .config_decryptor import ConfigDecryptor, IncompatibleDecryptorException
|
|
27
27
|
from .config_decryptor_aes_with_iv import ConfigDecryptorAESWithIV
|
|
28
|
+
from .config_decryptor_aes_with_iv_pbkdf2 import ConfigDecryptorAESWithIV_pbkdf
|
|
28
29
|
from .config_decryptor_decrypt_xor import ConfigDecryptorDecryptXOR
|
|
29
30
|
from .config_decryptor_ecb import ConfigDecryptorECB
|
|
30
31
|
from .config_decryptor_plaintext import ConfigDecryptorPlaintext
|
|
@@ -34,6 +35,7 @@ __all__ = [
|
|
|
34
35
|
ConfigDecryptor,
|
|
35
36
|
IncompatibleDecryptorException,
|
|
36
37
|
ConfigDecryptorAESWithIV,
|
|
38
|
+
ConfigDecryptorAESWithIV_pbkdf,
|
|
37
39
|
ConfigDecryptorECB,
|
|
38
40
|
ConfigDecryptorDecryptXOR,
|
|
39
41
|
ConfigDecryptorRandomHardcoded,
|
|
@@ -43,6 +45,7 @@ __all__ = [
|
|
|
43
45
|
# ConfigDecryptorPlaintext should always be the last fallthrough case
|
|
44
46
|
SUPPORTED_DECRYPTORS = [
|
|
45
47
|
ConfigDecryptorAESWithIV,
|
|
48
|
+
ConfigDecryptorAESWithIV_pbkdf,
|
|
46
49
|
ConfigDecryptorECB,
|
|
47
50
|
ConfigDecryptorDecryptXOR,
|
|
48
51
|
ConfigDecryptorRandomHardcoded,
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
#
|
|
3
|
+
# config_decryptor_aes_with_iv_bpkdf2
|
|
4
|
+
#
|
|
5
|
+
# Author: doomedraven
|
|
6
|
+
#
|
|
7
|
+
# MIT License
|
|
8
|
+
#
|
|
9
|
+
# Copyright (c) 2025 Jeff Archer
|
|
10
|
+
#
|
|
11
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
# in the Software without restriction, including without limitation the rights
|
|
14
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
# furnished to do so, subject to the following conditions:
|
|
17
|
+
#
|
|
18
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
# copies or substantial portions of the Software.
|
|
20
|
+
#
|
|
21
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
# SOFTWARE.
|
|
28
|
+
import re
|
|
29
|
+
from base64 import b64decode
|
|
30
|
+
from logging import getLogger
|
|
31
|
+
|
|
32
|
+
from Cryptodome.Cipher import AES
|
|
33
|
+
from Cryptodome.Cipher.AES import MODE_CBC as CBC
|
|
34
|
+
from Cryptodome.Protocol.KDF import PBKDF2
|
|
35
|
+
from Cryptodome.Util.Padding import unpad
|
|
36
|
+
|
|
37
|
+
from ...config_parser_exception import ConfigParserException
|
|
38
|
+
from ..data_utils import bytes_to_int, decode_bytes
|
|
39
|
+
from ..dotnetpe_payload import DotNetPEPayload
|
|
40
|
+
from .config_decryptor import ConfigDecryptor, IncompatibleDecryptorException
|
|
41
|
+
|
|
42
|
+
logger = getLogger(__name__)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class ConfigDecryptorAESWithIV_pbkdf2(ConfigDecryptor):
|
|
46
|
+
# Minimum length of valid ciphertext
|
|
47
|
+
_MIN_CIPHERTEXT_LEN = 16
|
|
48
|
+
|
|
49
|
+
# Do not re.compile in-line replacement patterns
|
|
50
|
+
_PATTERN_AES_SALT_ITER = re.compile(rb"\x72(.{4})\x1f(.)\x8d.{4}\x25\xd0(.{4})\x28")
|
|
51
|
+
|
|
52
|
+
def __init__(self, payload: DotNetPEPayload) -> None:
|
|
53
|
+
super().__init__(payload)
|
|
54
|
+
try:
|
|
55
|
+
self._get_aes_metadata()
|
|
56
|
+
except Exception as e:
|
|
57
|
+
raise IncompatibleDecryptorException(e)
|
|
58
|
+
|
|
59
|
+
# Given an initialization vector and ciphertext, creates a Cipher
|
|
60
|
+
# object with the AES key and specified IV and decrypts the ciphertext
|
|
61
|
+
def _decrypt(self, iv: bytes, ciphertext: bytes) -> bytes:
|
|
62
|
+
logger.debug(
|
|
63
|
+
f"Decrypting {ciphertext} with key {self.key.hex()} and IV {iv.hex()}..."
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
cipher = AES.new(self.key, mode=CBC, iv=iv)
|
|
67
|
+
unpadded_text = ""
|
|
68
|
+
|
|
69
|
+
try:
|
|
70
|
+
unpadded_text = cipher.decrypt(ciphertext)
|
|
71
|
+
unpadded_text = unpad(unpadded_text, AES.block_size)
|
|
72
|
+
except Exception as e:
|
|
73
|
+
logger.debug(ciphertext)
|
|
74
|
+
raise ConfigParserException(
|
|
75
|
+
f"Error decrypting ciphertext with IV {iv.hex()} and key {self.key.hex()} : {e}"
|
|
76
|
+
)
|
|
77
|
+
logger.debug(f"Decryption result: {unpadded_text}")
|
|
78
|
+
return unpadded_text
|
|
79
|
+
|
|
80
|
+
# Decrypts encrypted config values with the provided cipher data
|
|
81
|
+
def decrypt_encrypted_strings(
|
|
82
|
+
self, encrypted_strings: dict[str, str]
|
|
83
|
+
) -> dict[str, str]:
|
|
84
|
+
logger.debug("Decrypting encrypted strings...")
|
|
85
|
+
decrypted_config_strings = {}
|
|
86
|
+
for k, v in encrypted_strings.items():
|
|
87
|
+
# Leave empty strings as they are
|
|
88
|
+
if len(v) == 0:
|
|
89
|
+
logger.debug(f"Key: {k}, Value: {v}")
|
|
90
|
+
decrypted_config_strings[k] = v
|
|
91
|
+
continue
|
|
92
|
+
|
|
93
|
+
# Check if base64-encoded string
|
|
94
|
+
b64_exception = False
|
|
95
|
+
try:
|
|
96
|
+
decoded_val = b64decode(v)
|
|
97
|
+
except Exception:
|
|
98
|
+
b64_exception = True
|
|
99
|
+
# If it was not base64-encoded, or if it is less than our min length
|
|
100
|
+
# for ciphertext, leave the value as it is
|
|
101
|
+
if b64_exception or len(decoded_val) < self._MIN_CIPHERTEXT_LEN:
|
|
102
|
+
logger.debug(f"Key: {k}, Value: {v}")
|
|
103
|
+
decrypted_config_strings[k] = v
|
|
104
|
+
continue
|
|
105
|
+
|
|
106
|
+
result, last_exc = None, None
|
|
107
|
+
# Run through key candidates until suitable one found or failure
|
|
108
|
+
|
|
109
|
+
try:
|
|
110
|
+
result = decode_bytes(self._decrypt(self.iv, decoded_val))
|
|
111
|
+
except ConfigParserException as e:
|
|
112
|
+
last_exc = e
|
|
113
|
+
print("error", e)
|
|
114
|
+
|
|
115
|
+
if result is None:
|
|
116
|
+
logger.debug(
|
|
117
|
+
f"Decryption failed for item {v}: {last_exc}; Leaving as original value..."
|
|
118
|
+
)
|
|
119
|
+
result = v
|
|
120
|
+
|
|
121
|
+
logger.debug(f"Key: {k}, Value: {result}")
|
|
122
|
+
decrypted_config_strings[k] = result
|
|
123
|
+
|
|
124
|
+
logger.debug("Successfully decrypted strings")
|
|
125
|
+
return decrypted_config_strings
|
|
126
|
+
|
|
127
|
+
# Identifies the initialization of the AES256 object in the payload and
|
|
128
|
+
# sets the necessary values needed for decryption
|
|
129
|
+
def _get_aes_metadata(self) -> None:
|
|
130
|
+
logger.debug("Extracting AES metadata...")
|
|
131
|
+
# Some payloads have multiple embedded salt values:
|
|
132
|
+
# Find the one that is actually used for initialization
|
|
133
|
+
for candidate in re.finditer(self._PATTERN_AES_SALT_ITER, self._payload.data):
|
|
134
|
+
password, size, salt_rva = candidate.groups()
|
|
135
|
+
|
|
136
|
+
try:
|
|
137
|
+
self.salt = self._get_aes_salt(salt_rva, int.from_bytes(size))
|
|
138
|
+
password = self._payload.user_string_from_rva(bytes_to_int(password))
|
|
139
|
+
key = PBKDF2(password, self.salt, dkLen=48)
|
|
140
|
+
self.iv = key[32:]
|
|
141
|
+
self.key = key[:32]
|
|
142
|
+
except ConfigParserException as cfe:
|
|
143
|
+
logger.info(
|
|
144
|
+
f"Initialization using salt candidate {hex(bytes_to_int(candidate.groups()[0]))} failed: {cfe}"
|
|
145
|
+
)
|
|
146
|
+
continue
|
|
147
|
+
|
|
148
|
+
# Extracts the AES salt from the payload, accounting for both hardcoded
|
|
149
|
+
# salt byte arrays, and salts derived from hardcoded strings
|
|
150
|
+
def _get_aes_salt(self, salt_rva: int, salt_size: int) -> bytes:
|
|
151
|
+
logger.debug("Extracting AES salt value...")
|
|
152
|
+
salt_strings_rva = bytes_to_int(salt_rva)
|
|
153
|
+
salt = self._payload.byte_array_from_size_and_rva(salt_size, salt_strings_rva)
|
|
154
|
+
logger.debug(f"Found salt value: {salt.hex()}")
|
|
155
|
+
return salt
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
#
|
|
3
3
|
# dotnetpe_payload.py
|
|
4
4
|
#
|
|
5
|
-
#
|
|
5
|
+
# Authors: jeFF0Falltrades, doomedraven
|
|
6
6
|
#
|
|
7
7
|
# Provides a wrapper class for accessing metadata from a DotNetPE object and
|
|
8
8
|
# performing data conversions
|
|
@@ -212,3 +212,66 @@ class DotNetPEPayload:
|
|
|
212
212
|
# Given an RVA, derives the corresponding User String
|
|
213
213
|
def user_string_from_rva(self, rva: int) -> str:
|
|
214
214
|
return self.dotnetpe.net.user_strings.get(rva ^ MDT_STRING).value
|
|
215
|
+
|
|
216
|
+
def custom_attribute_from_type(self, typespacename: str, typename: str) -> dict:
|
|
217
|
+
"""
|
|
218
|
+
Ex:
|
|
219
|
+
typespacename: Server.Properties
|
|
220
|
+
typenaem: Settings
|
|
221
|
+
|
|
222
|
+
dnspy view
|
|
223
|
+
// Server.Properties.Settings
|
|
224
|
+
// Token: 0x17000077 RID: 119
|
|
225
|
+
// (get) Token: 0x06000913 RID: 2323 RVA: 0x00009FED File Offset: 0x000081ED
|
|
226
|
+
// (set) Token: 0x06000914 RID: 2324 RVA: 0x0000A004 File Offset: 0x00008204
|
|
227
|
+
[DebuggerNonUserCode]
|
|
228
|
+
[DefaultSettingValue("3128")]
|
|
229
|
+
[UserScopedSetting]
|
|
230
|
+
public decimal ReverseProxyPort
|
|
231
|
+
|
|
232
|
+
returns: dict.
|
|
233
|
+
Ex: {"ReverseProxyPort": "3128"}
|
|
234
|
+
"""
|
|
235
|
+
config = {}
|
|
236
|
+
try:
|
|
237
|
+
for td in self.dotnetpe.net.mdtables.TypeDef.rows:
|
|
238
|
+
if (
|
|
239
|
+
td.TypeNamespace.value != typespacename
|
|
240
|
+
and td.TypeName.value != typename
|
|
241
|
+
):
|
|
242
|
+
continue
|
|
243
|
+
for pd_row_index, pd in enumerate(
|
|
244
|
+
self.dotnetpe.net.mdtables.Property.rows
|
|
245
|
+
):
|
|
246
|
+
if pd.Name.value.startswith(
|
|
247
|
+
"Boolean_",
|
|
248
|
+
"BorderStyle_",
|
|
249
|
+
"Color_",
|
|
250
|
+
"Byte",
|
|
251
|
+
"Int32_",
|
|
252
|
+
"SizeF_",
|
|
253
|
+
"String_",
|
|
254
|
+
):
|
|
255
|
+
continue
|
|
256
|
+
for ca in self.dotnetpe.net.mdtables.CustomAttribute.rows:
|
|
257
|
+
if (
|
|
258
|
+
ca.Parent.row_index == pd_row_index + 1
|
|
259
|
+
): # CustomAttribute Parent index is 1-based
|
|
260
|
+
# Extract the value from the CustomAttribute blob
|
|
261
|
+
blob_data = ca.Value.value
|
|
262
|
+
if blob_data and blob_data != b"\x01\x00\x00\x00":
|
|
263
|
+
# Basic handling of the blob data. You might need to adjust this depending on the actual format.
|
|
264
|
+
# In many cases, the value is stored as a UTF-8 string after a preamble.
|
|
265
|
+
try:
|
|
266
|
+
# Skip preamble bytes (usually 2 bytes). 3rd byte is size of data
|
|
267
|
+
value_bytes = blob_data[3:]
|
|
268
|
+
value = value_bytes.decode("utf-8").rstrip("\x00")
|
|
269
|
+
config.setdefault(pd.Name.value, value)
|
|
270
|
+
except UnicodeDecodeError:
|
|
271
|
+
logger.debug(
|
|
272
|
+
"Warning: Could not decode blob data for %s",
|
|
273
|
+
pd.Name.value,
|
|
274
|
+
)
|
|
275
|
+
except Exception as e:
|
|
276
|
+
logger.debug("An error occurred in custom_attribute_from_type: %s", str(e))
|
|
277
|
+
return config
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: rat-king-parser
|
|
3
|
-
Version: 4.0
|
|
3
|
+
Version: 4.1.0
|
|
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>
|
|
@@ -29,9 +29,12 @@ License-File: LICENSE
|
|
|
29
29
|
Requires-Dist: dnfile
|
|
30
30
|
Requires-Dist: pycryptodomex
|
|
31
31
|
Requires-Dist: yara-python
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
32
34
|
Provides-Extra: maco
|
|
33
35
|
Requires-Dist: maco; extra == "maco"
|
|
34
36
|
Requires-Dist: validators; extra == "maco"
|
|
37
|
+
Dynamic: license-file
|
|
35
38
|
|
|
36
39
|

|
|
37
40
|
|
|
@@ -597,9 +600,30 @@ $ rat-king-parser -n dangerzone/* | jq
|
|
|
597
600
|
]
|
|
598
601
|
```
|
|
599
602
|
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
## Development Guide
|
|
606
|
+
**More Verbose Guide To Be Published**
|
|
607
|
+
|
|
608
|
+
### Development Dependencies
|
|
609
|
+
|
|
610
|
+
RKP uses `pre-commit` to enforce formatting.
|
|
611
|
+
|
|
612
|
+
To begin development and install `pre-commit`, use the following command:
|
|
613
|
+
|
|
614
|
+
```bash
|
|
615
|
+
pip install .[dev]
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
Then, ensure you install the pre-commit hook:
|
|
619
|
+
|
|
620
|
+
```bash
|
|
621
|
+
pre-commit install
|
|
622
|
+
```
|
|
623
|
+
|
|
600
624
|
## Feedback, Issues, and Additions
|
|
601
625
|
|
|
602
|
-
If you have suggestions for improvement, bugs, feedback, or additional RAT families that use a similar configuration format as AsyncRAT, QuasarRAT, VenomRAT, DcRAT, etc. that are not yet supported, please send me a message on [
|
|
626
|
+
If you have suggestions for improvement, bugs, feedback, or additional RAT families that use a similar configuration format as AsyncRAT, QuasarRAT, VenomRAT, DcRAT, etc. that are not yet supported, please send me a message on [Bluesky](https://bsky.app/profile/jeff0falltrades.bsky.social), [YouTube](https://www.youtube.com/c/jeff0falltrades), or submit an Issue or PR in this repo.
|
|
603
627
|
|
|
604
628
|
Also, if this tool or video tutorial was helpful to you, that's always nice to hear as well!
|
|
605
629
|
|
|
@@ -22,6 +22,7 @@ src/rat_king_parser/config_parser/utils/dotnetpe_payload.py
|
|
|
22
22
|
src/rat_king_parser/config_parser/utils/decryptors/__init__.py
|
|
23
23
|
src/rat_king_parser/config_parser/utils/decryptors/config_decryptor.py
|
|
24
24
|
src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_aes_with_iv.py
|
|
25
|
+
src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_aes_with_iv_bpkdf2.py
|
|
25
26
|
src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_decrypt_xor.py
|
|
26
27
|
src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_ecb.py
|
|
27
28
|
src/rat_king_parser/config_parser/utils/decryptors/config_decryptor_plaintext.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser/config_parser/utils/__init__.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{rat_king_parser-4.0.2 → rat_king_parser-4.1.0}/src/rat_king_parser.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|