atomicshop 3.3.23__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/githubw.py +1 -1
- atomicshop/wrappers/socketw/socket_wrapper.py +35 -10
- {atomicshop-3.3.23.dist-info → atomicshop-3.3.25.dist-info}/METADATA +2 -2
- {atomicshop-3.3.23.dist-info → atomicshop-3.3.25.dist-info}/RECORD +8 -8
- {atomicshop-3.3.23.dist-info → atomicshop-3.3.25.dist-info}/WHEEL +0 -0
- {atomicshop-3.3.23.dist-info → atomicshop-3.3.25.dist-info}/licenses/LICENSE.txt +0 -0
- {atomicshop-3.3.23.dist-info → atomicshop-3.3.25.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
atomicshop/wrappers/githubw.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import multiprocessing
|
|
2
2
|
import threading
|
|
3
|
+
import time
|
|
4
|
+
|
|
3
5
|
import select
|
|
4
6
|
from typing import Literal, Union, Callable, Any
|
|
5
7
|
from pathlib import Path
|
|
@@ -14,7 +16,7 @@ from ..loggingw import loggingw
|
|
|
14
16
|
from ...script_as_string_processor import ScriptAsStringProcessor
|
|
15
17
|
from ...permissions import permissions
|
|
16
18
|
from ... import filesystem, certificates
|
|
17
|
-
from ...basics import booleans
|
|
19
|
+
from ...basics import booleans, tracebacks
|
|
18
20
|
from ...print_api import print_api
|
|
19
21
|
|
|
20
22
|
from . import base, creator, get_process, accepter, statistics_csv, ssl_base, sni
|
|
@@ -498,6 +500,13 @@ class SocketWrapper:
|
|
|
498
500
|
listening_sockets: list = [listening_socket_object]
|
|
499
501
|
|
|
500
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
|
+
|
|
501
510
|
try:
|
|
502
511
|
# Using "select.select" which is currently the only API function that works on all
|
|
503
512
|
# operating system types: Windows / Linux / BSD.
|
|
@@ -508,7 +517,6 @@ class SocketWrapper:
|
|
|
508
517
|
|
|
509
518
|
listening_ip, listening_port = listening_socket_object.getsockname()
|
|
510
519
|
|
|
511
|
-
domain_from_engine = None
|
|
512
520
|
# Get the domain to connect on this process in case on no SNI provided.
|
|
513
521
|
for domain, ip_port_dict in self.engine.domain_target_dict.items():
|
|
514
522
|
if ip_port_dict['ip'] == listening_ip:
|
|
@@ -534,16 +542,20 @@ class SocketWrapper:
|
|
|
534
542
|
|
|
535
543
|
self.logger.info(f"Requested domain setting: {domain_from_engine}")
|
|
536
544
|
|
|
545
|
+
engine_name = get_engine_name(domain_from_engine, [self.engine])
|
|
546
|
+
|
|
537
547
|
# Wait from any connection on "accept()".
|
|
538
548
|
# 'client_socket' is socket or ssl socket, 'client_address' is a tuple (ip_address, port).
|
|
539
549
|
client_socket, client_address, accept_error_message = accepter.accept_connection_with_error(
|
|
540
550
|
listening_socket_object, domain_from_dns_server=domain_from_engine,
|
|
541
551
|
print_kwargs={'logger': self.logger})
|
|
542
552
|
|
|
553
|
+
source_ip: str = client_address[0]
|
|
554
|
+
dest_port: int = listening_socket_object.getsockname()[1]
|
|
555
|
+
|
|
543
556
|
# This is the earliest stage to ask for process name.
|
|
544
557
|
# SSH Remote / LOCALHOST script execution to identify process section.
|
|
545
558
|
# If 'get_process_name' was set to True, then this will be executed.
|
|
546
|
-
process_name = None
|
|
547
559
|
if self.get_process_name:
|
|
548
560
|
# Get the process name from the socket.
|
|
549
561
|
get_command_instance = get_process.GetCommandLine(
|
|
@@ -554,21 +566,20 @@ class SocketWrapper:
|
|
|
554
566
|
logger=self.logger)
|
|
555
567
|
process_name = get_command_instance.get_process_name(print_kwargs={'logger': self.logger})
|
|
556
568
|
|
|
557
|
-
source_ip: str = client_address[0]
|
|
558
|
-
engine_name: str = get_engine_name(domain_from_engine, [self.engine])
|
|
559
|
-
dest_port: int = listening_socket_object.getsockname()[1]
|
|
560
|
-
|
|
561
569
|
# Not always there will be a hostname resolved by the IP address, so we will leave it empty if it fails.
|
|
562
570
|
try:
|
|
563
|
-
source_hostname
|
|
571
|
+
source_hostname = socket.gethostbyaddr(source_ip)[0]
|
|
564
572
|
except socket.herror:
|
|
565
|
-
|
|
573
|
+
pass
|
|
566
574
|
|
|
567
575
|
# If 'accept()' function worked well, SSL worked well, then 'client_socket' won't be empty.
|
|
568
576
|
if client_socket:
|
|
569
577
|
# Get the protocol type from the socket.
|
|
570
578
|
is_tls: bool = False
|
|
579
|
+
|
|
580
|
+
time.sleep(1) # Wait a second to gather some data.
|
|
571
581
|
tls_properties = ssl_base.is_tls(client_socket)
|
|
582
|
+
|
|
572
583
|
if tls_properties:
|
|
573
584
|
is_tls = True
|
|
574
585
|
tls_type, tls_version = tls_properties
|
|
@@ -681,8 +692,22 @@ class SocketWrapper:
|
|
|
681
692
|
dest_port=str(dest_port),
|
|
682
693
|
host=domain_from_engine,
|
|
683
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)
|
|
684
706
|
except Exception as e:
|
|
685
|
-
|
|
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)
|
|
686
711
|
|
|
687
712
|
|
|
688
713
|
def before_socket_thread_worker(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: atomicshop
|
|
3
|
-
Version: 3.3.
|
|
3
|
+
Version: 3.3.25
|
|
4
4
|
Summary: Atomic functions and classes to make developer life easier
|
|
5
5
|
Author: Denis Kras
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,7 +8,7 @@ Project-URL: Homepage, https://github.com/BugSec-Official/atomicshop
|
|
|
8
8
|
Classifier: Intended Audience :: Developers
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
11
|
-
Requires-Python:
|
|
11
|
+
Requires-Python: <3.13,>=3.10
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE.txt
|
|
14
14
|
Requires-Dist: wheel
|
|
@@ -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
|
|
@@ -187,7 +187,7 @@ atomicshop/wrappers/astw.py,sha256=VkYfkfyc_PJLIOxByT6L7B8uUmKY6-I8XGZl4t_z828,4
|
|
|
187
187
|
atomicshop/wrappers/configparserw.py,sha256=JwDTPjZoSrv44YKwIRcjyUnpN-FjgXVfMqMK_tJuSgU,22800
|
|
188
188
|
atomicshop/wrappers/cryptographyw.py,sha256=QEUpDn8vUvMg3ADz6-4oC2kbDNC_woDlw7C0zU7qFVM,14233
|
|
189
189
|
atomicshop/wrappers/ffmpegw.py,sha256=wcq0ZnAe0yajBOuTKZCCaKI7CDBjkq7FAgdW5IsKcVE,6031
|
|
190
|
-
atomicshop/wrappers/githubw.py,sha256=
|
|
190
|
+
atomicshop/wrappers/githubw.py,sha256=BEEJuWd1eBfiv1FSgb76D4nEBRpFU9j37lztn-KbYa4,27548
|
|
191
191
|
atomicshop/wrappers/netshw.py,sha256=8WE_576XiiHykwFuE-VkCx5CydMpFlztX4frlEteCtI,6350
|
|
192
192
|
atomicshop/wrappers/numpyw.py,sha256=sBV4gSKyr23kXTalqAb1oqttzE_2XxBooCui66jbAqc,1025
|
|
193
193
|
atomicshop/wrappers/olefilew.py,sha256=biD5m58rogifCYmYhJBrAFb9O_Bn_spLek_9HofLeYE,2051
|
|
@@ -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
|