atomicshop 2.20.6__py3-none-any.whl → 2.20.8__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.6'
4
+ __version__ = '2.20.8'
@@ -76,7 +76,9 @@ class CreateModuleTemplate:
76
76
  config_lines_list.append(f'"domains" = [{", ".join(domains_with_quotes)}]\n')
77
77
  # config_lines_list.append(f'\n')
78
78
  config_lines_list.append(f'[mtls]')
79
- 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')
80
82
 
81
83
  config_file_path = self.new_engine_directory + os.sep + CONFIG_FILE_NAME
82
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
 
@@ -26,6 +26,7 @@ class ModuleCategory:
26
26
  self.responder_instance = None
27
27
 
28
28
  self.mtls: dict = dict()
29
+ self.no_sni: dict = dict()
29
30
 
30
31
  def fill_engine_fields_from_general_reference(self, engines_fullpath: str):
31
32
  # Reference module variables.
@@ -46,6 +47,7 @@ class ModuleCategory:
46
47
  # Getting the parameters from engine config file
47
48
  self.domain_list = configuration_data['domains']
48
49
  self.mtls = configuration_data['mtls']
50
+ self.no_sni = configuration_data['no_sni']
49
51
 
50
52
  # If there's module configuration file, but no domains in it, there's no point to continue.
51
53
  # Since, each engine is based on domains.
@@ -328,8 +328,11 @@ def mitm_server(config_file_path: str, script_version: str):
328
328
  # === Initialize TCP Server ====================================================================================
329
329
  if config_static.TCPServer.enable:
330
330
  engines_domains: dict = dict()
331
+ no_sni_domain: str = str()
331
332
  for engine in engines_list:
332
333
  engines_domains[engine.engine_name] = engine.domain_list
334
+ if no_sni_domain == '':
335
+ no_sni_domain = engine.no_sni['domain']
333
336
 
334
337
  try:
335
338
  socket_wrapper_instance = socket_wrapper.SocketWrapper(
@@ -370,7 +373,8 @@ def mitm_server(config_file_path: str, script_version: str):
370
373
  config_static.TCPServer.forwarding_dns_service_ipv4_list___only_for_localhost),
371
374
  skip_extension_id_list=config_static.SkipExtensions.SKIP_EXTENSION_ID_LIST,
372
375
  request_domain_from_dns_server_queue=DOMAIN_QUEUE,
373
- engines_domains=engines_domains
376
+ engines_domains=engines_domains,
377
+ engine_no_sni_domain=no_sni_domain
374
378
  )
375
379
  except socket_wrapper.SocketWrapperPortInUseError as e:
376
380
  print_api.print_api(e, error_type=True, color="red", logger=system_logger)
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)
@@ -69,7 +69,8 @@ class SocketWrapper:
69
69
  exceptions_logger: loggingw.ExceptionCsvLogger = None,
70
70
  statistics_logs_directory: str = None,
71
71
  request_domain_from_dns_server_queue: multiprocessing.Queue = None,
72
- engines_domains: dict = None
72
+ engines_domains: dict = None,
73
+ engine_no_sni_domain: str = None
73
74
  ):
74
75
  """
75
76
  Socket Wrapper class that will be used to create sockets, listen on them, accept connections and send them to
@@ -173,6 +174,8 @@ class SocketWrapper:
173
174
 
174
175
  the 'engine_name' for statistics.csv file will be taken from the key of the dictionary, while correlated
175
176
  by the domain name from the list in the dictionary.
177
+ :param engine_no_sni_domain: string, domain name that will be used if there is no SNI in the request,
178
+ and no domain hit the dns server. This is used to set the 'server_hostname' for the socket.
176
179
  """
177
180
 
178
181
  self.listening_address_list: list[str] = listening_address_list
@@ -209,6 +212,7 @@ class SocketWrapper:
209
212
  forwarding_dns_service_ipv4_list___only_for_localhost)
210
213
  self.request_domain_from_dns_server_queue: multiprocessing.Queue = request_domain_from_dns_server_queue
211
214
  self.engines_domains: dict = engines_domains
215
+ self.engine_no_sni_domain: str = engine_no_sni_domain
212
216
 
213
217
  self.socket_object = None
214
218
 
@@ -460,7 +464,13 @@ class SocketWrapper:
460
464
  # from accepting connections.
461
465
  domain_from_dns_server = None
