-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathsorting_files_tab.py
381 lines (304 loc) · 15.3 KB
/
sorting_files_tab.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
import json
import os
import re
import random
import string
import sys
import webbrowser
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from PyQt5.QtCore import QUrl, Qt, QProcess, QTimer, QTimer, pyqtSignal, pyqtSlot
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtWidgets import QApplication, QMainWindow, QPlainTextEdit, QLCDNumber, QMainWindow, QWidget, QVBoxLayout, QTextBrowser, QFileDialog, QTextEdit, QComboBox, QPushButton, QMessageBox, QFrame, QInputDialog, QLabel, QCheckBox, QScrollBar, QDialogButtonBox, QDialog, QGridLayout
import hashlib
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtGui import QDesktopServices, QColor, QTextCharFormat
import binascii
import json as jsond
import platform
import subprocess
import time
from datetime import datetime
from time import sleep
import shutil
import modules.general_tab
from multiprocessing import Process, Queue
from PyQt5.QtCore import QRunnable, QObject, pyqtSignal
from modules import general_tab, password_log_formats, sorting_files_tab, sorting_cookies_tab
from general_tab import remove_ending_punctuation
import sorting_files_tab
#Gunction for handling the Scrape Security Data button click
def handle_scrape_security_data_button_click():
sorting_files_tab.handle_scrape_security_data()
def handle_command_link():
directory_path = self.set_directory_path_element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Command Link/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the command link process and save the results in the specified directory
# Add your code here to perform the command link process and save the results
print("Command Link process completed.")
else:
print("Invalid directory path.")
def handle_telegram_folders(loaded_directory):
if not os.path.isdir(loaded_directory):
print("Invalid directory path.")
return
# Define the subfolder names to search for
subfolder_names = ["Tdata", "Profile_1"]
# Create the new folder name
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Telegram Folders/{timestamp}"
# Create the saved directory path
saved_directory = os.path.join(loaded_directory, new_folder_name)
os.makedirs(saved_directory)
# Crawl the loaded directory and search for subfolders
for root, dirs, files in os.walk(loaded_directory):
for dir_name in dirs:
if dir_name in subfolder_names:
# Get the full path of the subfolder
subfolder_path = os.path.join(root, dir_name)
# Copy the subfolder and its contents to the saved directory path
shutil.copytree(subfolder_path, os.path.join(saved_directory, dir_name))
print("Telegram Folders sorting completed.")
def handle_authy_desktop(loaded_directory):
if not os.path.isdir(loaded_directory):
print("Invalid directory path.")
return
# Define the folder name to search for
folder_name = "Authy"
# Create the new folder name
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Authy Desktop/{timestamp}"
# Create the saved directory path
saved_directory = os.path.join(loaded_directory, new_folder_name)
os.makedirs(saved_directory)
# Crawl the loaded directory and search for the specified folder
for root, dirs, files in os.walk(loaded_directory):
for dir_name in dirs:
if dir_name == folder_name:
# Get the full path of the folder
folder_path = os.path.join(root, dir_name)
# Copy the folder and its contents to the saved directory path
shutil.copytree(folder_path, os.path.join(saved_directory, dir_name))
print("Authy Desktop folder sorting completed.")
def handle_desktop_wallet():
directory_path = self.Directory_Path_Text_Element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Desktop Wallet/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the Desktop Wallet process and save the results in the specified directory
# Add your code here to perform the Desktop Wallet process and save the results
print("Desktop Wallet process completed.")
else:
print("Invalid directory path.")
def handle_browser_2fa_extension():
directory_path = self.Directory_Path_Text_Element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Browser 2FA Extension/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the Browser 2FA Extension process and save the results in the specified directory
# Add your code here to perform the Browser 2FA Extension process and save the results
print("Browser 2FA Extension process completed.")
else:
print("Invalid directory path.")
def handle_text_named_sorting():
directory_path = self.Directory_Path_Text_Element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Text Named Sorting/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the Text Named Sorting process and save the results in the specified directory
# Add your code here to perform the Text Named Sorting process and save the results
print("Text Named Sorting process completed.")
else:
print("Invalid directory path.")
def handle_pgp():
directory_path = self.Directory_Path_Text_Element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/PGP/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the PGP process and save the results in the specified directory
# Add your code here to perform the PGP process and save the results
print("PGP process completed.")
else:
print("Invalid directory path.")
def handle_encryption_keys():
directory_path = self.Directory_Path_Text_Element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Encryption Keys/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the Encryption Keys process and save the results in the specified directory
# Add your code here to perform the Encryption Keys process and save the results
print("Encryption Keys process completed.")
else:
print("Invalid directory path.")
def handle_sort_by_cookies(self, event):
# Ask the user what they would like to do
choice = input("What would you like to do?\n 1. Search Cookies by Domain\n2. Search Cookies by Values\nEnter your choice: ")
if choice == "1":
self.search_cookies_by_domain()
elif choice == "2":
self.search_cookies_by_values()
else:
print("Invalid choice.")
def extract_md5(self):
"""Extract MD5 hashes from the input_text widget."""
try:
input_text = self.findChild(QTextEdit, "input_text") # Replace "input_text" with the actual object name
output_text = self.findChild(QTextEdit, "output_text") # Replace "output_text" with the actual object name
if input_text is not None and output_text is not None:
lines = input_text.toPlainText().split("\n")
md5_regex = re.compile(r"\b[A-Fa-f0-9]{32}\b")
extracted_md5 = [match.group() for line in lines for match in md5_regex.finditer(line)]
output_text.clear()
output_text.setPlainText("\n".join(extracted_md5))
except Exception as e:
print(f"An error occurred: {e}")
# Implement the remaining functions in the same way
def handle_newtextdocuments(console_widget, directory_path):
try:
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/New Text Documents/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the New Text Documents process and save the results in the specified directory
# Add your code here to perform the New Text Documents process and save the results
for root, dirs, files in os.walk(directory_path):
for file in files:
if file == "New Text Document.txt":
# Display the directory path in the console_widget in green
console_widget.appendPlainText("\033[92m" + root)
else:
# Display the directory path in the console_widget
console_widget.appendPlainText(root)
else:
print("Invalid directory path.")
except Exception as e:
error_message = "An error occurred: " + str(e)
console_widget.appendPlainText(error_message)
def handle_chrome_extensions():
directory_path = self.Directory_Path_Text_Element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Chrome Extensions/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the Chrome Extensions process and save the results in the specified directory
# Add your code here to perform the Chrome Extensions process and save the results
print("Chrome Extensions process completed.")
else:
print("Invalid directory path.")
def handle_scrape_backup_codes():
directory_path = self.Directory_Path_Text_Element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Scrape Backup Codes/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the Scrape Backup Codes process and save the results in the specified directory
# Add your code here to perform the Scrape Backup Codes process and save the results
print("Scrape Backup Codes process completed.")
else:
print("Invalid directory path.")
def handle_text_named_sorting():
directory_path = self.Directory_Path_Text_Element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Text Named Sorting/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the Text Named Sorting process and save the results in the specified directory
# Add your code here to perform the Text Named Sorting process and save the results
print("Text Named Sorting process completed.")
else:
print("Invalid directory path.")
def handle_pgp():
directory_path = self.Directory_Path_Text_Element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/PGP/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the PGP process and save the results in the specified directory
# Add your code here to perform the PGP process and save the results
print("PGP process completed.")
else:
print("Invalid directory path.")
def handle_encryption_keys():
directory_path = self.Directory_Path_Text_Element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Encryption Keys/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the Encryption Keys process and save the results in the specified directory
# Add your code here to perform the Encryption Keys process and save the results
print("Encryption Keys process completed.")
else:
print("Invalid directory path.")
def handle_discord_files():
directory_path = self.Directory_Path_Text_Element.toPlainText()
if directory_path:
# Create a new folder to save the results
now = datetime.now()
timestamp = now.strftime("%Y%m%d%H%M%S")
new_folder_name = f"Diamond Sorter Results/Discord Files/{timestamp}"
save_directory = os.path.join(directory_path, new_folder_name)
os.makedirs(save_directory)
# Perform the Discord Files process and save the results in the specified directory
# Add your code here to perform the Discord Files process and save the results
print("Discord Files process completed.")
else:
print("Invalid directory path.")
def handle_file_count_finished(self, count):
message = f"Found {count} occurrences of 'New Text Document.txt'"
self.console_widget.appendPlainText(message + '\n')
self.lcdNumber_4.display(count)
# Start the timer to update the value of lcdNumber_4 every 5 seconds
self.timer.start(5000)
def launch_domain_manager(self):
subprocess.Popen(["python", "domain_sorter.py"])
def replace_with_listButton():
repeating_string = input("Enter the repeating string or value: ")
lines = input("Copy and paste the list of lines: ").splitlines()
for line in lines:
replaced_line = line.replace(repeating_string, line)
print(replaced_line)