-
Notifications
You must be signed in to change notification settings - Fork 0
/
client-setup.py
48 lines (43 loc) · 1.52 KB
/
client-setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import sys
import os
try:
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization
from cryptography.fernet import Fernet
except:
print('Error: cryptography not found. Run "pip install cryptography".')
sys.exit()
from threading import Thread
try:
import hashlib
except:
print('Error: hashlib not found. Run "pip install hashlib".')
sys.exit()
try:
import PySide6
except:
print('Error: PySide6 not found. Run "pip install PySide6".')
directory = input('Path to install: ')
def ask_system():
print('Choose your system(1/2):')
print(' [1] - Linux/MacOS')
print(' [2] - Windows')
system = input('> ')
if system == '1':
slash = '/'
elif system == '2':
slash == '\\'
else:
print('Incorrect input! Please, enter 1 or 2.\n')
slash = ask_system()
return slash
slash = ask_system()
os.system(f'curl https://raw.githubusercontent.com/gh0stKn1ght/Abyss/main/client/client.py > {directory}{slash}client.py')
os.system(f'curl https://raw.githubusercontent.com/gh0stKn1ght/Abyss/main/client/client.py > {directory}{slash}config.py')
master_key = Fernet.generate_key()
config = b'username: changeme\npassword: changeme\nip: 127.0.0.1\nport: 1234'
fernet = Fernet(master_key)
config = fernet.encrypt(config)
open(f'{directory}{slash}config', 'wb').write(config)
input(f'Your local master-key: {master_key}. Save it somewhere. Press Enter when you are ready...')
print('Successfully installed Abyss client!')