462
466
  if self.request_domain_from_dns_server_queue is not None:
463
- domain_from_dns_server = self.request_domain_from_dns_server_queue.get()
467
+ # domain_from_dns_server = self.request_domain_from_dns_server_queue.get()
468
+ import queue
469
+ try:
470
+ domain_from_dns_server = self.request_domain_from_dns_server_queue.get_nowait()
471
+ except queue.Empty:
472
+ domain_from_dns_server = self.engine_no_sni_domain
473
+
464
474
  self.logger.info(f"Requested domain from DNS Server: {domain_from_dns_server}")
465
475
 
466
476
  # Wait from any connection on "accept()".
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.20.6
3
+ Version: 2.20.8
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=Ze7AVg_bmEuygfC1cWbcsq1Z8ibD2N91Q7kgO8C7_h4,123
1
+ atomicshop/__init__.py,sha256=J0-CAI8_iH7nq_5Joaip1uk6K4IRagpY7cGLYnqvZgM,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=e2f7i7d0F6duZQRO2lOOzFBbmfnyIf_E5bqj0rL2IF8,8677
139
+ atomicshop/mitm/import_config.py,sha256=9oErVekNdtjf3ppN2c8mUPEvKfeLUkxdAEt7Dbha-SM,9274
140
+ atomicshop/mitm/initialize_engines.py,sha256=OjhURJsczMuSJ1UXGymgnwPTqFSOkqWhdL9-o0BmDQU,8765
141
141
  atomicshop/mitm/message.py,sha256=CDhhm4BTuZE7oNZCjvIZ4BuPOW4MuIzQLOg91hJaxDI,3065
142
- atomicshop/mitm/mitm_main.py,sha256=hEiJ0N-bA4LMHe3GYZvYGRy2ea46SY7aUxaCidGsDoY,25837
142
+ atomicshop/mitm/mitm_main.py,sha256=8fyc6-bimvHFYUsWxTMU4MDndu7izshLtydl-XIqZZ4,26020
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=E518bIwztHshciTSGtJxdVhwjKgZ7fGRpAg23bSEmeE,4985
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
@@ -324,14 +324,14 @@ atomicshop/wrappers/socketw/sender.py,sha256=aX_K8l_rHjd5AWb8bi5mt8-YTkMYVRDB6Dn
324
324
  atomicshop/wrappers/socketw/sni.py,sha256=q-F-R1KtE94g8WGrR3QHgi-otXZJUPBprEwQqnY80_A,17639
325
325
  atomicshop/wrappers/socketw/socket_client.py,sha256=oa3GwS4OPgokrJE5_Oc4-5_wlXHxSH9J5f2DKebms8k,22035
326
326
  atomicshop/wrappers/socketw/socket_server_tester.py,sha256=Qobmh4XV8ZxLUaw-eW4ESKAbeSLecCKn2OWFzMhadk0,6420
327
- atomicshop/wrappers/socketw/socket_wrapper.py,sha256=4apajkc4fR3V01_VvYtMH60Z7-mt19OeF_fyPj2ZKhs,38517
327
+ atomicshop/wrappers/socketw/socket_wrapper.py,sha256=UDm9vX1xerSic4mJ__18dNvllYe5hwBhQuxubFJUcUA,39129
328
328
  atomicshop/wrappers/socketw/ssl_base.py,sha256=kmiif84kMhBr5yjQW17p935sfjR5JKG0LxIwBA4iVvU,2275
329
329
  atomicshop/wrappers/socketw/statistics_csv.py,sha256=WcNyaqEZ82S5-f3kzqi1nllNT2Nd2P_zg8HqCc7vW4s,4120
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.6.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
334
- atomicshop-2.20.6.dist-info/METADATA,sha256=68p1ayX03Wp47tjakHcnGkYLe2OUgnbVh6jwtFe-M2s,10630
335
- atomicshop-2.20.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
336
- atomicshop-2.20.6.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
337
- atomicshop-2.20.6.dist-info/RECORD,,
333
+ atomicshop-2.20.8.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
334
+ atomicshop-2.20.8.dist-info/METADATA,sha256=XoEckd0Io7BxOPEk2_A5n8v8oU27Wx5Hsdl3MOxiOKU,10630
335
+ atomicshop-2.20.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
336
+ atomicshop-2.20.8.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
337
+ atomicshop-2.20.8.dist-info/RECORD,,