atomicshop 2.20.5__py3-none-any.whl → 2.20.7__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 CHANGED
@@ -1,4 +1,4 @@
1
1
  """Atomic Basic functions and classes to make developer life easier"""
2
2
 
3
3
  __author__ = "Den Kras"
4
- __version__ = '2.20.5'
4
+ __version__ = '2.20.7'
@@ -45,9 +45,9 @@ class CreateModuleTemplate:
45
45
  self.responder_general_path: str = reference_folder_path + os.sep + REFERENCE_RESPONDER_FILE_NAME
46
46
  self.recorder_general_path: str = reference_folder_path + os.sep + REFERENCE_RECORDER_FILE_NAME
47
47
 
48
- self.parser_file_name: str = f"parser_{self.engine_name}.py"
49
- self.responder_file_name: str = f"responder_{self.engine_name}.py"
50
- self.recorder_file_name: str = f"recorder_{self.engine_name}.py"
48
+ self.parser_file_name: str = f"parser.py"
49
+ self.responder_file_name: str = f"responder.py"
50
+ self.recorder_file_name: str = f"recorder.py"
51
51
 
52
52
  self.create_template()
53
53
 
@@ -58,7 +58,7 @@ class CreateModuleTemplate:
58
58
  # Create the 'engines' directory if it doesn't exist.
59
59
  filesystem.create_directory(ENGINES_DIRECTORY_PATH)
60
60
 
61
- # Create new engines folder.
61
+ # Create new engines' folder.
62
62
  filesystem.create_directory(self.new_engine_directory)
63
63
 
64
64
  self._create_engine_module_from_reference(file_path=self.parser_general_path, module_type='parser')
@@ -75,12 +75,10 @@ class CreateModuleTemplate:
75
75
  domains_with_quotes: list = [f'"{domain}"' for domain in self.domains]
76
76
  config_lines_list.append(f'"domains" = [{", ".join(domains_with_quotes)}]\n')
77
77
  # config_lines_list.append(f'\n')
78
- config_lines_list.append(f'"parser_file" = "{self.parser_file_name}"')
79
- config_lines_list.append(f'"responder_file" = "{self.responder_file_name}"')
80
- config_lines_list.append(f'"recorder_file" = "{self.recorder_file_name}"\n')
81
- # config_lines_list.append(f'\n')
82
78
  config_lines_list.append(f'[mtls]')
83
- config_lines_list.append(f'# "subdomain.domain.com" = "file_name_in_current_dir.pem"')
79
+ config_lines_list.append(f'# "subdomain.domain.com" = "file_name_in_current_dir.pem"\n')
80
+ config_lines_list.append(f'[no_sni]')
81
+ config_lines_list.append(f'# "domain" = "example.com"\n')
84
82
 
85
83
  config_file_path = self.new_engine_directory + os.sep + CONFIG_FILE_NAME
86
84
 
@@ -144,6 +144,7 @@ def check_configurations() -> int:
144
144
  # print_api(message, color='red')
145
145
  # return 1
146
146
 
147
+
147
148
  return 0
148
149
 
149
150
 
@@ -52,10 +52,17 @@ class ModuleCategory:
52
52
  if not self.domain_list or self.domain_list[0] == '':
53
53
  raise ValueError(f"Engine Configuration file doesn't contain any domains: {engine_config_file_path}")
54
54
 
55
+ # This is needed for backwards compatibility before glass 1.8.2, atomicshop 2.20.6
56
+ # When the name of each file was following the pattern: parser_<EngineName>.py, responder_<EngineName>.py, recorder_<EngineName>.py
57
+ if os.path.isfile(f"{engine_directory_path}{os.sep}parser.py"):
58
+ file_name_suffix: str = ''
59
+ else:
60
+ file_name_suffix: str = f"_{self.engine_name}"
61
+
55
62
  # Full path to file
56
- self.parser_file_path = f"{engine_directory_path}{os.sep}{configuration_data['parser_file']}"
57
- self.responder_file_path = f"{engine_directory_path}{os.sep}{configuration_data['responder_file']}"
58
- self.recorder_file_path = f"{engine_directory_path}{os.sep}{configuration_data['recorder_file']}"
63
+ self.parser_file_path = f"{engine_directory_path}{os.sep}parser{file_name_suffix}.py"
64
+ self.responder_file_path = f"{engine_directory_path}{os.sep}responder{file_name_suffix}.py"
65
+ self.recorder_file_path = f"{engine_directory_path}{os.sep}recorder{file_name_suffix}.py"
59
66
 
