atomicshop 3.1.0__py3-none-any.whl → 3.1.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.
Potentially problematic release.
This version of atomicshop might be problematic. Click here for more details.
- atomicshop/__init__.py +1 -1
- atomicshop/mitm/connection_thread_worker.py +2 -2
- atomicshop/mitm/engines/__parent/recorder___parent.py +1 -1
- atomicshop/mitm/engines/create_module_template.py +1 -1
- atomicshop/mitm/import_config.py +8 -2
- atomicshop/mitm/initialize_engines.py +26 -14
- atomicshop/wrappers/mongodbw/mongodbw.py +4 -4
- atomicshop/wrappers/socketw/socket_wrapper.py +6 -1
- {atomicshop-3.1.0.dist-info → atomicshop-3.1.2.dist-info}/METADATA +1 -1
- {atomicshop-3.1.0.dist-info → atomicshop-3.1.2.dist-info}/RECORD +13 -13
- {atomicshop-3.1.0.dist-info → atomicshop-3.1.2.dist-info}/LICENSE.txt +0 -0
- {atomicshop-3.1.0.dist-info → atomicshop-3.1.2.dist-info}/WHEEL +0 -0
- {atomicshop-3.1.0.dist-info → atomicshop-3.1.2.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
|
@@ -181,7 +181,7 @@ def thread_worker_main(
|
|
|
181
181
|
network_logger.info("Thread Finished. Will continue listening on the Main thread")
|
|
182
182
|
|
|
183
183
|
def create_requester_request(client_message: ClientMessage) -> list[bytes]:
|
|
184
|
-
requests: list = [requester.
|
|
184
|
+
requests: list = [requester.create_request(client_message)]
|
|
185
185
|
|
|
186
186
|
# Output first 100 characters of all the requests in the list.
|
|
187
187
|
for request_raw_bytes_single in requests:
|
|
@@ -341,7 +341,7 @@ def thread_worker_main(
|
|
|
341
341
|
client_message = client_connection_message
|
|
342
342
|
|
|
343
343
|
bytes_to_send_list: list[bytes] = create_responder_response(client_message)
|
|
344
|
-
print_api(f"Got responses from responder, count: [{len(bytes_to_send_list)}]", logger=network_logger,
|
|
344
|
+
print_api(f"Got responses from connect responder, count: [{len(bytes_to_send_list)}]", logger=network_logger,
|
|
345
345
|
logger_method='info')
|
|
346
346
|
else:
|
|
347
347
|
client_message.reinitialize_dynamic_vars()
|
|
@@ -76,7 +76,7 @@ class RecorderParent:
|
|
|
76
76
|
self.recorder_worker_thread = threading.Thread(
|
|
77
77
|
target=save_message_worker,
|
|
78
78
|
args=(self.record_file_path, self.message_queue, self.logger),
|
|
79
|
-
name=f"Thread-{self.class_client_message.thread_id}
|
|
79
|
+
name=f"Thread-{self.class_client_message.thread_id}-Recorder",
|
|
80
80
|
daemon=True
|
|
81
81
|
)
|
|
82
82
|
self.recorder_worker_thread.start()
|
|
@@ -80,7 +80,7 @@ class CreateModuleTemplate:
|
|
|
80
80
|
|
|
81
81
|
config_lines_list.append('[engine]')
|
|
82
82
|
config_lines_list.append(f'domains = [{", ".join(domains_with_quotes)}]')
|
|
83
|
-
config_lines_list.append('localhost =
|
|
83
|
+
config_lines_list.append('localhost = 1\n')
|
|
84
84
|
# config_lines_list.append(f'\n')
|
|
85
85
|
config_lines_list.append('[mtls]')
|
|
86
86
|
config_lines_list.append('# "subdomain.domain.com" = "file_name_in_current_dir.pem"\n')
|
atomicshop/mitm/import_config.py
CHANGED
|
@@ -89,7 +89,10 @@ def import_engines_configs() -> int:
|
|
|
89
89
|
# Initialize engine.
|
|
90
90
|
current_module: initialize_engines.ModuleCategory = initialize_engines.ModuleCategory(config_static.MainConfig.SCRIPT_DIRECTORY)
|
|
91
91
|
current_module.fill_engine_fields_from_config(engine_config_path.path)
|
|
92
|
-
current_module.initialize_engine()
|
|
92
|
+
result_code, error = current_module.initialize_engine()
|
|
93
|
+
if result_code != 0:
|
|
94
|
+
print_api(f"Error initializing engine from directory: {Path(engine_config_path.path).parent}\n{error}", color='red')
|
|
95
|
+
return result_code
|
|
93
96
|
|
|
94
97
|
# Extending the full engine domain list with this list.
|
|
95
98
|
domains_engine_list_full.extend(current_module.domain_list)
|
|
@@ -99,7 +102,10 @@ def import_engines_configs() -> int:
|
|
|
99
102
|
# ==== Initialize Reference Module =============================================================================
|
|
100
103
|
reference_module: initialize_engines.ModuleCategory = initialize_engines.ModuleCategory(config_static.MainConfig.SCRIPT_DIRECTORY)
|
|
101
104
|
reference_module.fill_engine_fields_from_general_reference(config_static.MainConfig.ENGINES_DIRECTORY_PATH)
|
|
102
|
-
reference_module.initialize_engine(reference_general=True)
|
|
105
|
+
result_code, error = reference_module.initialize_engine(reference_general=True)
|
|
106
|
+
if result_code != 0:
|
|
107
|
+
print_api(f"Error initializing reference engine from file: {config_static.MainConfig.ENGINES_DIRECTORY_PATH}\n{error}", color='red')
|
|
108
|
+
return result_code
|
|
103
109
|
|
|
104
110
|
# Assigning all the engines domains to all time domains, that will be responsible for adding new domains.
|
|
105
111
|
config_static.Certificates.domains_all_times = list(domains_engine_list_full)
|
|
@@ -3,8 +3,8 @@ from pathlib import Path
|
|
|
3
3
|
|
|
4
4
|
from ..file_io import tomls
|
|
5
5
|
from ..basics.classes import import_first_class_name_from_file_path
|
|
6
|
-
from .engines.__reference_general import parser___reference_general,
|
|
7
|
-
recorder___reference_general
|
|
6
|
+
from .engines.__reference_general import parser___reference_general, requester___reference_general, \
|
|
7
|
+
responder___reference_general, recorder___reference_general
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class ModuleCategory:
|
|
@@ -18,10 +18,12 @@ class ModuleCategory:
|
|
|
18
18
|
self.mtls: dict = dict()
|
|
19
19
|
|
|
20
20
|
self.parser_file_path: str = str()
|
|
21
|
+
self.requester_file_path: str = str()
|
|
21
22
|
self.responder_file_path: str = str()
|
|
22
23
|
self.recorder_file_path: str = str()
|
|
23
24
|
|
|
24
25
|
self.parser_class_object: str = str()
|
|
26
|
+
self.requester_class_object: str = str()
|
|
25
27
|
self.responder_class_object: str = str()
|
|
26
28
|
self.recorder_class_object: str = str()
|
|
27
29
|
|
|
@@ -31,6 +33,7 @@ class ModuleCategory:
|
|
|
31
33
|
reference_folder_path: str = engines_fullpath + os.sep + self.engine_name
|
|
32
34
|
# Full path to file.
|
|
33
35
|
self.parser_file_path = reference_folder_path + os.sep + "parser___reference_general.py"
|
|
36
|
+
self.requester_file_path = reference_folder_path + os.sep + "requester___reference_general.py"
|
|
34
37
|
self.responder_file_path = reference_folder_path + os.sep + "responder___reference_general.py"
|
|
35
38
|
self.recorder_file_path = reference_folder_path + os.sep + "recorder___reference_general.py"
|
|
36
39
|
|
|
@@ -62,6 +65,7 @@ class ModuleCategory:
|
|
|
62
65
|
|
|
63
66
|
# Full path to file
|
|
64
67
|
self.parser_file_path = f"{engine_directory_path}{os.sep}parser{file_name_suffix}.py"
|
|
68
|
+
self.requester_file_path = f"{engine_directory_path}{os.sep}requester{file_name_suffix}.py"
|
|
65
69
|
self.responder_file_path = f"{engine_directory_path}{os.sep}responder{file_name_suffix}.py"
|
|
66
70
|
self.recorder_file_path = f"{engine_directory_path}{os.sep}recorder{file_name_suffix}.py"
|
|
67
71
|
|
|
@@ -74,18 +78,26 @@ class ModuleCategory:
|
|
|
74
78
|
for subdomain, file_name in self.mtls.items():
|
|
75
79
|
self.mtls[subdomain] = f'{engine_directory_path}{os.sep}{file_name}'
|
|
76
80
|
|
|
77
|
-
def initialize_engine(self, reference_general: bool = False):
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
self.
|
|
81
|
-
|
|
82
|
-
self.
|
|
83
|
-
|
|
84
|
-
self.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
def initialize_engine(self, reference_general: bool = False) -> tuple[int, str]:
|
|
82
|
+
try:
|
|
83
|
+
if not reference_general:
|
|
84
|
+
self.parser_class_object = import_first_class_name_from_file_path(
|
|
85
|
+
self.script_directory, self.parser_file_path)
|
|
86
|
+
self.requester_class_object = import_first_class_name_from_file_path(
|
|
87
|
+
self.script_directory, self.requester_file_path)
|
|
88
|
+
self.responder_class_object = import_first_class_name_from_file_path(
|
|
89
|
+
self.script_directory, self.responder_file_path)
|
|
90
|
+
self.recorder_class_object = import_first_class_name_from_file_path(
|
|
91
|
+
self.script_directory, self.recorder_file_path)
|
|
92
|
+
else:
|
|
93
|
+
self.parser_class_object = parser___reference_general.ParserGeneral
|
|
94
|
+
self.requester_class_object = requester___reference_general.RequesterGeneral
|
|
95
|
+
self.responder_class_object = responder___reference_general.ResponderGeneral
|
|
96
|
+
self.recorder_class_object = recorder___reference_general.RecorderGeneral
|
|
97
|
+
except ModuleNotFoundError as e:
|
|
98
|
+
return 1, str(e)
|
|
99
|
+
|
|
100
|
+
return 0, ''
|
|
89
101
|
|
|
90
102
|
|
|
91
103
|
def assign_class_by_domain(
|
|
@@ -867,7 +867,7 @@ def find(
|
|
|
867
867
|
entries[entry_index]['_id'] = str(entry['_id'])
|
|
868
868
|
|
|
869
869
|
if key_convert_to_dict and entries:
|
|
870
|
-
entries =
|
|
870
|
+
entries = convert_key_values_to_objects(keys_convert_to_dict=key_convert_to_dict, returned_data=entries)
|
|
871
871
|
|
|
872
872
|
if close_client:
|
|
873
873
|
mongo_client.close()
|
|
@@ -1398,7 +1398,7 @@ def get_stats_db_size(
|
|
|
1398
1398
|
return stats['dataSize']
|
|
1399
1399
|
|
|
1400
1400
|
|
|
1401
|
-
def
|
|
1401
|
+
def convert_key_values_to_objects(
|
|
1402
1402
|
keys_convert_to_dict: list[str],
|
|
1403
1403
|
returned_data: Union[dict, list]
|
|
1404
1404
|
) -> Union[dict, list]:
|
|
@@ -1424,9 +1424,9 @@ def _convert_key_values_to_objects(
|
|
|
1424
1424
|
# This is needed only to know the possible exception types.
|
|
1425
1425
|
raise
|
|
1426
1426
|
else:
|
|
1427
|
-
|
|
1427
|
+
convert_key_values_to_objects(keys_convert_to_dict, value)
|
|
1428
1428
|
elif isinstance(returned_data, list):
|
|
1429
1429
|
for i, item in enumerate(returned_data):
|
|
1430
|
-
returned_data[i] =
|
|
1430
|
+
returned_data[i] = convert_key_values_to_objects(keys_convert_to_dict, item)
|
|
1431
1431
|
|
|
1432
1432
|
return returned_data
|
|
@@ -539,10 +539,15 @@ class SocketWrapper:
|
|
|
539
539
|
process_name = get_command_instance.get_process_name(print_kwargs={'logger': self.logger})
|
|
540
540
|
|
|
541
541
|
source_ip: str = client_address[0]
|
|
542
|
-
source_hostname: str = socket.gethostbyaddr(source_ip)[0]
|
|
543
542
|
engine_name: str = get_engine_name(domain_from_engine, self.engines_list)
|
|
544
543
|
dest_port: int = listening_socket_object.getsockname()[1]
|
|
545
544
|
|
|
545
|
+
# Not always there will be a hostname resolved by the IP address, so we will leave it empty if it fails.
|
|
546
|
+
try:
|
|
547
|
+
source_hostname: str = socket.gethostbyaddr(source_ip)[0]
|
|
548
|
+
except socket.herror:
|
|
549
|
+
source_hostname = ''
|
|
550
|
+
|
|
546
551
|
# If 'accept()' function worked well, SSL worked well, then 'client_socket' won't be empty.
|
|
547
552
|
if client_socket:
|
|
548
553
|
# Get the protocol type from the socket.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=9FkiqXkoIc84EfZfIhFK47xqfKhRhJsieqicu4tjeJE,122
|
|
2
2
|
atomicshop/_basics_temp.py,sha256=6cu2dd6r2dLrd1BRNcVDKTHlsHs_26Gpw8QS6v32lQ0,3699
|
|
3
3
|
atomicshop/_create_pdf_demo.py,sha256=Yi-PGZuMg0RKvQmLqVeLIZYadqEZwUm-4A9JxBl_vYA,3713
|
|
4
4
|
atomicshop/_patch_import.py,sha256=ENp55sKVJ0e6-4lBvZnpz9PQCt3Otbur7F6aXDlyje4,6334
|
|
@@ -136,20 +136,20 @@ atomicshop/file_io/xmls.py,sha256=zh3SuK-dNaFq2NDNhx6ivcf4GYCfGM8M10PcEwDSpxk,21
|
|
|
136
136
|
atomicshop/mitm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
137
137
|
atomicshop/mitm/config_static.py,sha256=N3D06C_wUytwm80PQCL90ZGHLMHeQlCcI2XQQU2FZ1I,8145
|
|
138
138
|
atomicshop/mitm/config_toml_editor.py,sha256=2p1CMcktWRR_NW-SmyDwylu63ad5e0-w1QPMa8ZLDBw,1635
|
|
139
|
-
atomicshop/mitm/connection_thread_worker.py,sha256=
|
|
140
|
-
atomicshop/mitm/import_config.py,sha256=
|
|
141
|
-
atomicshop/mitm/initialize_engines.py,sha256=
|
|
139
|
+
atomicshop/mitm/connection_thread_worker.py,sha256=Iea2XszWwqcvIq1eyRDBkIuW1uUQHVaAxfdA9EZolac,28507
|
|
140
|
+
atomicshop/mitm/import_config.py,sha256=gCH1hV-CxBAdwjeFJu1I5ntbm5hqzcB0y0vzRPkzra0,16936
|
|
141
|
+
atomicshop/mitm/initialize_engines.py,sha256=Pj9k3iLdoE0KAl3QWG1Z10LHUHY8WQivSPFnQLhCWrc,7385
|
|
142
142
|
atomicshop/mitm/message.py,sha256=CDhhm4BTuZE7oNZCjvIZ4BuPOW4MuIzQLOg91hJaxDI,3065
|
|
143
143
|
atomicshop/mitm/mitm_main.py,sha256=cfQLaPaUZgluatlZDRiToi14ekZbPT2KM4-AiivTs3w,30055
|
|
144
144
|
atomicshop/mitm/recs_files.py,sha256=ZAAD0twun-FtmbSniXe3XQhIlawvANNB_HxwbHj7kwI,3151
|
|
145
145
|
atomicshop/mitm/shared_functions.py,sha256=0lzeyINd44sVEfFbahJxQmz6KAMWbYrW5ou3UYfItvw,1777
|
|
146
146
|
atomicshop/mitm/statistic_analyzer.py,sha256=5_sAYGX2Xunzo_pS2W5WijNCwr_BlGJbbOO462y_wN4,27533
|
|
147
147
|
atomicshop/mitm/engines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
148
|
-
atomicshop/mitm/engines/create_module_template.py,sha256=
|
|
148
|
+
atomicshop/mitm/engines/create_module_template.py,sha256=Qu7ca72BsbcPrtonJM1ok7pGlwu0u6gEDap1ht6vMw0,5577
|
|
149
149
|
atomicshop/mitm/engines/create_module_template_main_example.py,sha256=LeQ44Rp2Gi_KbIDY_4OMS0odkSK3zFZWra_oAka5eJY,243
|
|
150
150
|
atomicshop/mitm/engines/__parent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
151
151
|
atomicshop/mitm/engines/__parent/parser___parent.py,sha256=HHaCXhScl3OlPjz6eUxsDpJaZyk6BNuDMc9xCkeo2Ws,661
|
|
152
|
-
atomicshop/mitm/engines/__parent/recorder___parent.py,sha256=
|
|
152
|
+
atomicshop/mitm/engines/__parent/recorder___parent.py,sha256=I5RNNtqc2DRIm1E9grOkTvk9F79mfJvTl9vfVEUgcLE,6010
|
|
153
153
|
atomicshop/mitm/engines/__parent/requester___parent.py,sha256=mKHR1xrfx0CCO74vv164Fr_dVDhptqvYsE3ORoM4_7k,5107
|
|
154
154
|
atomicshop/mitm/engines/__parent/responder___parent.py,sha256=mtiS_6ej9nxT9UhAQR4ftMqnqL-j_kO3u8KEaoEaI9k,9495
|
|
155
155
|
atomicshop/mitm/engines/__reference_general/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -275,7 +275,7 @@ atomicshop/wrappers/mongodbw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
|
275
275
|
atomicshop/wrappers/mongodbw/install_mongodb_ubuntu.py,sha256=2eEOb35T259lhn5koynfTIm1hanxD02zN97ExGSBM2o,4021
|
|
276
276
|
atomicshop/wrappers/mongodbw/install_mongodb_win.py,sha256=64EUQYx7VuMC3ndO2x3nSErh5NZ_BsqMwGvPcybfC-Q,8499
|
|
277
277
|
atomicshop/wrappers/mongodbw/mongo_infra.py,sha256=IjEF0jPzQz866MpTm7rnksnyyWQeUT_B2h2DA9ryAio,2034
|
|
278
|
-
atomicshop/wrappers/mongodbw/mongodbw.py,sha256=
|
|
278
|
+
atomicshop/wrappers/mongodbw/mongodbw.py,sha256=CHbDfW9CXzXUs3V97DYQpt-dYlt_gB60JhwqG2tVFQY,56049
|
|
279
279
|
atomicshop/wrappers/nodejsw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
280
280
|
atomicshop/wrappers/nodejsw/install_nodejs_ubuntu.py,sha256=wjpJdfAaY92RYl_L9esDIWuBMGeYH35RHJ5BVgMof8Y,6260
|
|
281
281
|
atomicshop/wrappers/nodejsw/install_nodejs_windows.py,sha256=WvXIcEVnKcQYD-KNwhVP094s__1tt0Ir2Y87MABl8Nc,6283
|
|
@@ -330,14 +330,14 @@ atomicshop/wrappers/socketw/sender.py,sha256=aX_K8l_rHjd5AWb8bi5mt8-YTkMYVRDB6Dn
|
|
|
330
330
|
atomicshop/wrappers/socketw/sni.py,sha256=q-F-R1KtE94g8WGrR3QHgi-otXZJUPBprEwQqnY80_A,17639
|
|
331
331
|
atomicshop/wrappers/socketw/socket_client.py,sha256=AQKjm_GZLH2PO7gkFbwzIbXzUXxRFvBTc6onrgapFqs,22048
|
|
332
332
|
atomicshop/wrappers/socketw/socket_server_tester.py,sha256=Qobmh4XV8ZxLUaw-eW4ESKAbeSLecCKn2OWFzMhadk0,6420
|
|
333
|
-
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=
|
|
333
|
+
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=3sEz1VUar1JJU8KxocrOT09-vIh5hLpE29aTZH9TNC8,41117
|
|
334
334
|
atomicshop/wrappers/socketw/ssl_base.py,sha256=kmiif84kMhBr5yjQW17p935sfjR5JKG0LxIwBA4iVvU,2275
|
|
335
335
|
atomicshop/wrappers/socketw/statistics_csv.py,sha256=WcNyaqEZ82S5-f3kzqi1nllNT2Nd2P_zg8HqCc7vW4s,4120
|
|
336
336
|
atomicshop/wrappers/winregw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
337
337
|
atomicshop/wrappers/winregw/winreg_installed_software.py,sha256=Qzmyktvob1qp6Tjk2DjLfAqr_yXV0sgWzdMW_9kwNjY,2345
|
|
338
338
|
atomicshop/wrappers/winregw/winreg_network.py,sha256=3Ts1sVqSUiCDsHRHwJCbiZ9EYvv2ELGxF0Y_pibGU4k,9596
|
|
339
|
-
atomicshop-3.1.
|
|
340
|
-
atomicshop-3.1.
|
|
341
|
-
atomicshop-3.1.
|
|
342
|
-
atomicshop-3.1.
|
|
343
|
-
atomicshop-3.1.
|
|
339
|
+
atomicshop-3.1.2.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
340
|
+
atomicshop-3.1.2.dist-info/METADATA,sha256=3K-v2aK-rRo1shq8oR83WC2o6im2elEruEBAgdXDjb4,10653
|
|
341
|
+
atomicshop-3.1.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
342
|
+
atomicshop-3.1.2.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
343
|
+
atomicshop-3.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|