atomicshop 2.19.17__py3-none-any.whl → 2.19.19__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/psutilw/networks.py +13 -8
- atomicshop/wrappers/socketw/dns_server.py +2 -1
- atomicshop/wrappers/socketw/socket_wrapper.py +5 -1
- {atomicshop-2.19.17.dist-info → atomicshop-2.19.19.dist-info}/METADATA +1 -1
- {atomicshop-2.19.17.dist-info → atomicshop-2.19.19.dist-info}/RECORD +9 -9
- {atomicshop-2.19.17.dist-info → atomicshop-2.19.19.dist-info}/LICENSE.txt +0 -0
- {atomicshop-2.19.17.dist-info → atomicshop-2.19.19.dist-info}/WHEEL +0 -0
- {atomicshop-2.19.17.dist-info → atomicshop-2.19.19.dist-info}/top_level.txt +0 -0
atomicshop/__init__.py
CHANGED
|
@@ -5,12 +5,16 @@ import socket
|
|
|
5
5
|
import psutil
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
def get_process_using_port(
|
|
8
|
+
def get_process_using_port(ip_port: str) -> Union[dict, None]:
|
|
9
9
|
"""
|
|
10
10
|
Function to find the process using the port.
|
|
11
|
-
:param
|
|
11
|
+
:param ip_port: string, Listening IP and port number. Example: '192.168.0.1:443'
|
|
12
12
|
:return: dict['pid', 'name', 'cmdline'] or None.
|
|
13
13
|
"""
|
|
14
|
+
|
|
15
|
+
ip_address, port = ip_port.split(':')
|
|
16
|
+
port = int(port)
|
|
17
|
+
|
|
14
18
|
for proc in psutil.process_iter(['pid', 'name', 'cmdline']):
|
|
15
19
|
try:
|
|
16
20
|
connections = proc.connections(kind='inet')
|
|
@@ -18,7 +22,7 @@ def get_process_using_port(port: int) -> Union[dict, None]:
|
|
|
18
22
|
# if conn.laddr.port == port:
|
|
19
23
|
# Status LISTEN is for TCP sockets and NONE is for UDP sockets.
|
|
20
24
|
# Sometimes after socket close, the port will be in TIME_WAIT state.
|
|
21
|
-
if conn.laddr.port == port and (conn.status == 'LISTEN' or conn.status == 'NONE'):
|
|
25
|
+
if (conn.laddr.port == port and (conn.status == 'LISTEN' or conn.status == 'NONE')) and conn.laddr.ip == ip_address:
|
|
22
26
|
cmdline = proc.info['cmdline']
|
|
23
27
|
if not cmdline:
|
|
24
28
|
cmdline = '<EMPTY: TRY RUNNING AS ADMIN>'
|
|
@@ -34,17 +38,18 @@ def get_process_using_port(port: int) -> Union[dict, None]:
|
|
|
34
38
|
return None
|
|
35
39
|
|
|
36
40
|
|
|
37
|
-
def get_processes_using_port_list(
|
|
41
|
+
def get_processes_using_port_list(ips_ports: list) -> Union[dict, None]:
|
|
38
42
|
"""
|
|
39
43
|
Function to find the process using the port.
|
|
40
|
-
:param
|
|
44
|
+
:param ips_ports: List of listening ips and port numbers. Example:
|
|
45
|
+
['192.168.0.1:443', '192.168.0.2:443']
|
|
41
46
|
:return: dict[port: {'pid', 'name', 'cmdline'}] or None.
|
|
42
47
|
"""
|
|
43
48
|
port_process_map = {}
|
|
44
|
-
for
|
|
45
|
-
process_info = get_process_using_port(
|
|
49
|
+
for ip_port in ips_ports:
|
|
50
|
+
process_info = get_process_using_port(ip_port)
|
|
46
51
|
if process_info:
|
|
47
|
-
port_process_map[
|
|
52
|
+
port_process_map[ip_port] = process_info
|
|
48
53
|
|
|
49
54
|
return port_process_map
|
|
50
55
|
|
|
@@ -273,7 +273,8 @@ class DnsServer:
|
|
|
273
273
|
except ValueError as e:
|
|
274
274
|
raise DnsConfigurationValuesError(e)
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
ips_ports: list[str] = [f'{self.listening_interface}:{self.listening_port}']
|
|
277
|
+
port_in_use = networks.get_processes_using_port_list(ips_ports)
|
|
277
278
|
if port_in_use:
|
|
278
279
|
error_messages: list = list()
|
|
279
280
|
for port, process_info in port_in_use.items():
|
|
@@ -309,7 +309,11 @@ class SocketWrapper:
|
|
|
309
309
|
print_api(message, color='red', logger=self.logger)
|
|
310
310
|
return 1
|
|
311
311
|
|
|
312
|
-
|
|
312
|
+
ips_ports: list[str] = list()
|
|
313
|
+
for port in self.listening_port_list:
|
|
314
|
+
ips_ports.append(f"{self.listening_interface}:{port}")
|
|
315
|
+
|
|
316
|
+
port_in_use = networks.get_processes_using_port_list(ips_ports)
|
|
313
317
|
if port_in_use:
|
|
314
318
|
error_messages: list = list()
|
|
315
319
|
for port, process_info in port_in_use.items():
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
atomicshop/__init__.py,sha256=
|
|
1
|
+
atomicshop/__init__.py,sha256=9NTN5n9oTHbDX8JvsmHXwnyznaLqNWTJxTHCojA8XBE,124
|
|
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
|
|
@@ -290,7 +290,7 @@ atomicshop/wrappers/playwrightw/waits.py,sha256=PBFdz_PoM7Fo7O8hLqMrxNPzBEYgPoXw
|
|
|
290
290
|
atomicshop/wrappers/psutilw/cpus.py,sha256=w6LPBMINqS-T_X8vzdYkLS2Wzuve28Ydp_GafTCngrc,236
|
|
291
291
|
atomicshop/wrappers/psutilw/disks.py,sha256=3ZSVoommKH1TWo37j_83frB-NqXF4Nf5q5mBCX8G4jE,9221
|
|
292
292
|
atomicshop/wrappers/psutilw/memories.py,sha256=_S0aL8iaoIHebd1vOFrY_T9aROM5Jx2D5CvDh_4j0Vc,528
|
|
293
|
-
atomicshop/wrappers/psutilw/networks.py,sha256=
|
|
293
|
+
atomicshop/wrappers/psutilw/networks.py,sha256=dsCos1MaMdFYjyCyZAlM4N1NWAZh5gKOPNcIX3hQ7jA,2848
|
|
294
294
|
atomicshop/wrappers/psutilw/processes.py,sha256=ihYnxfMTVEXHWy92iewktoZGxazx3v5QCIn0bNLnfsU,2859
|
|
295
295
|
atomicshop/wrappers/psutilw/psutilw.py,sha256=q3EwgprqyrR4zLCjl4l5DHFOQoukEvQMIPjNB504oQ0,21262
|
|
296
296
|
atomicshop/wrappers/psycopgw/psycopgw.py,sha256=XJvVf0oAUjCHkrYfKeFuGCpfn0Oxj3u4SbKMKA1508E,7118
|
|
@@ -316,7 +316,7 @@ atomicshop/wrappers/socketw/accepter.py,sha256=hZZKVYlF3LOHQJsSIEKXZUf6QXXWm-Atq
|
|
|
316
316
|
atomicshop/wrappers/socketw/base.py,sha256=zYwFxiEzTcItFi1RZQCMxMTLBvECVUiKwivPYKcu44g,2713
|
|
317
317
|
atomicshop/wrappers/socketw/certificator.py,sha256=mtWPJ_ew3OSwt0-1W4jaoco1VIY4NRCrMv3mDUxb_Cc,12418
|
|
318
318
|
atomicshop/wrappers/socketw/creator.py,sha256=aSwfN_IwXXf4Hob35vHXUxD_OPeshZcRDZU2hMyfKs0,13243
|
|
319
|
-
atomicshop/wrappers/socketw/dns_server.py,sha256=
|
|
319
|
+
atomicshop/wrappers/socketw/dns_server.py,sha256=vNh22q5CBzCf8Rn50NNDRs05J4AyRSoT78lTT0q-rb4,49141
|
|
320
320
|
atomicshop/wrappers/socketw/exception_wrapper.py,sha256=B-X5SHLSUIWToihH2MKnOB1F4A81_X0DpLLfnYKYbEc,7067
|
|
321
321
|
atomicshop/wrappers/socketw/get_process.py,sha256=aJC-_qFUv3NgWCSUzDI72E4z8_-VTZE9NVZ0CwUoNlM,5698
|
|
322
322
|
atomicshop/wrappers/socketw/receiver.py,sha256=9B3MvcDqr4C3x2fsnjG5SQognd1wRqsBgikxZa0wXG8,8243
|
|
@@ -324,14 +324,14 @@ atomicshop/wrappers/socketw/sender.py,sha256=aX_K8l_rHjd5AWb8bi5mt8-YTkMYVRDB6Dn
|
|
|
324
324
|
atomicshop/wrappers/socketw/sni.py,sha256=T9PXROiTYYxrd_7X4Hoj9hoNPXXTQpa2HdvmBJJIoeA,17607
|
|
325
325
|
atomicshop/wrappers/socketw/socket_client.py,sha256=oa3GwS4OPgokrJE5_Oc4-5_wlXHxSH9J5f2DKebms8k,22035
|
|
326
326
|
atomicshop/wrappers/socketw/socket_server_tester.py,sha256=Qobmh4XV8ZxLUaw-eW4ESKAbeSLecCKn2OWFzMhadk0,6420
|
|
327
|
-
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=
|
|
327
|
+
atomicshop/wrappers/socketw/socket_wrapper.py,sha256=3JhqFmHcNDWYBSqBiJbyXZ5btkEXtbqVG0r4XRCyFGs,36265
|
|
328
328
|
atomicshop/wrappers/socketw/ssl_base.py,sha256=kmiif84kMhBr5yjQW17p935sfjR5JKG0LxIwBA4iVvU,2275
|
|
329
329
|
atomicshop/wrappers/socketw/statistics_csv.py,sha256=fgMzDXI0cybwUEqAxprRmY3lqbh30KAV-jOpoFKT-m8,3395
|
|
330
330
|
atomicshop/wrappers/winregw/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
331
331
|
atomicshop/wrappers/winregw/winreg_installed_software.py,sha256=Qzmyktvob1qp6Tjk2DjLfAqr_yXV0sgWzdMW_9kwNjY,2345
|
|
332
332
|
atomicshop/wrappers/winregw/winreg_network.py,sha256=AENV88H1qDidrcpyM9OwEZxX5svfi-Jb4N6FkS1xtqA,8851
|
|
333
|
-
atomicshop-2.19.
|
|
334
|
-
atomicshop-2.19.
|
|
335
|
-
atomicshop-2.19.
|
|
336
|
-
atomicshop-2.19.
|
|
337
|
-
atomicshop-2.19.
|
|
333
|
+
atomicshop-2.19.19.dist-info/LICENSE.txt,sha256=lLU7EYycfYcK2NR_1gfnhnRC8b8ccOTElACYplgZN88,1094
|
|
334
|
+
atomicshop-2.19.19.dist-info/METADATA,sha256=KWtJOQ-e9e2Jw4ea8kbUOl2NODhWXNIEAOZx1uwrcOM,10631
|
|
335
|
+
atomicshop-2.19.19.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
336
|
+
atomicshop-2.19.19.dist-info/top_level.txt,sha256=EgKJB-7xcrAPeqTRF2laD_Np2gNGYkJkd4OyXqpJphA,11
|
|
337
|
+
atomicshop-2.19.19.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|