atomicshop 2.15.11__py3-none-any.whl → 3.10.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.
- atomicshop/__init__.py +1 -1
- atomicshop/{addons/mains → a_mains}/FACT/update_extract.py +3 -2
- atomicshop/a_mains/dns_gateway_setting.py +11 -0
- atomicshop/a_mains/get_local_tcp_ports.py +85 -0
- atomicshop/a_mains/github_wrapper.py +11 -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/a_mains/update_config_toml.py +38 -0
- atomicshop/basics/ansi_escape_codes.py +3 -1
- atomicshop/basics/argparse_template.py +2 -0
- atomicshop/basics/booleans.py +27 -30
- atomicshop/basics/bytes_arrays.py +43 -0
- atomicshop/basics/classes.py +149 -1
- atomicshop/basics/enums.py +2 -2
- atomicshop/basics/exceptions.py +5 -1
- atomicshop/basics/list_of_classes.py +29 -0
- atomicshop/basics/multiprocesses.py +374 -50
- atomicshop/basics/strings.py +72 -3
- atomicshop/basics/threads.py +14 -0
- atomicshop/basics/tracebacks.py +13 -3
- atomicshop/certificates.py +153 -52
- atomicshop/config_init.py +11 -6
- atomicshop/console_user_response.py +7 -14
- atomicshop/consoles.py +9 -0
- atomicshop/datetimes.py +1 -1
- atomicshop/diff_check.py +3 -3
- atomicshop/dns.py +128 -3
- atomicshop/etws/_pywintrace_fix.py +17 -0
- atomicshop/etws/trace.py +40 -42
- atomicshop/etws/traces/trace_dns.py +56 -44
- atomicshop/etws/traces/trace_tcp.py +130 -0
- atomicshop/file_io/csvs.py +27 -5
- atomicshop/file_io/docxs.py +34 -17
- atomicshop/file_io/file_io.py +31 -17
- atomicshop/file_io/jsons.py +49 -0
- atomicshop/file_io/tomls.py +139 -0
- atomicshop/filesystem.py +616 -291
- atomicshop/get_process_list.py +3 -3
- atomicshop/http_parse.py +149 -93
- atomicshop/ip_addresses.py +6 -1
- atomicshop/mitm/centered_settings.py +132 -0
- atomicshop/mitm/config_static.py +207 -0
- atomicshop/mitm/config_toml_editor.py +55 -0
- atomicshop/mitm/connection_thread_worker.py +875 -357
- atomicshop/mitm/engines/__parent/parser___parent.py +4 -17
- atomicshop/mitm/engines/__parent/recorder___parent.py +108 -51
- atomicshop/mitm/engines/__parent/requester___parent.py +116 -0
- atomicshop/mitm/engines/__parent/responder___parent.py +75 -114
- atomicshop/mitm/engines/__reference_general/parser___reference_general.py +10 -7
- atomicshop/mitm/engines/__reference_general/recorder___reference_general.py +5 -5
- atomicshop/mitm/engines/__reference_general/requester___reference_general.py +47 -0
- atomicshop/mitm/engines/__reference_general/responder___reference_general.py +95 -13
- atomicshop/mitm/engines/create_module_template.py +58 -14
- atomicshop/mitm/import_config.py +359 -139
- atomicshop/mitm/initialize_engines.py +160 -80
- atomicshop/mitm/message.py +64 -23
- atomicshop/mitm/mitm_main.py +892 -0
- atomicshop/mitm/recs_files.py +183 -0
- atomicshop/mitm/shared_functions.py +4 -10
- atomicshop/mitm/ssh_tester.py +82 -0
- atomicshop/mitm/statistic_analyzer.py +136 -40
- atomicshop/mitm/statistic_analyzer_helper/moving_average_helper.py +265 -83
- atomicshop/monitor/checks/dns.py +1 -1
- atomicshop/networks.py +671 -0
- atomicshop/on_exit.py +39 -9
- atomicshop/package_mains_processor.py +84 -0
- atomicshop/permissions/permissions.py +22 -0
- atomicshop/permissions/ubuntu_permissions.py +239 -0
- atomicshop/permissions/win_permissions.py +33 -0
- atomicshop/print_api.py +24 -42
- atomicshop/process.py +24 -6
- atomicshop/process_poller/process_pool.py +0 -1
- atomicshop/process_poller/simple_process_pool.py +204 -5
- atomicshop/python_file_patcher.py +1 -1
- atomicshop/python_functions.py +27 -75
- atomicshop/speech_recognize.py +8 -0
- atomicshop/ssh_remote.py +158 -172
- atomicshop/system_resource_monitor.py +61 -47
- atomicshop/system_resources.py +8 -8
- atomicshop/tempfiles.py +1 -2
- atomicshop/urls.py +6 -0
- atomicshop/venvs.py +28 -0
- atomicshop/versioning.py +27 -0
- atomicshop/web.py +98 -27
- atomicshop/web_apis/google_custom_search.py +44 -0
- atomicshop/web_apis/google_llm.py +188 -0
- atomicshop/websocket_parse.py +450 -0
- atomicshop/wrappers/certauthw/certauth.py +1 -0
- atomicshop/wrappers/cryptographyw.py +29 -8
- atomicshop/wrappers/ctyping/etw_winapi/const.py +97 -47
- atomicshop/wrappers/ctyping/etw_winapi/etw_functions.py +178 -49
- atomicshop/wrappers/ctyping/file_details_winapi.py +67 -0
- atomicshop/wrappers/ctyping/msi_windows_installer/cabs.py +2 -1
- atomicshop/wrappers/ctyping/msi_windows_installer/extract_msi_main.py +2 -2
- atomicshop/wrappers/ctyping/setup_device.py +466 -0
- atomicshop/wrappers/ctyping/win_console.py +39 -0
- atomicshop/wrappers/dockerw/dockerw.py +113 -2
- atomicshop/wrappers/elasticsearchw/config_basic.py +0 -12
- atomicshop/wrappers/elasticsearchw/elastic_infra.py +75 -0
- atomicshop/wrappers/elasticsearchw/elasticsearchw.py +2 -20
- atomicshop/wrappers/factw/get_file_data.py +12 -5
- atomicshop/wrappers/factw/install/install_after_restart.py +89 -5
- atomicshop/wrappers/factw/install/pre_install_and_install_before_restart.py +20 -14
- atomicshop/wrappers/githubw.py +537 -54
- atomicshop/wrappers/loggingw/consts.py +1 -1
- atomicshop/wrappers/loggingw/filters.py +23 -0
- atomicshop/wrappers/loggingw/formatters.py +12 -0
- atomicshop/wrappers/loggingw/handlers.py +214 -107
- atomicshop/wrappers/loggingw/loggers.py +19 -0
- atomicshop/wrappers/loggingw/loggingw.py +860 -22
- atomicshop/wrappers/loggingw/reading.py +134 -112
- atomicshop/wrappers/mongodbw/mongo_infra.py +31 -0
- atomicshop/wrappers/mongodbw/mongodbw.py +1324 -36
- atomicshop/wrappers/netshw.py +271 -0
- atomicshop/wrappers/playwrightw/engine.py +34 -19
- atomicshop/wrappers/playwrightw/infra.py +5 -0
- atomicshop/wrappers/playwrightw/javascript.py +7 -3
- atomicshop/wrappers/playwrightw/keyboard.py +14 -0
- atomicshop/wrappers/playwrightw/scenarios.py +172 -5
- atomicshop/wrappers/playwrightw/waits.py +9 -7
- atomicshop/wrappers/powershell_networking.py +80 -0
- atomicshop/wrappers/psutilw/processes.py +37 -1
- atomicshop/wrappers/psutilw/psutil_networks.py +85 -0
- atomicshop/wrappers/pyopensslw.py +9 -2
- atomicshop/wrappers/pywin32w/cert_store.py +116 -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/msft_netipaddress.py +113 -0
- atomicshop/wrappers/pywin32w/wmis/win32_networkadapterconfiguration.py +259 -0
- atomicshop/wrappers/pywin32w/wmis/win32networkadapter.py +112 -0
- atomicshop/wrappers/pywin32w/wmis/wmi_helpers.py +236 -0
- atomicshop/wrappers/socketw/accepter.py +21 -7
- atomicshop/wrappers/socketw/certificator.py +216 -150
- atomicshop/wrappers/socketw/creator.py +190 -50
- atomicshop/wrappers/socketw/dns_server.py +491 -182
- atomicshop/wrappers/socketw/exception_wrapper.py +45 -52
- atomicshop/wrappers/socketw/process_getter.py +86 -0
- atomicshop/wrappers/socketw/receiver.py +144 -102
- atomicshop/wrappers/socketw/sender.py +65 -35
- atomicshop/wrappers/socketw/sni.py +334 -165
- atomicshop/wrappers/socketw/socket_base.py +134 -0
- atomicshop/wrappers/socketw/socket_client.py +137 -95
- atomicshop/wrappers/socketw/socket_server_tester.py +11 -7
- atomicshop/wrappers/socketw/socket_wrapper.py +717 -116
- atomicshop/wrappers/socketw/ssl_base.py +15 -14
- atomicshop/wrappers/socketw/statistics_csv.py +148 -17
- atomicshop/wrappers/sysmonw.py +1 -1
- atomicshop/wrappers/ubuntu_terminal.py +65 -26
- atomicshop/wrappers/win_auditw.py +189 -0
- atomicshop/wrappers/winregw/__init__.py +0 -0
- atomicshop/wrappers/winregw/winreg_installed_software.py +58 -0
- atomicshop/wrappers/winregw/winreg_network.py +232 -0
- {atomicshop-2.15.11.dist-info → atomicshop-3.10.5.dist-info}/METADATA +31 -51
- atomicshop-3.10.5.dist-info/RECORD +306 -0
- {atomicshop-2.15.11.dist-info → atomicshop-3.10.5.dist-info}/WHEEL +1 -1
- atomicshop/_basics_temp.py +0 -101
- atomicshop/a_installs/win/fibratus.py +0 -9
- atomicshop/a_installs/win/mongodb.py +0 -9
- atomicshop/a_installs/win/pycharm.py +0 -9
- atomicshop/addons/a_setup_scripts/install_psycopg2_ubuntu.sh +0 -3
- atomicshop/addons/a_setup_scripts/install_pywintrace_0.3.cmd +0 -2
- atomicshop/addons/mains/__pycache__/install_fibratus_windows.cpython-312.pyc +0 -0
- atomicshop/addons/mains/__pycache__/msi_unpacker.cpython-312.pyc +0 -0
- atomicshop/addons/mains/install_docker_rootless_ubuntu.py +0 -11
- atomicshop/addons/mains/install_docker_ubuntu_main_sudo.py +0 -11
- atomicshop/addons/mains/install_elastic_search_and_kibana_ubuntu.py +0 -10
- atomicshop/addons/mains/install_wsl_ubuntu_lts_admin.py +0 -9
- 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/_search_in_zip.py +0 -189
- atomicshop/archiver/archiver.py +0 -34
- atomicshop/archiver/search_in_archive.py +0 -250
- atomicshop/archiver/sevenz_app_w.py +0 -86
- atomicshop/archiver/sevenzs.py +0 -44
- atomicshop/archiver/zips.py +0 -293
- atomicshop/file_types.py +0 -24
- atomicshop/mitm/config_editor.py +0 -37
- atomicshop/mitm/engines/create_module_template_example.py +0 -13
- atomicshop/mitm/initialize_mitm_server.py +0 -268
- atomicshop/pbtkmultifile_argparse.py +0 -88
- atomicshop/permissions.py +0 -151
- atomicshop/script_as_string_processor.py +0 -38
- 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 -209
- atomicshop/wrappers/elasticsearchw/infrastructure.py +0 -265
- atomicshop/wrappers/elasticsearchw/install_elastic.py +0 -232
- atomicshop/wrappers/ffmpegw.py +0 -125
- atomicshop/wrappers/fibratusw/install.py +0 -81
- atomicshop/wrappers/mongodbw/infrastructure.py +0 -53
- atomicshop/wrappers/mongodbw/install_mongodb.py +0 -190
- atomicshop/wrappers/msiw.py +0 -149
- atomicshop/wrappers/nodejsw/install_nodejs.py +0 -139
- atomicshop/wrappers/process_wrapper_pbtk.py +0 -16
- atomicshop/wrappers/psutilw/networks.py +0 -45
- atomicshop/wrappers/pycharmw.py +0 -81
- atomicshop/wrappers/socketw/base.py +0 -59
- atomicshop/wrappers/socketw/get_process.py +0 -107
- atomicshop/wrappers/wslw.py +0 -191
- atomicshop-2.15.11.dist-info/RECORD +0 -302
- /atomicshop/{addons/mains → a_mains}/FACT/factw_fact_extractor_docker_image_main_sudo.py +0 -0
- /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/{archiver → permissions}/__init__.py +0 -0
- /atomicshop/{wrappers/fibratusw → web_apis}/__init__.py +0 -0
- /atomicshop/wrappers/{nodejsw → pywin32w/wmis}/__init__.py +0 -0
- /atomicshop/wrappers/pywin32w/{wmi_win32process.py → wmis/win32process.py} +0 -0
- {atomicshop-2.15.11.dist-info → atomicshop-3.10.5.dist-info/licenses}/LICENSE.txt +0 -0
- {atomicshop-2.15.11.dist-info → atomicshop-3.10.5.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import winreg
|
|
2
|
+
import socket
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def get_network_interfaces_settings(
|
|
6
|
+
interface_guid: str = None
|
|
7
|
+
) -> dict:
|
|
8
|
+
"""
|
|
9
|
+
Get network interface settings from the Windows registry.
|
|
10
|
+
|
|
11
|
+
:param interface_guid: str, GUID of the network interface to retrieve settings for.
|
|
12
|
+
If None, settings for all interfaces will be retrieved.
|
|
13
|
+
:return: dict, network interface settings.
|
|
14
|
+
"""
|
|
15
|
+
registry_path = r"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces"
|
|
16
|
+
network_info = {}
|
|
17
|
+
|
|
18
|
+
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, registry_path) as interfaces_key:
|
|
19
|
+
interface_count = winreg.QueryInfoKey(interfaces_key)[0]
|
|
20
|
+
|
|
21
|
+
for i in range(interface_count):
|
|
22
|
+
current_interface_guid = winreg.EnumKey(interfaces_key, i)
|
|
23
|
+
|
|
24
|
+
# If an interface GUID is provided, and it doesn't match the current one, skip it
|
|
25
|
+
if interface_guid and interface_guid != current_interface_guid:
|
|
26
|
+
continue
|
|
27
|
+
|
|
28
|
+
interface_path = f"{registry_path}\\{current_interface_guid}"
|
|
29
|
+
interface_data = {}
|
|
30
|
+
|
|
31
|
+
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, interface_path) as key:
|
|
32
|
+
value_count = winreg.QueryInfoKey(key)[1]
|
|
33
|
+
|
|
34
|
+
for j in range(value_count):
|
|
35
|
+
value_name, value_data, _ = winreg.EnumValue(key, j)
|
|
36
|
+
interface_data[value_name] = value_data
|
|
37
|
+
|
|
38
|
+
# Populate the dictionary for the current interface
|
|
39
|
+
network_info[current_interface_guid] = interface_data
|
|
40
|
+
|
|
41
|
+
return network_info
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def get_network_connections_to_guids() -> dict:
|
|
45
|
+
"""
|
|
46
|
+
Get a dictionary mapping network connection names to their corresponding GUIDs.
|
|
47
|
+
|
|
48
|
+
:return: dict, GUIDs to connection names.
|
|
49
|
+
"""
|
|
50
|
+
adapters = {}
|
|
51
|
+
registry_path = r"SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}"
|
|
52
|
+
|
|
53
|
+
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, registry_path) as network_key:
|
|
54
|
+
adapter_count = winreg.QueryInfoKey(network_key)[0]
|
|
55
|
+
|
|
56
|
+
for i in range(adapter_count):
|
|
57
|
+
adapter_guid = winreg.EnumKey(network_key, i)
|
|
58
|
+
adapter_path = f"{registry_path}\\{adapter_guid}\\Connection"
|
|
59
|
+
|
|
60
|
+
try:
|
|
61
|
+
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, adapter_path) as connection_key:
|
|
62
|
+
adapter_name, _ = winreg.QueryValueEx(connection_key, "Name")
|
|
63
|
+
adapters[adapter_guid] = adapter_name
|
|
64
|
+
except FileNotFoundError:
|
|
65
|
+
# Some GUIDs might not have a corresponding 'Connection' key, so we skip them
|
|
66
|
+
continue
|
|
67
|
+
|
|
68
|
+
return adapters
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def get_enum_info_by_pnpinstanceid(
|
|
72
|
+
pnp_instance_id: str
|
|
73
|
+
) -> dict:
|
|
74
|
+
"""
|
|
75
|
+
Get all information from the Enum registry key for a device with a specific PnPInstanceId.
|
|
76
|
+
|
|
77
|
+
:param pnp_instance_id: str, PnPInstanceId of the device.
|
|
78
|
+
:return: dict, device information.
|
|
79
|
+
"""
|
|
80
|
+
enum_registry_path = r"SYSTEM\CurrentControlSet\Enum"
|
|
81
|
+
device_info = {}
|
|
82
|
+
|
|
83
|
+
# Construct the full path to the device in the Enum registry
|
|
84
|
+
hardware_path = f"{enum_registry_path}\\{pnp_instance_id}"
|
|
85
|
+
|
|
86
|
+
# Open the registry key corresponding to the device
|
|
87
|
+
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, hardware_path) as hardware_key:
|
|
88
|
+
num_values = winreg.QueryInfoKey(hardware_key)[1]
|
|
89
|
+
|
|
90
|
+
# Retrieve all values under this key
|
|
91
|
+
for i in range(num_values):
|
|
92
|
+
value_name, value_data, _ = winreg.EnumValue(hardware_key, i)
|
|
93
|
+
device_info[value_name] = value_data
|
|
94
|
+
|
|
95
|
+
return device_info
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def get_network_connections_details(get_enum_info: bool = True) -> dict:
|
|
99
|
+
"""
|
|
100
|
+
Get network adapter details from the Windows registry.
|
|
101
|
+
|
|
102
|
+
:param get_enum_info: bool, if True, retrieve all information from the corresponding Enum key.
|
|
103
|
+
This is useful for getting additional information about the network adapter, like make, model, diver details.
|
|
104
|
+
:return: dict, network adapter details.
|
|
105
|
+
"""
|
|
106
|
+
adapter_details = {}
|
|
107
|
+
network_registry_path = r"SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}"
|
|
108
|
+
|
|
109
|
+
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, network_registry_path) as network_key:
|
|
110
|
+
adapter_count = winreg.QueryInfoKey(network_key)[0]
|
|
111
|
+
|
|
112
|
+
for i in range(adapter_count):
|
|
113
|
+
adapter_guid = winreg.EnumKey(network_key, i)
|
|
114
|
+
adapter_path = f"{network_registry_path}\\{adapter_guid}\\Connection"
|
|
115
|
+
|
|
116
|
+
try:
|
|
117
|
+
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, adapter_path) as connection_key:
|
|
118
|
+
adapter_name, _ = winreg.QueryValueEx(connection_key, "Name")
|
|
119
|
+
pnp_instance_id, _ = winreg.QueryValueEx(connection_key, "PnPInstanceId")
|
|
120
|
+
|
|
121
|
+
# Get all information from the corresponding Enum key
|
|
122
|
+
if get_enum_info:
|
|
123
|
+
enum_info: dict = get_enum_info_by_pnpinstanceid(pnp_instance_id)
|
|
124
|
+
else:
|
|
125
|
+
enum_info: dict = {}
|
|
126
|
+
|
|
127
|
+
# Store the retrieved information
|
|
128
|
+
adapter_details[adapter_guid] = {
|
|
129
|
+
"Name": adapter_name,
|
|
130
|
+
"PnPInstanceId": pnp_instance_id,
|
|
131
|
+
"EnumInfo": enum_info
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
except FileNotFoundError:
|
|
135
|
+
continue
|
|
136
|
+
|
|
137
|
+
return adapter_details
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _get_default_dns_gateway() -> tuple[bool, list[str]]:
|
|
141
|
+
"""
|
|
142
|
+
NOTICE: This stopped working from the last Windows update on 11.06.2025.
|
|
143
|
+
They moved it to 'ProfileNameServer', anyway Since Windows 8 the recommended API has been the WMI
|
|
144
|
+
NetTCPIP CIM provider (MSFT_DNSClientServerAddress) - didn't test it though.
|
|
145
|
+
Just moved to netsh wrapping for now.
|
|
146
|
+
|
|
147
|
+
Get the default DNS gateway from the Windows registry.
|
|
148
|
+
|
|
149
|
+
:return: tuple(is dynamic boolean, list of DNS server IPv4s).
|
|
150
|
+
If nothing found will return (None, None).
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
def get_current_interface_status(current_interface_settings: dict) -> tuple[bool, list[str]]:
|
|
154
|
+
if current_interface_settings['NameServer']:
|
|
155
|
+
result = (False, current_interface_settings['NameServer'].split(','))
|
|
156
|
+
else:
|
|
157
|
+
result = (True, current_interface_settings['DhcpNameServer'].split(','))
|
|
158
|
+
|
|
159
|
+
return result
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
# Get current default IPv4 address of the interface that is being used for internet.
|
|
163
|
+
default_ipv4_address: str = socket.gethostbyname(socket.gethostname())
|
|
164
|
+
# If the default IPv4 address is localhost, then it could mean that the system is not connected to the internet.
|
|
165
|
+
# Or there is no network adapter at all.
|
|
166
|
+
default_dns_gateway_list: list[str] = []
|
|
167
|
+
if default_ipv4_address == '127.0.0.1':
|
|
168
|
+
from ... import dns
|
|
169
|
+
default_dns_gateway_list = dns.get_default_dns_gateway_with_dns_resolver()
|
|
170
|
+
|
|
171
|
+
# Get all network interface settings from the registry.
|
|
172
|
+
all_interfaces_configurations = get_network_interfaces_settings()
|
|
173
|
+
|
|
174
|
+
# Find the interface that has this IPv4 assigned.
|
|
175
|
+
function_result: tuple = tuple()
|
|
176
|
+
for interface_guid, interface_settings in all_interfaces_configurations.items():
|
|
177
|
+
if not interface_settings:
|
|
178
|
+
continue
|
|
179
|
+
|
|
180
|
+
if ' ' in interface_settings['NameServer']:
|
|
181
|
+
interface_settings['NameServer'] = interface_settings['NameServer'].replace(' ', ',')
|
|
182
|
+
if 'DhcpNameServer' in interface_settings and ' ' in interface_settings['DhcpNameServer']:
|
|
183
|
+
interface_settings['DhcpNameServer'] = interface_settings['DhcpNameServer'].replace(' ', ',')
|
|
184
|
+
|
|
185
|
+
if not default_dns_gateway_list:
|
|
186
|
+
current_interface_static_ipv4_address: list = interface_settings.get('IPAddress', None)
|
|
187
|
+
current_interface_dynamic_ipv4_address: str = interface_settings.get('DhcpIPAddress', None)
|
|
188
|
+
|
|
189
|
+
static_and_ip_match: bool = (
|
|
190
|
+
current_interface_static_ipv4_address and
|
|
191
|
+
current_interface_static_ipv4_address[0] == default_ipv4_address)
|
|
192
|
+
dynamic_and_ip_match: bool = (
|
|
193
|
+
current_interface_dynamic_ipv4_address and
|
|
194
|
+
current_interface_dynamic_ipv4_address == default_ipv4_address)
|
|
195
|
+
if static_and_ip_match or dynamic_and_ip_match:
|
|
196
|
+
function_result = get_current_interface_status(interface_settings)
|
|
197
|
+
|
|
198
|
+
break
|
|
199
|
+
else:
|
|
200
|
+
current_interface_name_server_list: list[str] = interface_settings['NameServer'].split(',')
|
|
201
|
+
current_interface_dhcp_name_server_list: list[str] = interface_settings['DhcpNameServer'].split(',')
|
|
202
|
+
if (current_interface_name_server_list == default_dns_gateway_list or
|
|
203
|
+
current_interface_dhcp_name_server_list == default_dns_gateway_list):
|
|
204
|
+
function_result = get_current_interface_status(interface_settings)
|
|
205
|
+
|
|
206
|
+
break
|
|
207
|
+
|
|
208
|
+
if not function_result:
|
|
209
|
+
function_result = (None, None)
|
|
210
|
+
|
|
211
|
+
# noinspection PyTypeChecker
|
|
212
|
+
return function_result
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def change_metric_of_network_adapter(
|
|
216
|
+
adapter_guid: str,
|
|
217
|
+
metric: int
|
|
218
|
+
) -> None:
|
|
219
|
+
"""
|
|
220
|
+
Change the metric of a network adapter.
|
|
221
|
+
After you set new metric you need to restart the network adapter for the changes to take effect.
|
|
222
|
+
|
|
223
|
+
:param adapter_guid: str, GUID of the network adapter.
|
|
224
|
+
:param metric: int, new metric value.
|
|
225
|
+
:return: None
|
|
226
|
+
"""
|
|
227
|
+
|
|
228
|
+
reg_path = fr"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{adapter_guid}"
|
|
229
|
+
|
|
230
|
+
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, reg_path, 0, winreg.KEY_SET_VALUE) as key:
|
|
231
|
+
winreg.SetValueEx(key, "UseAutomaticMetric", 0, winreg.REG_DWORD, 0)
|
|
232
|
+
winreg.SetValueEx(key, "InterfaceMetric", 0, winreg.REG_DWORD, metric)
|
|
@@ -1,67 +1,47 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: atomicshop
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.10.5
|
|
4
4
|
Summary: Atomic functions and classes to make developer life easier
|
|
5
5
|
Author: Denis Kras
|
|
6
|
-
License: MIT
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2023 Bugsec, Denis Kras
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
-
SOFTWARE.
|
|
6
|
+
License-Expression: MIT
|
|
27
7
|
Project-URL: Homepage, https://github.com/BugSec-Official/atomicshop
|
|
28
8
|
Classifier: Intended Audience :: Developers
|
|
29
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
30
9
|
Classifier: Programming Language :: Python :: 3
|
|
31
10
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
32
|
-
Requires-Python:
|
|
11
|
+
Requires-Python: <3.14,>=3.12
|
|
33
12
|
Description-Content-Type: text/markdown
|
|
34
13
|
License-File: LICENSE.txt
|
|
35
14
|
Requires-Dist: wheel
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist:
|
|
39
|
-
Requires-Dist:
|
|
40
|
-
Requires-Dist:
|
|
41
|
-
Requires-Dist:
|
|
15
|
+
Requires-Dist: setuptools
|
|
16
|
+
Requires-Dist: beautifulsoup4==4.14.3
|
|
17
|
+
Requires-Dist: cryptography==46.0.3
|
|
18
|
+
Requires-Dist: dkarchiver==1.0.1
|
|
19
|
+
Requires-Dist: dkinst
|
|
20
|
+
Requires-Dist: dnslib==0.9.26
|
|
21
|
+
Requires-Dist: dnspython==2.8.0
|
|
22
|
+
Requires-Dist: docker==7.1.0
|
|
23
|
+
Requires-Dist: flask_socketio==5.5.1
|
|
24
|
+
Requires-Dist: google-api-python-client==2.187.0
|
|
25
|
+
Requires-Dist: google-genai==1.53.0
|
|
26
|
+
Requires-Dist: icmplib==3.0.4
|
|
42
27
|
Requires-Dist: numpy
|
|
43
|
-
Requires-Dist: olefile
|
|
44
|
-
Requires-Dist: openpyxl
|
|
45
|
-
Requires-Dist: pandas
|
|
46
|
-
Requires-Dist: paramiko
|
|
47
|
-
Requires-Dist:
|
|
48
|
-
Requires-Dist: playwright
|
|
49
|
-
Requires-Dist:
|
|
50
|
-
Requires-Dist:
|
|
51
|
-
Requires-Dist:
|
|
52
|
-
Requires-Dist: pyautogui
|
|
53
|
-
Requires-Dist: pymongo
|
|
54
|
-
Requires-Dist: pyopenssl
|
|
55
|
-
Requires-Dist: python-bidi
|
|
28
|
+
Requires-Dist: olefile==0.47
|
|
29
|
+
Requires-Dist: openpyxl==3.1.5
|
|
30
|
+
Requires-Dist: pandas==2.3.3
|
|
31
|
+
Requires-Dist: paramiko==4.0.0
|
|
32
|
+
Requires-Dist: pefile==2024.8.26
|
|
33
|
+
Requires-Dist: playwright==1.56.0
|
|
34
|
+
Requires-Dist: psutil==7.1.3
|
|
35
|
+
Requires-Dist: pymongo==4.15.5
|
|
36
|
+
Requires-Dist: pyopenssl==25.3.0
|
|
56
37
|
Requires-Dist: python-docx
|
|
57
|
-
Requires-Dist:
|
|
58
|
-
Requires-Dist: reportlab
|
|
59
|
-
Requires-Dist: setuptools
|
|
38
|
+
Requires-Dist: pywin32==311; platform_system == "Windows"
|
|
60
39
|
Requires-Dist: SoundCard
|
|
61
40
|
Requires-Dist: soundfile
|
|
62
41
|
Requires-Dist: SpeechRecognition
|
|
63
|
-
Requires-Dist: tldextract
|
|
64
|
-
Requires-Dist:
|
|
42
|
+
Requires-Dist: tldextract==5.3.0
|
|
43
|
+
Requires-Dist: websockets==15.0.1
|
|
44
|
+
Dynamic: license-file
|
|
65
45
|
|
|
66
46
|
<h1 align="center">Atomic Workshop</h1>
|
|
67
47
|
|
|
@@ -153,9 +133,9 @@ To get a local copy up and running follow these simple steps.
|
|
|
153
133
|
```
|
|
154
134
|
|
|
155
135
|
The latest version on PyPI is 0.2, so you will need to install from GitHub.
|
|
156
|
-
Alternatively, you can use a
|
|
136
|
+
Alternatively, you can use a command anywhere in CMD after 'atomicshop' installation:
|
|
157
137
|
```sh
|
|
158
|
-
|
|
138
|
+
pywintrace install
|
|
159
139
|
```
|
|
160
140
|
|
|
161
141
|
4. If you get an exception while installing the 'psycopg2' package on ubuntu, install this binary:
|