atomicshop 3.3.24__py3-none-any.whl → 3.3.25__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/wrappers/socketw/socket_wrapper.py +31 -24
- {atomicshop-3.3.24.dist-info → atomicshop-3.3.25.dist-info}/METADATA +1 -1
- {atomicshop-3.3.24.dist-info → atomicshop-3.3.25.dist-info}/RECORD +7 -7
- {atomicshop-3.3.24.dist-info → atomicshop-3.3.25.dist-info}/WHEEL +0 -0
- {atomicshop-3.3.24.dist-info → atomicshop-3.3.25.dist-info}/licenses/LICENSE.txt +0 -0
- {atomicshop-3.3.24.dist-info → atomicshop-3.3.25.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
|
@@ -16,7 +16,7 @@ from ..loggingw import loggingw
|
|
|
16
16
|
from ...script_as_string_processor import ScriptAsStringProcessor
|
|
17
17
|
from ...permissions import permissions
|
|
18
18
|
from ... import filesystem, certificates
|
|
19
|
-
from ...basics import booleans
|
|
19
|
+
from ...basics import booleans, tracebacks
|
|
20
20
|
from ...print_api import print_api
|
|
21
21
|
|
|
22
22
|
from . import base, creator, get_process, accepter, statistics_csv, ssl_base, sni
|
|
@@ -500,6 +500,13 @@ class SocketWrapper:
|
|
|
500
500
|
listening_sockets: list = [listening_socket_object]
|
|
501
501
|
|
|
502
502
|
while True:
|
|
503
|
+
engine_name: str = ''
|
|
504
|
+
source_ip: str = ''
|
|
505
|
+
source_hostname: str = ''
|
|
506
|
+
dest_port: int = 0
|
|
507
|
+
process_name: str = ''
|
|
508
|
+
domain_from_engine: str = ''
|
|
509
|
+
|
|
503
510
|
try:
|
|
504
511
|
# Using "select.select" which is currently the only API function that works on all
|
|
505
512
|
# operating system types: Windows / Linux / BSD.
|
|
@@ -510,7 +517,6 @@ class SocketWrapper:
|
|
|
510
517
|
|
|
511
518
|
listening_ip, listening_port = listening_socket_object.getsockname()
|
|
512
519
|
|
|
513
|
-
domain_from_engine = None
|
|
514
520
|
# Get the domain to connect on this process in case on no SNI provided.
|
|
515
521
|
for domain, ip_port_dict in self.engine.domain_target_dict.items():
|
|
516
522
|
if ip_port_dict['ip'] == listening_ip:
|
|
@@ -536,16 +542,20 @@ class SocketWrapper:
|
|
|
536
542
|
|
|
537
543
|
self.logger.info(f"Requested domain setting: {domain_from_engine}")
|
|
538
544
|
|
|
545
|
+
engine_name = get_engine_name(domain_from_engine, [self.engine])
|
|
546
|
+
|
|
539
547
|
# Wait from any connection on "accept()".
|
|
540
548
|
# 'client_socket' is socket or ssl socket, 'client_address' is a tuple (ip_address, port).
|
|
541
549
|
client_socket, client_address, accept_error_message = accepter.accept_connection_with_error(
|
|
542
550
|
listening_socket_object, domain_from_dns_server=domain_from_engine,
|
|
543
551
|
print_kwargs={'logger': self.logger})
|
|
544
552
|
|
|
553
|
+
source_ip: str = client_address[0]
|
|
554
|
+
dest_port: int = listening_socket_object.getsockname()[1]
|
|
555
|
+
|
|
545
556
|
# This is the earliest stage to ask for process name.
|
|
546
557
|
# SSH Remote / LOCALHOST script execution to identify process section.
|
|
547
558
|
# If 'get_process_name' was set to True, then this will be executed.
|
|
548
|
-
process_name = None
|
|
549
559
|
if self.get_process_name:
|
|
550
560
|
# Get the process name from the socket.
|
|
551
561
|
get_command_instance = get_process.GetCommandLine(
|
|
@@ -556,15 +566,11 @@ class SocketWrapper:
|
|
|
556
566
|
logger=self.logger)
|
|
557
567
|
process_name = get_command_instance.get_process_name(print_kwargs={'logger': self.logger})
|
|
558
568
|
|
|
559
|
-
source_ip: str = client_address[0]
|
|
560
|
-
engine_name: str = get_engine_name(domain_from_engine, [self.engine])
|
|
561
|
-
dest_port: int = listening_socket_object.getsockname()[1]
|
|
562
|
-
|
|
563
569
|
# Not always there will be a hostname resolved by the IP address, so we will leave it empty if it fails.
|
|
564
570
|
try:
|
|
565
|
-
source_hostname
|
|
571
|
+
source_hostname = socket.gethostbyaddr(source_ip)[0]
|
|
566
572
|
except socket.herror:
|
|
567
|
-
|
|
573
|
+
pass
|
|
568
574
|
|
|
569
575
|
# If 'accept()' function worked well, SSL worked well, then 'client_socket' won't be empty.
|
|
570
576
|
if client_socket:
|
|
@@ -572,19 +578,7 @@ class SocketWrapper:
|
|
|
572
578
|
is_tls: bool = False
|
|
573
579
|
|
|
574
580
|
time.sleep(1) # Wait a second to gather some data.
|
|
575
|
-
|
|
576
|
-
tls_properties = ssl_base.is_tls(client_socket)
|
|
577
|
-
except ConnectionResetError as e:
|
|
578
|
-
self.statistics_writer.write_accept_error(
|
|
579
|
-
engine=engine_name,
|
|
580
|
-
source_host=source_hostname,
|
|
581
|
-
source_ip=source_ip,
|
|
582
|
-
error_message=str(e),
|
|
583
|
-
dest_port=str(dest_port),
|
|
584
|
-
host=domain_from_engine,
|
|
585
|
-
process_name=process_name)
|
|
586
|
-
|
|
587
|
-
continue
|
|
581
|
+
tls_properties = ssl_base.is_tls(client_socket)
|
|
588
582
|
|
|
589
583
|
if tls_properties:
|
|
590
584
|
is_tls = True
|
|
@@ -698,9 +692,22 @@ class SocketWrapper:
|
|
|
698
692
|
dest_port=str(dest_port),
|
|
699
693
|
host=domain_from_engine,
|
|
700
694
|
process_name=process_name)
|
|
695
|
+
except ConnectionResetError as e:
|
|
696
|
+
exception_string: str = tracebacks.get_as_string()
|
|
697
|
+
full_string: str = f"{str(e)} | {exception_string}"
|
|
698
|
+
self.statistics_writer.write_accept_error(
|
|
699
|
+
engine=engine_name,
|
|
700
|
+
source_host=source_hostname,
|
|
701
|
+
source_ip=source_ip,
|
|
702
|
+
error_message=full_string,
|
|
703
|
+
dest_port=str(dest_port),
|
|
704
|
+
host=domain_from_engine,
|
|
705
|
+
process_name=process_name)
|
|
701
706
|
except Exception as e:
|
|
702
|
-
|
|
703
|
-
|
|
707
|
+
_ = e
|
|
708
|
+
exception_string: str = tracebacks.get_as_string()
|
|
709
|
+
full_string: str = f"Engine: {engine_name} | {exception_string}"
|
|
710
|
+
self.exceptions_logger.write(full_string)
|
|
704
711
|
|
|
705
712
|
|
|
706
713
|
def before_socket_thread_worker(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=peqNB9IL7p86gZd32BF4w1uBeAZvZo0dOfoMRX3xB5U,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
|
|
@@ -308,14 +308,14 @@ atomicshop/wrappers/socketw/sender.py,sha256=aX_K8l_rHjd5AWb8bi5mt8-YTkMYVRDB6Dn
|
|
|
308
308
|
atomicshop/wrappers/socketw/sni.py,sha256=uj6KKYKmSrzXcKBhVLaHQhYn1wNfIUpdnmcvn21V9iE,18176
|
|
309
309
|
atomicshop/wrappers/socketw/socket_client.py,sha256=WWIiCxUX9irN9aWzJ6-1xrXNB_iv_diq3ha1yrWsNGU,22671
|
|
310
310
|
atomicshop/wrappers/socketw/socket_server_tester.py,sha256=Qobmh4XV8ZxLUaw-eW4ESKAbeSLecCKn2OWFzMhadk0,6420
|
|
311
|
-
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=
|
|
311
|
+
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=bSFRfmzlfOsqb0jBLGsdCxDkZl6L0Si5QJZkShjOxEM,42589
|
|
312
312
|
atomicshop/wrappers/socketw/ssl_base.py,sha256=62-hPm7zla1rh3m_WvDnXqKH-sDUTdiRptD8STCkgdk,2313
|
|
313
313
|
atomicshop/wrappers/socketw/statistics_csv.py,sha256=_gA8bMX6Sw_UCXKi2y9wNAwlqifgExgDGfQIa9pFxQA,5543
|
|
314
314
|
atomicshop/wrappers/winregw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
315
315
|
atomicshop/wrappers/winregw/winreg_installed_software.py,sha256=Qzmyktvob1qp6Tjk2DjLfAqr_yXV0sgWzdMW_9kwNjY,2345
|
|
316
316
|
atomicshop/wrappers/winregw/winreg_network.py,sha256=ih0BVNwByLvf9F_Lac4EdmDYYJA3PzMvmG0PieDZrsE,9905
|
|
317
|
-
atomicshop-3.3.
|
|
318
|
-
atomicshop-3.3.
|
|
319
|
-
atomicshop-3.3.
|
|
320
|
-
atomicshop-3.3.
|
|
321
|
-
atomicshop-3.3.
|
|
317
|
+
atomicshop-3.3.25.dist-info/licenses/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
318
|
+
atomicshop-3.3.25.dist-info/METADATA,sha256=VAymfm9H0qFDtFWy28IxXTtb6CGaePBQVC4QkN7nGv8,9318
|
|
319
|
+
atomicshop-3.3.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
320
|
+
atomicshop-3.3.25.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
321
|
+
atomicshop-3.3.25.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|