60
67
  for subdomain, file_name in self.mtls.items():
61
68
  self.mtls[subdomain] = f'{engine_directory_path}{os.sep}{file_name}'
@@ -268,8 +268,8 @@ def mitm_server(config_file_path: str, script_version: str):
268
268
 
269
269
  # === Initialize DNS module ====================================================================================
270
270
  if config_static.DNSServer.enable:
271
- # dns_process = multiprocessing.Process(
272
- dns_process = threading.Thread(
271
+ dns_process = multiprocessing.Process(
272
+ # dns_process = threading.Thread(
273
273
  target=dns_server.start_dns_server_multiprocessing_worker,
274
274
  kwargs={
275
275
  'listening_interface': config_static.DNSServer.listening_interface,
@@ -295,6 +295,7 @@ def mitm_server(config_file_path: str, script_version: str):
295
295
  dns_process.daemon = True
296
296
  dns_process.start()
297
297
 
298
+ # Wait for the DNS server to start and do the port test.
298
299
  is_alive: bool = False
299
300
  max_wait_time: int = 5
300
301
  while not is_alive:
@@ -308,6 +309,21 @@ def mitm_server(config_file_path: str, script_version: str):
308
309
  time.sleep(1)
309
310
  return 1
310
311
 
312
+ # Now we can check if the process wasn't terminated after the check.
313
+ max_wait_time: int = 5
314
+ while max_wait_time > 0:
315
+ is_alive = dns_process.is_alive()
316
+
317
+ if not is_alive:
318
+ message = "DNS Server process terminated."
319
+ print_api.print_api(message, error_type=True, color="red", logger=system_logger)
320
+ # Wait for the message to be printed and saved to file.
321
+ time.sleep(1)
322
+ return 1
323
+
324
+ time.sleep(1)
325
+ max_wait_time -= 1
326
+
311
327
  # === EOF Initialize DNS module ================================================================================
312
328
  # === Initialize TCP Server ====================================================================================
313
329
  if config_static.TCPServer.enable:
atomicshop/web.py CHANGED
@@ -196,10 +196,10 @@ def download(
196
196
  print_api.print_api(f'Downloading: {file_url}', **kwargs)
197
197
  print_api.print_api(f'To: {file_path}', **kwargs)
198
198
 
199
- # In order to use 'urllib.request', it is not enough to 'import urllib', you need to 'import urllib.request'.
200
- # Open the URL for data gathering with SSL context from certifi
201
- ssl_context = ssl.create_default_context(cafile=certifi.where())
199
+ # Open the URL for data gathering with SSL context with default CA store of the system.
200
+ ssl_context = ssl.create_default_context()
202
201
 
202
+ # In order to use 'urllib.request', it is not enough to 'import urllib', you need to 'import urllib.request'.
203
203
  # Build a Request object with headers if provided.
204
204
  req = urllib.request.Request(file_url, headers=headers or {})
205
205
  file_to_download = urllib.request.urlopen(req, context=ssl_context)
@@ -309,7 +309,7 @@ class DnsServer:
309
309
  error_messages.append(f"Port [{port}] is already in use by process: {process_info}")
310
310
 
311
311
  message = "\n".join(error_messages)
312
- print_api(f'DnsPortInUseError: {str(e)}', error_type=True, color="red", logger=self.logger)
312
+ print_api(f'DnsPortInUseError: {str(message)}', error_type=True, color="red", logger=self.logger)
313
313
  # Wait for the message to be printed and saved to file.
314
314
  time.sleep(1)
315
315
  raise DnsPortInUseError(message)
@@ -905,8 +905,6 @@ def start_dns_server_multiprocessing_worker(
905
905
  current_process_name = multiprocessing.current_process().name
906
906
  threading.current_thread().name = current_process_name
907
907
 
908
-
909
-
910
908
  try:
911
909
  dns_server_instance = DnsServer(
912
910
  listening_interface=listening_interface,
@@ -928,7 +926,6 @@ def start_dns_server_multiprocessing_worker(
928
926
  logger_name=logger_name
929
927
  )
930
928
  except (DnsPortInUseError, DnsConfigurationValuesError) as e:
931
- print_api(e, error_type=True, color="red", logger=dns_server_instance.logger)
932
929
  # Wait for the message to be printed and saved to file.
933
930
  time.sleep(1)
934
931
  return 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.20.5
3
+ Version: 2.20.7
4
4
  Summary: Atomic functions and classes to make developer life easier
5
5
  Author: Denis Kras
6
6
  License: MIT License
@@ -1,4 +1,4 @@
1
- atomicshop/__init__.py,sha256=Z75FDLaS8vnUFWiQFrirKh_qZ8-SdtlTuquf4ca5CFU,123
1
+ atomicshop/__init__.py,sha256=k2q_v7SGvsY5uOPeIOHoLiqdu-l0poyg0uOWPbdyzmo,123
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
@@ -46,7 +46,7 @@ atomicshop/uuids.py,sha256=JSQdm3ZTJiwPQ1gYe6kU0TKS_7suwVrHc8JZDGYlydM,2214
46
46
  atomicshop/venvs.py,sha256=D9lwOoObkYoRx-weuoAmbvN-RdSHhVm4DE9TVl-utAs,903
47
47
  atomicshop/versioning.py,sha256=e5W6m9AF3__M5nntqI9CqNAeHqkwY9JhlnpYeZ1CEus,970
48
48
  atomicshop/virtualization.py,sha256=LPP4vjE0Vr10R6DA4lqhfX_WaNdDGRAZUW0Am6VeGco,494
49
- atomicshop/web.py,sha256=EVaHNgjfdIyJ4es0g0z7FXie4hic4Dsey_nP9ZuBNOc,12409
49
+ atomicshop/web.py,sha256=gqlDdv7_uYdsbhUdwmrgz_l_S_8_N2fCMdxmfpukHyE,12411
50
50
  atomicshop/websocket_parse.py,sha256=aLHWyKqaYqEn_MRBWm2L6rIl6QPmqbVrjEXE_rBzwCw,16711
51
51
  atomicshop/a_installs/ubuntu/docker_rootless.py,sha256=9IPNtGZYjfy1_n6ZRt7gWz9KZgR6XCgevjqq02xk-o0,281
52
52
  atomicshop/a_installs/ubuntu/docker_sudo.py,sha256=JzayxeyKDtiuT4Icp2L2LyFRbx4wvpyN_bHLfZ-yX5E,281
@@ -136,15 +136,15 @@ atomicshop/mitm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
136
136
  atomicshop/mitm/config_static.py,sha256=6naOZiB5dlZ4YlsgXuWhpmst17Bh3WaZbnrtYmjtOV4,7761
137
137
  atomicshop/mitm/config_toml_editor.py,sha256=2p1CMcktWRR_NW-SmyDwylu63ad5e0-w1QPMa8ZLDBw,1635
138
138
  atomicshop/mitm/connection_thread_worker.py,sha256=tn71RotrQOTo6dyAakuLlY4HrM5ia_0FbNKLCY6Xahg,29304
139
- atomicshop/mitm/import_config.py,sha256=0Ij14aISTllTOiWYJpIUMOWobQqGofD6uafui5uWllE,9272
140
- atomicshop/mitm/initialize_engines.py,sha256=rijND1jxt3Zs8P0jhcQZc0tgcWD4-nq8ARODiWzhurU,8278
139
+ atomicshop/mitm/import_config.py,sha256=9oErVekNdtjf3ppN2c8mUPEvKfeLUkxdAEt7Dbha-SM,9274
140
+ atomicshop/mitm/initialize_engines.py,sha256=e2f7i7d0F6duZQRO2lOOzFBbmfnyIf_E5bqj0rL2IF8,8677
141
141
  atomicshop/mitm/message.py,sha256=CDhhm4BTuZE7oNZCjvIZ4BuPOW4MuIzQLOg91hJaxDI,3065
142
- atomicshop/mitm/mitm_main.py,sha256=YR_pgNQ45kX9sB3gjPWh2_5OrfAj1fIC0TafneZLARI,25197
142
+ atomicshop/mitm/mitm_main.py,sha256=hEiJ0N-bA4LMHe3GYZvYGRy2ea46SY7aUxaCidGsDoY,25837
143
143
  atomicshop/mitm/recs_files.py,sha256=ZAAD0twun-FtmbSniXe3XQhIlawvANNB_HxwbHj7kwI,3151
144
144
  atomicshop/mitm/shared_functions.py,sha256=0lzeyINd44sVEfFbahJxQmz6KAMWbYrW5ou3UYfItvw,1777
145
145
  atomicshop/mitm/statistic_analyzer.py,sha256=5_sAYGX2Xunzo_pS2W5WijNCwr_BlGJbbOO462y_wN4,27533
146
146
  atomicshop/mitm/engines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
147
- atomicshop/mitm/engines/create_module_template.py,sha256=TAzsA4eLD2wYr7auuL4Nf_71iXqn-BOBXlSkNVrnYD4,5336
147
+ atomicshop/mitm/engines/create_module_template.py,sha256=Ho-DYWddRsx392GLglY_LB2sWFmQI5l5xvGEKvMqAK4,5101
148
148
  atomicshop/mitm/engines/create_module_template_example.py,sha256=X5xhvbV6-g9jU_bQVhf_crZmaH50LRWz3bS-faQ18ds,489
149
149
  atomicshop/mitm/engines/__parent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
150
150
  atomicshop/mitm/engines/__parent/parser___parent.py,sha256=HHaCXhScl3OlPjz6eUxsDpJaZyk6BNuDMc9xCkeo2Ws,661
@@ -316,7 +316,7 @@ atomicshop/wrappers/socketw/accepter.py,sha256=hZZKVYlF3LOHQJsSIEKXZUf6QXXWm-Atq
316
316
  atomicshop/wrappers/socketw/base.py,sha256=EcosGkD8VzgBY3GeIHDSG29ThQfXwg3-GQPmBTAqTdw,3048
317
317
  atomicshop/wrappers/socketw/certificator.py,sha256=mtWPJ_ew3OSwt0-1W4jaoco1VIY4NRCrMv3mDUxb_Cc,12418
318
318
  atomicshop/wrappers/socketw/creator.py,sha256=ePGjde04Jgq1gscTfiIam9u7nx3GfszUz1Oi1_5j5b0,13243
319
- atomicshop/wrappers/socketw/dns_server.py,sha256=QEHIQ1onGIOpwZ_nLXvGOgFCM5m-jSwh2HZ2eZC30cE,53337
319
+ atomicshop/wrappers/socketw/dns_server.py,sha256=FjdcZV34usfGWsHPpPc6LnO5q6sB0ugyDbfPrK58wiU,53252
320
320
  atomicshop/wrappers/socketw/exception_wrapper.py,sha256=B-X5SHLSUIWToihH2MKnOB1F4A81_X0DpLLfnYKYbEc,7067
321
321
  atomicshop/wrappers/socketw/get_process.py,sha256=aJC-_qFUv3NgWCSUzDI72E4z8_-VTZE9NVZ0CwUoNlM,5698
322
322
  atomicshop/wrappers/socketw/receiver.py,sha256=9B3MvcDqr4C3x2fsnjG5SQognd1wRqsBgikxZa0wXG8,8243
@@ -330,8 +330,8 @@ atomicshop/wrappers/socketw/statistics_csv.py,sha256=WcNyaqEZ82S5-f3kzqi1nllNT2N
330
330
  atomicshop/wrappers/winregw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
331
331
  atomicshop/wrappers/winregw/winreg_installed_software.py,sha256=Qzmyktvob1qp6Tjk2DjLfAqr_yXV0sgWzdMW_9kwNjY,2345
332
332
  atomicshop/wrappers/winregw/winreg_network.py,sha256=AENV88H1qDidrcpyM9OwEZxX5svfi-Jb4N6FkS1xtqA,8851
333
- atomicshop-2.20.5.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
334
- atomicshop-2.20.5.dist-info/METADATA,sha256=LQKANBfTO98nz4OnyWuo6nP4cOx18fSAt3J5PryHQTg,10630
335
- atomicshop-2.20.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
336
- atomicshop-2.20.5.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
337
- atomicshop-2.20.5.dist-info/RECORD,,
333
+ atomicshop-2.20.7.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
334
+ atomicshop-2.20.7.dist-info/METADATA,sha256=wHZ6J88gGZ_N6L3i19ZY3mwxqeJhyuA4gf0MbrOitvE,10630
335
+ atomicshop-2.20.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
336
+ atomicshop-2.20.7.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
337
+ atomicshop-2.20.7.dist-info/RECORD,,