atomicshop 3.3.28__py3-none-any.whl → 3.10.0__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/a_mains/get_local_tcp_ports.py +85 -0
- atomicshop/a_mains/install_ca_certificate.py +172 -0
- atomicshop/a_mains/process_from_port.py +119 -0
- atomicshop/a_mains/set_default_dns_gateway.py +90 -0
- atomicshop/basics/strings.py +1 -1
- atomicshop/certificates.py +2 -2
- atomicshop/dns.py +26 -28
- atomicshop/etws/traces/trace_tcp.py +1 -2
- atomicshop/mitm/centered_settings.py +133 -0
- atomicshop/mitm/config_static.py +18 -43
- atomicshop/mitm/connection_thread_worker.py +376 -162
- atomicshop/mitm/engines/__parent/recorder___parent.py +1 -1
- atomicshop/mitm/engines/__parent/requester___parent.py +1 -1
- atomicshop/mitm/engines/__parent/responder___parent.py +15 -2
- atomicshop/mitm/engines/create_module_template.py +1 -2
- atomicshop/mitm/import_config.py +79 -88
- atomicshop/mitm/initialize_engines.py +1 -2
- atomicshop/mitm/message.py +5 -4
- atomicshop/mitm/mitm_main.py +222 -121
- atomicshop/mitm/recs_files.py +61 -5
- atomicshop/mitm/ssh_tester.py +82 -0
- atomicshop/networks.py +108 -93
- atomicshop/package_mains_processor.py +84 -0
- atomicshop/permissions/ubuntu_permissions.py +47 -0
- atomicshop/print_api.py +3 -5
- atomicshop/python_functions.py +23 -108
- atomicshop/speech_recognize.py +8 -0
- atomicshop/ssh_remote.py +115 -51
- atomicshop/web.py +20 -7
- atomicshop/web_apis/google_llm.py +22 -14
- atomicshop/wrappers/ctyping/msi_windows_installer/cabs.py +2 -1
- atomicshop/wrappers/ctyping/msi_windows_installer/extract_msi_main.py +2 -1
- atomicshop/wrappers/dockerw/dockerw.py +2 -2
- atomicshop/wrappers/factw/install/pre_install_and_install_before_restart.py +5 -5
- atomicshop/wrappers/githubw.py +175 -63
- atomicshop/wrappers/loggingw/handlers.py +1 -1
- atomicshop/wrappers/loggingw/loggingw.py +17 -1
- atomicshop/wrappers/netshw.py +124 -3
- atomicshop/wrappers/playwrightw/scenarios.py +1 -1
- atomicshop/wrappers/powershell_networking.py +80 -0
- atomicshop/wrappers/psutilw/psutil_networks.py +9 -0
- atomicshop/wrappers/pywin32w/win_event_log/fetch.py +174 -0
- atomicshop/wrappers/pywin32w/win_event_log/subscribes/process_create.py +3 -105
- atomicshop/wrappers/pywin32w/win_event_log/subscribes/process_terminate.py +3 -57
- atomicshop/wrappers/pywin32w/wmis/win32_networkadapterconfiguration.py +12 -27
- atomicshop/wrappers/pywin32w/wmis/win32networkadapter.py +15 -9
- atomicshop/wrappers/socketw/certificator.py +19 -9
- atomicshop/wrappers/socketw/creator.py +30 -7
- atomicshop/wrappers/socketw/dns_server.py +6 -6
- atomicshop/wrappers/socketw/exception_wrapper.py +3 -3
- atomicshop/wrappers/socketw/process_getter.py +86 -0
- atomicshop/wrappers/socketw/receiver.py +29 -9
- atomicshop/wrappers/socketw/sender.py +10 -9
- atomicshop/wrappers/socketw/sni.py +23 -6
- atomicshop/wrappers/socketw/{base.py → socket_base.py} +33 -1
- atomicshop/wrappers/socketw/socket_client.py +6 -8
- atomicshop/wrappers/socketw/socket_wrapper.py +82 -21
- atomicshop/wrappers/socketw/ssl_base.py +6 -2
- atomicshop/wrappers/win_auditw.py +189 -0
- {atomicshop-3.3.28.dist-info → atomicshop-3.10.0.dist-info}/METADATA +25 -30
- {atomicshop-3.3.28.dist-info → atomicshop-3.10.0.dist-info}/RECORD +74 -88
- atomicshop/_basics_temp.py +0 -101
- atomicshop/a_installs/ubuntu/docker_rootless.py +0 -11
- atomicshop/a_installs/ubuntu/docker_sudo.py +0 -11
- atomicshop/addons/a_setup_scripts/install_psycopg2_ubuntu.sh +0 -3
- atomicshop/addons/package_setup/CreateWheel.cmd +0 -7
- atomicshop/addons/package_setup/Setup in Edit mode.cmd +0 -6
- atomicshop/addons/package_setup/Setup.cmd +0 -7
- atomicshop/archiver/__init__.py +0 -0
- atomicshop/archiver/_search_in_zip.py +0 -189
- atomicshop/archiver/search_in_archive.py +0 -284
- atomicshop/archiver/sevenz_app_w.py +0 -86
- atomicshop/archiver/sevenzs.py +0 -73
- atomicshop/archiver/shutils.py +0 -34
- atomicshop/archiver/zips.py +0 -353
- atomicshop/file_types.py +0 -24
- atomicshop/pbtkmultifile_argparse.py +0 -88
- atomicshop/script_as_string_processor.py +0 -42
- atomicshop/ssh_scripts/process_from_ipv4.py +0 -37
- atomicshop/ssh_scripts/process_from_port.py +0 -27
- atomicshop/wrappers/_process_wrapper_curl.py +0 -27
- atomicshop/wrappers/_process_wrapper_tar.py +0 -21
- atomicshop/wrappers/dockerw/install_docker.py +0 -449
- atomicshop/wrappers/ffmpegw.py +0 -125
- atomicshop/wrappers/process_wrapper_pbtk.py +0 -16
- atomicshop/wrappers/socketw/get_process.py +0 -123
- /atomicshop/{addons → a_mains/addons}/PlayWrightCodegen.cmd +0 -0
- /atomicshop/{addons → a_mains/addons}/ScriptExecution.cmd +0 -0
- /atomicshop/{addons → a_mains/addons}/inits/init_to_import_all_modules.py +0 -0
- /atomicshop/{addons → a_mains/addons}/process_list/ReadMe.txt +0 -0
- /atomicshop/{addons → a_mains/addons}/process_list/compile.cmd +0 -0
- /atomicshop/{addons → a_mains/addons}/process_list/compiled/Win10x64/process_list.dll +0 -0
- /atomicshop/{addons → a_mains/addons}/process_list/compiled/Win10x64/process_list.exp +0 -0
- /atomicshop/{addons → a_mains/addons}/process_list/compiled/Win10x64/process_list.lib +0 -0
- /atomicshop/{addons → a_mains/addons}/process_list/process_list.cpp +0 -0
- {atomicshop-3.3.28.dist-info → atomicshop-3.10.0.dist-info}/WHEEL +0 -0
- {atomicshop-3.3.28.dist-info → atomicshop-3.10.0.dist-info}/licenses/LICENSE.txt +0 -0
- {atomicshop-3.3.28.dist-info → atomicshop-3.10.0.dist-info}/top_level.txt +0 -0
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
# Needed to redirect output from console to logger on LOCALHOST process command line harvesting.
|
|
2
|
-
import io
|
|
3
|
-
from contextlib import redirect_stdout
|
|
4
|
-
import logging
|
|
5
|
-
|
|
6
|
-
from . import base
|
|
7
|
-
from ...ssh_remote import SSHRemote
|
|
8
|
-
from ...print_api import print_api
|
|
9
|
-
|
|
10
|
-
import psutil
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class GetCommandLine:
|
|
14
|
-
def __init__(
|
|
15
|
-
self,
|
|
16
|
-
client_socket=None,
|
|
17
|
-
ssh_script_processor=None,
|
|
18
|
-
ssh_user: str = None,
|
|
19
|
-
ssh_pass: str = None,
|
|
20
|
-
logger: logging.Logger = None
|
|
21
|
-
):
|
|
22
|
-
self.client_socket = client_socket
|
|
23
|
-
self.ssh_script_processor = ssh_script_processor
|
|
24
|
-
self.ssh_user: str = ssh_user
|
|
25
|
-
self.ssh_pass: str = ssh_pass
|
|
26
|
-
self.logger: logging.Logger = logger
|
|
27
|
-
|
|
28
|
-
def get_process_name(self, print_kwargs: dict = None):
|
|
29
|
-
# Get client ip and the source port.
|
|
30
|
-
client_ip, source_port = base.get_source_address_from_socket(self.client_socket)
|
|
31
|
-
|
|
32
|
-
# Put source port variable inside the string script.
|
|
33
|
-
updated_script_string = self.ssh_script_processor.put_variable_into_script_string(
|
|
34
|
-
source_port, print_kwargs=print_kwargs)
|
|
35
|
-
|
|
36
|
-
process_name = self.get_process_commandline(
|
|
37
|
-
client_ip=client_ip,
|
|
38
|
-
script_string=updated_script_string,
|
|
39
|
-
print_kwargs=print_kwargs)
|
|
40
|
-
|
|
41
|
-
return process_name
|
|
42
|
-
|
|
43
|
-
def get_process_commandline(
|
|
44
|
-
self,
|
|
45
|
-
client_ip: str,
|
|
46
|
-
script_string: str,
|
|
47
|
-
print_kwargs: dict = None
|
|
48
|
-
):
|
|
49
|
-
execution_output = None
|
|
50
|
-
execution_error = None
|
|
51
|
-
|
|
52
|
-
# Checking if we're on localhost. If not, we'll execute SSH connection to get calling process name.
|
|
53
|
-
if client_ip not in base.THIS_DEVICE_IP_LIST:
|
|
54
|
-
# Tried using paramiko SSH concurrently within threads, but with bigger loads it just breaks.
|
|
55
|
-
# So, better using it separately for each thread.
|
|
56
|
-
|
|
57
|
-
print_api(f"Initializing SSH connection to [{client_ip}]", **print_kwargs)
|
|
58
|
-
# Initializing SSHRemote class.
|
|
59
|
-
current_ssh_client = SSHRemote(
|
|
60
|
-
ip_address=client_ip, username=self.ssh_user, password=self.ssh_pass, logger=self.logger)
|
|
61
|
-
|
|
62
|
-
execution_output, execution_error = current_ssh_client.connect_get_client_commandline(script_string)
|
|
63
|
-
# Else, if we're on localhost, then execute the script directly without SSH.
|
|
64
|
-
else:
|
|
65
|
-
print_api(f"Executing LOCALHOST command to get the calling process.", **print_kwargs)
|
|
66
|
-
# Getting the redirection from console print, since that what the 'script_string' does.
|
|
67
|
-
with io.StringIO() as buffer, redirect_stdout(buffer):
|
|
68
|
-
# Executing the script with print to console.
|
|
69
|
-
try:
|
|
70
|
-
exec(script_string)
|
|
71
|
-
except ModuleNotFoundError as function_exception_object:
|
|
72
|
-
execution_error = f"Module not installed: {function_exception_object}"
|
|
73
|
-
print_api(
|
|
74
|
-
execution_error, error_type=True, logger_method="error", traceback_string=True,
|
|
75
|
-
**print_kwargs)
|
|
76
|
-
except psutil.AccessDenied:
|
|
77
|
-
execution_error = f"Access Denied for 'psutil' to read system process command line. " \
|
|
78
|
-
f"Run script with Admin Rights."
|
|
79
|
-
print_api(
|
|
80
|
-
execution_error, error_type=True, logger_method="error", traceback_string=True,
|
|
81
|
-
**print_kwargs)
|
|
82
|
-
|
|
83
|
-
if not execution_error:
|
|
84
|
-
# Reading the buffer.
|
|
85
|
-
execution_output = buffer.getvalue()
|
|
86
|
-
|
|
87
|
-
# This section is generic for both remote SSH and localhost executions of the script.
|
|
88
|
-
process_name = self.get_commandline_and_error(execution_output, execution_error, print_kwargs=print_kwargs)
|
|
89
|
-
|
|
90
|
-
return process_name
|
|
91
|
-
|
|
92
|
-
@staticmethod
|
|
93
|
-
def get_commandline_and_error(
|
|
94
|
-
execution_output,
|
|
95
|
-
execution_error,
|
|
96
|
-
print_kwargs: dict = None
|
|
97
|
-
):
|
|
98
|
-
# If there was known error on localhost / known error on remote or any kind of error on remote, it was
|
|
99
|
-
# already logged, so we'll just put the error into 'process_name'.
|
|
100
|
-
if execution_error:
|
|
101
|
-
process_name = execution_error
|
|
102
|
-
print_api(
|
|
103
|
-
f"Error During Command Execution: {process_name}", error_type=True,
|
|
104
|
-
logger_method='error', **(print_kwargs or {}))
|
|
105
|
-
# If there wasn't any error of above types, then we can put the output from either local or remote script
|
|
106
|
-
# execution into 'process_name' and log it / output to console.
|
|
107
|
-
else:
|
|
108
|
-
# If the output that was returned is not empty.
|
|
109
|
-
if execution_output:
|
|
110
|
-
# Replacing '\r\n' escape lines with string, so that the line will not be escaped in logs.
|
|
111
|
-
if '\r\n' in execution_output:
|
|
112
|
-
execution_output = execution_output.replace('\r\n', '')
|
|
113
|
-
elif '\n' in execution_output:
|
|
114
|
-
execution_output = execution_output.replace('\n', '')
|
|
115
|
-
|
|
116
|
-
process_name = execution_output
|
|
117
|
-
print_api(f"Client Process Command Line: {process_name}", **(print_kwargs or {}))
|
|
118
|
-
# Else if the script output came back empty.
|
|
119
|
-
else:
|
|
120
|
-
process_name = "Client Process Command Line came back empty after script execution."
|
|
121
|
-
print_api(process_name, error_type=True, logger_method='error', **(print_kwargs or {}))
|
|
122
|
-
|
|
123
|
-
return process_name
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|