atomicshop 2.16.3__py3-none-any.whl → 2.16.5__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.16.3'
4
+ __version__ = '2.16.5'
@@ -31,6 +31,7 @@ def thread_worker_main(
31
31
  host=client_message.server_name,
32
32
  tls_type=tls_type,
33
33
  tls_version=tls_version,
34
+ protocol=client_message.protocol,
34
35
  path=client_message.request_raw_decoded.path,
35
36
  status_code=status_code,
36
37
  command=client_message.request_raw_decoded.command,
@@ -145,6 +146,7 @@ def thread_worker_main(
145
146
 
146
147
  # If the request is HTTP protocol.
147
148
  if request_is_http:
149
+ client_message.protocol = 'HTTP'
148
150
  network_logger.info(f"Method: {request_decoded.command}")
149
151
  network_logger.info(f"Path: {request_decoded.path}")
150
152
  # statistics.dict['path'] = request_decoded.path
@@ -33,7 +33,7 @@ def initialize_mitm_server(config_file_path: str):
33
33
  # Main function should return integer with error code, 0 is successful.
34
34
  # Since listening server is infinite, this will not be reached.
35
35
  # After modules import - we check for python version.
36
- check_python_version_compliance(minimum_version='3.11')
36
+ check_python_version_compliance(minimum_version='3.12')
37
37
 
38
38
  # Import the configuration file.
39
39
  result = config_static.load_config(config_file_path)
@@ -267,7 +267,8 @@ def initialize_mitm_server(config_file_path: str):
267
267
  statistics_logs_directory=config_static.Log.logs_path,
268
268
  forwarding_dns_service_ipv4_list___only_for_localhost=(
269
269
  config_static.TCPServer.forwarding_dns_service_ipv4_list___only_for_localhost),
270
- skip_extension_id_list=config_static.SkipExtensions.SKIP_EXTENSION_ID_LIST
270
+ skip_extension_id_list=config_static.SkipExtensions.SKIP_EXTENSION_ID_LIST,
271
+ request_domain_from_dns_server_queue=domain_queue
271
272
  )
272
273
  except socket_wrapper.SocketWrapperPortInUseError as e:
273
274
  print_api(e, error_type=True, color="red", logger=system_logger)
@@ -279,8 +280,6 @@ def initialize_mitm_server(config_file_path: str):
279
280
 
280
281
  socket_wrapper_instance.create_tcp_listening_socket_list()
281
282
 
282
- socket_wrapper_instance.requested_domain_from_dns_server = domain_queue
283
-
284
283
  # Before we start the loop. we can set the default gateway if specified.
285
284
  set_dns_gateway = False
286
285
  dns_gateway_server_list = list()
@@ -20,6 +20,7 @@ class ClientMessage:
20
20
  self.thread_id = None
21
21
  self.info: str = str()
22
22
  self.error: str = str()
23
+ self.protocol: str = str()
23
24
 
24
25
  def reinitialize(self) -> None:
25
26
  """
@@ -58,7 +58,7 @@ class SocketWrapper:
58
58
  ] = None,
59
59
  logger=None,
60
60
  statistics_logs_directory: str = None,
61
- request_domain_queue: queues.NonBlockQueue = None
61
+ request_domain_from_dns_server_queue: queues.NonBlockQueue = None
62
62
  ):
63
63
  """
64
64
  Socket Wrapper class that will be used to create sockets, listen on them, accept connections and send them to
@@ -140,8 +140,8 @@ class SocketWrapper:
140
140
 
141
141
  statistics_writer: statistics_csv.StatisticsCSVWriter object, there is a logger object that
142
142
  will be used to write the statistics file.
143
- :param request_domain_queue: queues.NonBlockQueue object, non-blocking queue that will be used to get
144
- the domain name that was requested from the DNS server (atomicshop.wrappers.socketw.dns_server).
143
+ :param request_domain_from_dns_server_queue: queues.NonBlockQueue object, non-blocking queue that will be used
144
+ to get the domain name that was requested from the DNS server (atomicshop.wrappers.socketw.dns_server).
145
145
  This is used to get the domain name that got to the DNS server and set it to the socket in case SNI
146
146
  was empty (in the SNIHandler class to set the 'server_hostname' for the socket).
147
147
  """
@@ -175,6 +175,7 @@ class SocketWrapper:
175
175
  self.statistics_logs_directory: str = statistics_logs_directory
176
176
  self.forwarding_dns_service_ipv4_list___only_for_localhost = (
177
177
  forwarding_dns_service_ipv4_list___only_for_localhost)
178
+ self.request_domain_from_dns_server_queue = request_domain_from_dns_server_queue
178
179
 
179
180
  self.socket_object = None
180
181
 
@@ -184,7 +185,6 @@ class SocketWrapper:
184
185
 
185
186
  self.sni_received_dict: dict = dict()
186
187
  self.sni_execute_extended: bool = False
187
- self.requested_domain_from_dns_server = None
188
188
  self.certauth_wrapper = None
189
189
 
190
190
  # Defining list of threads, so we can "join()" them in the end all at once.
@@ -343,9 +343,10 @@ class SocketWrapper:
343
343
  # Get the domain queue. Tried using "Queue.Queue" object, but it stomped the SSL Sockets
344
344
  # from accepting connections.
345
345
  domain_from_dns_server = None
346
- if self.requested_domain_from_dns_server.queue:
347
- domain_from_dns_server = self.requested_domain_from_dns_server.queue
348
- self.logger.info(f"Requested domain from DNS Server: {self.requested_domain_from_dns_server.queue}")
346
+ if self.request_domain_from_dns_server_queue.queue:
347
+ domain_from_dns_server = self.request_domain_from_dns_server_queue.queue
348
+ self.logger.info(
349
+ f"Requested domain from DNS Server: {self.request_domain_from_dns_server_queue.queue}")
349
350
 
350
351
  # Wait from any connection on "accept()".
351
352
  # 'client_socket' is socket or ssl socket, 'client_address' is a tuple (ip_address, port).
@@ -7,8 +7,8 @@ from ..loggingw import loggingw
7
7
 
8
8
  LOGGER_NAME: str = 'statistics'
9
9
  STATISTICS_HEADER: str = \
10
- ('request_time_sent,tls,host,path,command,status_code,request_size_bytes,response_size_bytes,file_path,process_cmd,'
11
- 'error')
10
+ ('request_time_sent,tls,protocol,host,path,command,status_code,request_size_bytes,response_size_bytes,file_path,'
11
+ 'process_cmd,error')
12
12
 
13
13
 
14
14
  class StatisticsCSVWriter:
@@ -36,6 +36,7 @@ class StatisticsCSVWriter:
36
36
  host: str,
37
37
  tls_type: str,
38
38
  tls_version: str,
39
+ protocol: str,
39
40
  path: str,
40
41
  status_code: str,
41
42
  command: str,
@@ -57,6 +58,7 @@ class StatisticsCSVWriter:
57
58
  escaped_line_string: str = csvs.escape_csv_line_to_string([
58
59
  request_time_sent,
59
60
  tls_info,
61
+ protocol,
60
62
  host,
61
63
  path,
62
64
  command,
@@ -90,6 +92,7 @@ class StatisticsCSVWriter:
90
92
  host=host,
91
93
  tls_type='',
92
94
  tls_version='',
95
+ protocol='',
93
96
  path='',
94
97
  status_code='',
95
98
  command='',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: atomicshop
3
- Version: 2.16.3
3
+ Version: 2.16.5
4
4
  Summary: Atomic functions and classes to make developer life easier
5
5
  Author: Denis Kras
6
6
  License: MIT License
@@ -29,7 +29,7 @@ Classifier: Intended Audience :: Developers
29
29
  Classifier: License :: OSI Approved :: MIT License
30
30
  Classifier: Programming Language :: Python :: 3
31
31
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
32
- Requires-Python: >=3.11
32
+ Requires-Python: >=3.10
33
33
  Description-Content-Type: text/markdown
34
34
  License-File: LICENSE.txt
35
35
  Requires-Dist: wheel
@@ -1,4 +1,4 @@
1
- atomicshop/__init__.py,sha256=AKEuH8PqWV4-EZXo12aT4GrKcoEcFGoUZbDx7SgXtAY,123
1
+ atomicshop/__init__.py,sha256=brLGdMD_yQxk-vW-768SsqOYGdgi3tFIZn06CAea2jU,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
@@ -123,11 +123,11 @@ atomicshop/file_io/xmls.py,sha256=zh3SuK-dNaFq2NDNhx6ivcf4GYCfGM8M10PcEwDSpxk,21
123
123
  atomicshop/mitm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
124
124
  atomicshop/mitm/config_static.py,sha256=PZp9AAW2ihSUZCen1fhuwFW7Rucd9jA1Pw6pK6Q3DVM,6994
125
125
  atomicshop/mitm/config_toml_editor.py,sha256=2p1CMcktWRR_NW-SmyDwylu63ad5e0-w1QPMa8ZLDBw,1635
126
- atomicshop/mitm/connection_thread_worker.py,sha256=BHSUwSKJfdGigPH1zsFXvjDH1RQV-UkRA7pyx2yn8-Q,18992
126
+ atomicshop/mitm/connection_thread_worker.py,sha256=I5Oq6tSUIXAS6FYlflZzYDtC1rbIYdIKax_R1WsFjso,19093
127
127
  atomicshop/mitm/import_config.py,sha256=fvUESPMkpRvkL7HtMaUqQRPwPF0eHV5V6pwueg4DQkU,7881
128
128
  atomicshop/mitm/initialize_engines.py,sha256=YoSNksMdu4vHjr5xy77t9t5W74zyDZIdjIXrzd3eRXc,8204
129
- atomicshop/mitm/initialize_mitm_server.py,sha256=PMYjt06IysdDpq5utKof4X578EAgCp4TDjiLC7uxDPQ,18382
130
- atomicshop/mitm/message.py,sha256=u2U2f2SOHdBNU-6r1Ik2W14ai2EOwxUV4wVfGZA098k,1732
129
+ atomicshop/mitm/initialize_mitm_server.py,sha256=qP41_hgSa5Wd9WIwIugTqSmWxaL3S3Hh9OCQfcxUwqk,18367
130
+ atomicshop/mitm/message.py,sha256=fHvYEyEx-FAXbIMrKMJ_ybBinezF6IFbPlwCqpRrF44,1768
131
131
  atomicshop/mitm/shared_functions.py,sha256=hplm98tz8pgJ4WHUVI9sf_oVqUM2KJ1Y2pD6EFSb8P0,1879
132
132
  atomicshop/mitm/statistic_analyzer.py,sha256=E0ba1PjsUEcmQUPPw2YH911lyWkbQb9OSAdgB3pihsY,24658
133
133
  atomicshop/mitm/engines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -301,11 +301,11 @@ atomicshop/wrappers/socketw/sender.py,sha256=hHpBLc0LCfOIUErq2mc0ATfp0tDDQ5XhcYT
301
301
  atomicshop/wrappers/socketw/sni.py,sha256=JUlPmM5e_Wzv2QcYxOrW_mwYZlft2JMPin6nSXFW9ug,17169
302
302
  atomicshop/wrappers/socketw/socket_client.py,sha256=FNmTt94YvjZP0X4RPb7icO3xD_nBHQ_XynnObdWFiAU,19682
303
303
  atomicshop/wrappers/socketw/socket_server_tester.py,sha256=SdchUf9qrPk1Rrat0RzvMeN_2NioD7b7a97MkToCYgM,6332
304
- atomicshop/wrappers/socketw/socket_wrapper.py,sha256=655nGQp0HFy-7KNx8zHsA-miXi9ufC7DNeGsvvGALak,28415
304
+ atomicshop/wrappers/socketw/socket_wrapper.py,sha256=g7f_8RkW80EZeQWNTqGYnfrQkgAI56T3SwWybq7ZsXg,28521
305
305
  atomicshop/wrappers/socketw/ssl_base.py,sha256=k4V3gwkbq10MvOH4btU4onLX2GNOsSfUAdcHmL1rpVE,2274
306
- atomicshop/wrappers/socketw/statistics_csv.py,sha256=q5vRA7jL5ERFhIGctn5HjBlOppwSY9qMoEVgo898AIo,2979
307
- atomicshop-2.16.3.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
308
- atomicshop-2.16.3.dist-info/METADATA,sha256=ysLTKs85RLuQJr6JD-u3QVGH4EkdVE4ETVdwMjdCm-M,10502
309
- atomicshop-2.16.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
310
- atomicshop-2.16.3.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
311
- atomicshop-2.16.3.dist-info/RECORD,,
306
+ atomicshop/wrappers/socketw/statistics_csv.py,sha256=Jc0D12crkKRaqoCRQ-2Mz1zm6n4UUx9dXakf-N2TYWA,3065
307
+ atomicshop-2.16.5.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
308
+ atomicshop-2.16.5.dist-info/METADATA,sha256=fo-TPcQE7W_em3KC6uHgkVSXRZMFaqK3PVuWXQTILDI,10502
309
+ atomicshop-2.16.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
310
+ atomicshop-2.16.5.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
311
+ atomicshop-2.16.5.dist-info/RECORD,,