-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
199 lines (167 loc) · 7.69 KB
/
main.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# Copyright © Nelson Cybersecurity LLC
# Founder of VaultCord.com and KeyAuth.win
# VaultCord account connector is licensed under Elastic License 2.0
# - You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
# - You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
# - You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
# Thank you for your compliance, we work hard on the development of VaultCord and do not appreciate our copyright being infringed.
# https://github.com/VaultCord/Account-Connector
# https://youtube.com/@VaultCord
# https://t.me/vaultcode
import time
import os
import subprocess
import sys
from sys import exit
import json
import ctypes
import requests
import http.server
import socketserver
from colorama import Fore, init
from client_info import request_client, discord_build, discord_build_failback
colors = {
"main_colour": Fore.MAGENTA,
"light_red": Fore.LIGHTRED_EX,
"yellow": Fore.YELLOW,
"light_blue": Fore.LIGHTBLUE_EX,
"green": Fore.LIGHTGREEN_EX,
"white": Fore.WHITE,
}
def cleanup():
print(f"Closing in 3 seconds..")
time.sleep(3)
current_executable = sys.argv[0]
delete_command = f"Start-Sleep -Seconds 1; Remove-Item -Force \"{current_executable}\""
subprocess.Popen(["powershell", "-Command", delete_command])
# Execute self-delete so people don't use outdated version of program (if we have to update)
exit()
class CustomHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def version_string(self):
"""Return the server software version string."""
return "VaultCord account connector"
def log_message(self, format, *args):
# Disable server request list from showing
return
def do_OPTIONS(self):
"""Respond to an OPTIONS request."""
self.send_response(200, "OK")
self.send_header("Allow", "GET, OPTIONS")
self.send_header("Access-Control-Allow-Origin", "https://dash.vaultcord.com")
self.send_header("Access-Control-Allow-Methods", "GET, OPTIONS")
self.send_header("Access-Control-Allow-Headers", "Content-Type")
self.end_headers()
def do_POST(self):
"""Respond to a POST request."""
# Setting the headers
self.send_response(200)
self.send_header("Content-type", "application/json")
self.send_header("Access-Control-Allow-Origin", "https://dash.vaultcord.com")
self.end_headers()
# JSON response
response_content = {
"success": True,
"message": "Responded to POST request"
}
# Write the JSON response
self.wfile.write(json.dumps(response_content).encode('utf-8'))
def do_GET(self):
import console
c = console.prnt()
referer = self.headers.get('Origin')
if not referer:
print("No referer specified, please try again")
self.send_response(200)
self.send_header("Content-type", "application/json")
self.send_header("Access-Control-Allow-Origin", "https://dash.vaultcord.com")
self.end_headers()
# JSON response
response_content = {
"success": False,
"message": "No referer specified"
}
# Write the JSON response
self.wfile.write(json.dumps(response_content).encode('utf-8'))
cleanup()
return
if referer and 'https://dash.vaultcord.com' not in referer:
print("Invalid referer:", referer)
print("Please try again")
self.send_response(200)
self.send_header("Content-type", "application/json")
self.send_header("Access-Control-Allow-Origin", "https://dash.vaultcord.com")
self.end_headers()
# JSON response
response_content = {
"success": False,
"message": f"Invalid referer: {referer}"
}
# Write the JSON response
self.wfile.write(json.dumps(response_content).encode('utf-8'))
cleanup()
return
# This will list Discord accounts you can use with VaultCord
# Only our client-side dashboard sees the details and it's NOT saved in database, do not worry.
# we require 2FA so it's only temporary access to make a bot.
# Most people use alt accounts for VaultCord anyways so their bot is safe if their account gets deleted..
# You can always use the --Manual-- option on our dashboard if that makes you more comfortable
import fetch_details
c.info(f"Scanning for accounts... Please wait a moment")
tokens = fetch_details.fetch()
if len(tokens) != 0:
print()
while True:
c.info(f"Select which account you want to use for VaultCord:")
for tkn in tokens:
print(f"{colors['white']}{tokens.index(tkn)}: {colors['main_colour']}{tkn[1]}{colors['white']} from {colors['main_colour']}{tkn[3]}")
print()
c.inp(f"Choice {colors['main_colour']}(int) """, end=colors['white'])
try: tknchoice = int(input())
except ValueError: c.fail(f"Invalid Choice. Please try again")
else:
try:
token_selected = tokens[tknchoice]
except:
c.fail(f"Invalid Choice. Please try again")
else:
break
c.success(f"Selected {colors['main_colour']}{token_selected[1]}")
token_info = token_selected
else:
c.fail(f"No accounts found Please login to Discord and try again.")
self.send_response(200)
self.send_header("Content-type", "application/json")
self.send_header("Access-Control-Allow-Origin", "https://dash.vaultcord.com")
self.end_headers()
# JSON response
response_content = {
"success": False,
"message": "No accounts found"
}
# Write the JSON response
self.wfile.write(json.dumps(response_content).encode('utf-8'))
cleanup()
return
print("SUCCESS - Check the VaultCord dashboard")
print(f"{colors['yellow']}Check the VaultCord dashboard!{colors['white']}")
# Setting the headers
self.send_response(200)
self.send_header("Content-type", "application/json")
self.send_header("Access-Control-Allow-Origin", "https://dash.vaultcord.com")
self.end_headers()
# JSON response
response_content = {
"success": True,
"token": token_info[0]
}
# Write the JSON response
self.wfile.write(json.dumps(response_content).encode('utf-8'))
cleanup()
if __name__ == '__main__':
with socketserver.TCPServer(("localhost", 53628), CustomHTTPRequestHandler) as httpd:
print('Waiting for VaultCord dashboard to complete..')
print('ONLY download this program from github.com/VaultCord')
try: ctypes.windll.kernel32.SetConsoleTitleW(f"VaultCord automatic setup")
except: pass
init(autoreset=True)
httpd.serve_forever()