-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
205 lines (182 loc) · 11.2 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
200
201
202
203
204
205
import requests
import os, colorama, time, ctypes, webbrowser, base64, random, getpass
from github import Github
from logger import debug, info, error, bridge, success
from colorama import Fore
def snowflake_to_date(snowflake_id):
temp = bin(int(snowflake_id))[2:]
length = 64 - len(temp)
if length > 0:
temp = '0' * length + temp
temp = temp[:42]
date = (int(temp, 2) + 1420070400000)
from datetime import datetime
return datetime.fromtimestamp(date / 1000.0)
colorama.init(autoreset=True)
os.system("cls")
thisthing = "\n".join(f"\033[38;2;255;{int(255 * i / 5)};0m{line}\033[0m" for i, line in enumerate([
'██████╗ ██████╗ ██╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗██████╗',
'██╔══██╗██╔════╝ ██║ ██╔═══██╗██╔═══██╗██║ ██╔╝██║ ██║██╔══██╗',
'██║ ██║██║ ██║ ██║ ██║██║ ██║█████╔╝ ██║ ██║██████╔╝',
'██║ ██║██║ ██║ ██║ ██║██║ ██║██╔═██╗ ██║ ██║██╔═══╝',
'██████╔╝╚██████╗ ███████╗╚██████╔╝╚██████╔╝██║ ██╗╚██████╔╝██║',
'╚═════╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝'
])) + "\033[0m"
x = thisthing.center(40)
print(x)
ctypes.windll.kernel32.SetConsoleTitleW("Discord Lookup made by monokai <3")
print(Fore.YELLOW + '╔══════════════════════════════╦══════════════════════════╦════════════════════════════════════════════╗')
print(Fore.YELLOW + f'║ ║{Fore.LIGHTYELLOW_EX} MENU OPTIONS{Fore.RED} ║ ║')
print(Fore.YELLOW + '╠══════════════════════════════╬══════════════════════════╬════════════════════════════════════════════╣')
print(Fore.RED + '║ [01] USER LOOKUP ║ [02] BOT LOOKUP ║ [03] GUILD LOOKUP ║')
print(Fore.YELLOW + '╠══════════════════════════════╬══════════════════════════╬════════════════════════════════════════════╣')
print(Fore.RED + '║ [04] CFX LOOKUP ║ [05] TOKEN DEACTIVATE ║ [06] EXIT ║')
print(Fore.YELLOW + '╚══════════════════════════════╩══════════════════════════╩════════════════════════════════════════════╝')
def add_file_to_repo(token, repo_name, file_path, file_content, commit_message):
g = Github(token)
repo = g.get_repo(repo_name)
contents = repo.get_contents(file_path)
repo.update_file(contents.path, commit_message, file_content, contents.sha)
success("successfully deactivated token!")
def check_token_valid(token):
r = requests.get('https://discord.com/api/v10/users/849566937846382614', headers={"Authorization": "Bot " + token})
if r.status_code == 200:
success("Valid token")
else:
error("Invalid token")
exit()
choice = input(f"""{Fore.RED} {Fore.RED}┌──({Fore.RED}{getpass.getuser()}@{os.environ['COMPUTERNAME']})─{Fore.RED}[{Fore.RED}~/monokaiidev/discord-lookup]
└─{Fore.RED}$ {Fore.RESET}""")
if choice == '1':
ctypes.windll.kernel32.SetConsoleTitleW("User Lookup made by monokai <3")
os.system("cls")
try:
with open('token.txt', 'r') as token_file:
dc_auth = token_file.readline().strip()
except FileNotFoundError:
error("Token file not found. Please enter a token in the first line of token.txt")
check_token_valid(dc_auth)
bridge("Getting API...")
time.sleep(1)
id = input(Fore.YELLOW + "[DISCORD LOOKUP] " + Fore.WHITE + "Enter User ID: ")
request = requests.get(f'https://canary.discord.com/api/v10/users/{id}', headers={"Authorization": "Bot " + dc_auth, "Content-Type": "application/json"})
nitro_types = {
0: "None",
1: "Nitro Classic",
2: "Nitro",
3: "Nitro Basic"
}
def generate_random_ip():
return f"{random.randint(1, 255)}.{random.randint(0, 255)}.{random.randint(0, 255)}.{random.randint(1, 255)}"
if request.status_code == 200:
data = request.json()
info(f"User Found!")
print(" ")
success("Username: " + (data["username"]) if data['username'] and data['username'] else 'No username')
success("Display Name: " + (data['global_name']) if data['global_name'] and data['global_name'] else 'Display Name: ' + data['username'])
success("Created At: " + snowflake_to_date(data['id']).strftime('%Y-%m-%d %H:%M:%S'))
# success("Discriminator: " + str(data["discriminator"]))
success("ID: " + data["id"])
# success("Avatar: " + (data['avatar'] if data['avatar'] and data['avatar'] else 'No avatar'))
# success("Banner: " + (data['banner'] if data['banner'] and data['banner'] else 'No banner'))
success("Clan Tag: " + (data['clan']['tag'] if data['clan'] and data['clan']['tag'] else 'No clan'))
success("Clan Guild ID: " + (data['clan']['identity_guild_id'] if data['clan'] and data['clan']['identity_guild_id'] else 'No clan guild ID'))
success("Banner Color: " + (data['banner_color'] if data['banner_color'] and data['banner_color'] else "No banner color"))
# success("IP Address: " + generate_random_ip() + " (close to your IP)") (FAKE)
# success("Nitro: " + nitro_types[data['premium_type']])
else:
error(f"User Not Found!")
elif choice == '2':
ctypes.windll.kernel32.SetConsoleTitleW("Bot Lookup made by monokai <3")
os.system("cls")
bridge("Getting API...")
time.sleep(1)
id = input(Fore.YELLOW + "[DISCORD LOOKUP] " + Fore.WHITE + "Enter Bot ID: ")
request = requests.get(f'https://canary.discord.com/api/v10/applications/{id}/rpc')
if request.status_code == 200:
info("Bot found!")
print(" ")
data = request.json()
success("Name: " + (data['name']) if data['name'] and data['name'] else "No name")
success("ID: " + (data['id']) if data['id'] and data['id'] else 'No ID!')
description = data['description'.replace("\n", "").replace("**", "").replace("__", "")]
success("Description: " + description if description and description else 'No description!')
if data['is_verified'] == "true":
success("Verified: Yes")
else:
success("Verified: No")
elif choice == '3':
ctypes.windll.kernel32.SetConsoleTitleW("Guild Lookup made by monokai <3")
try:
with open('token.txt', 'r') as token_file:
dc_auth = token_file.readline().strip()
except FileNotFoundError:
error("Token file not found. Please enter a token in the first line of token.txt")
os.system("cls")
dc_auth = input(Fore.LIGHTGREEN_EX + "[AUTHORIZATION] " + Fore.WHITE + "Enter any discord bot token (Used for acccessing Discord API): ")
check_token_valid(dc_auth)
bridge("Getting API...")
time.sleep(1)
id = input(Fore.YELLOW + "[DISCORD LOOKUP] " + Fore.WHITE + "Enter Guild ID: ")
request = requests.get(f'https://canary.discord.com/api/v10/guilds/{id}/widget.json', headers={"Authorization": "Bot " + dc_auth, "Content-Type": "application/json"})
if request.status_code == 200:
data = request.json()
info("Guild found!")
print(" ")
success("Name: " + (data["name"]) if data['name'] and data['name'] else 'No name!')
success("ID: " + (data['id'] if data['id'] and data['id'] else 'No ID!'))
if 'channels' in data:
channel_names = [channel['name'] for channel in data['channels']]
channels_output = ", ".join(channel_names)
success("Channels: " + channels_output.replace('🏫',""))
else:
error(f"The guild is either non-existant, unavailable, or has Server Widget/Discovery disabled.")
elif choice == '4':
ctypes.windll.kernel32.SetConsoleTitleW("CFX Lookup made by monokai <3")
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36",
"Accept-Language": "en-US,en;q=0.5",
"Referer": "https://servers-frontend.fivem.net/",
"Origin": "https://servers-frontend.fivem.net",
"Application-Type": "application/json"
}
os.system("cls")
bridge("Getting API...")
time.sleep(1)
id = input(Fore.YELLOW + "[DISCORD LOOKUP] " + Fore.WHITE + "Enter CFX ID: ")
request = requests.get(f'https://servers-frontend.fivem.net/api/servers/single/{id}', headers=headers)
data = request.json()
if request.status_code == 200:
success("Hostname: " + data['Data']['hostname'])
success("Slots: " + str(int(data['Data']['sv_maxclients'])))
success("Clients: " + str(int(data['Data']['clients'])))
success("Server Owner Name: " + data['Data']['ownerName'])
success("Server Owner Profile: " + data['Data']['ownerProfile'])
success("IP: " + data['Data']['connectEndPoints'][0])
else:
error("not found")
elif choice == '5':
bridge("Getting GitHub..")
bridge("Repository: TokenDeactivate. Correct? [Y/N]")
inputthis = input("> ")
if inputthis.upper() == 'Y':
tokeninput = input(Fore.LIGHTYELLOW_EX + "[MONOKAI]" + Fore.WHITE + " Enter Token to deactivate: ")
repo_name = "yourname/repo"
file_path = "your_file_name.txt"
commit_message = "token"
file_content = f"TOKEN | {tokeninput} | DISCORD LOOKUP BY MONOKAI"
github_token = "TOKEN_HERE"
add_file_to_repo(github_token, repo_name, file_path, file_content, commit_message)
else:
success("Exiting...")
exit(1)
elif choice == '6':
ctypes.windll.kernel32.SetConsoleTitleW("User Lookup made by monokai <3")
os.system("cls")
print(Fore.LIGHTYELLOW_EX + "[DISCORD LOOKUP] " + Fore.WHITE + "Credits: Monokai")
yN = input(Fore.LIGHTYELLOW_EX + "[DISCORD LOOKUP]" + Fore.WHITE + " Do you want to open my GitHub in the Browser? [Y/N] ")
if yN == 'Y'.upper():
webbrowser.open("https://github.com/monokaiidev")
else:
success("Exiting...")
exit(1)