Exemplo n.º 1
0
    def module_2(self):
        with open(Utilities().openfile(), 'r', errors="ignore") as file:
            total_lines = Utilities().rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            lines = sorted(file.readlines(), key=len, reverse=True)

        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        with open(Utilities().savelocation("Combo Sorter") + "/" +
                  Utilities().files("ComboSorter") +
                  Utilities().currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(lines)
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 2
0
 def module_1(self):
     with open(Utilities().openfile(), 'r', errors="ignore") as file:
         lines = file.readlines()
         total_lines = Utilities().rawbigcount(file.name)
         start = time.time()
         print(self.utilities.custom_color() + "Loaded {} ".format(
             os.path.basename(file.name)).center(self.width))
         print(self.utilities.custom_color() +
               "File contains {:,} lines.".rstrip().format(
                   total_lines).center(self.width) + Style.RESET_ALL)
         output = Utilities().savelocation(
             "Randomize Lines") + "/" + Utilities().files("Randomizelines")
         amount = input(self.utilities.custom_color() +
                        "[?] How many times would you like to randomize?: ".
                        center(self.width).split(":")[0] + ": ")
         for _ in range(int(amount)):
             random.shuffle(lines)
             print(f"[+] Randomized {_} times.".center(self.width),
                   end="\r")
         print(self.utilities.custom_color() +
               "[+] Time took: {}".center(self.width -
                                          7).format(time.time() -
                                                    start).split('.')[0] +
               " seconds")
         with open(output + Utilities().currenttime() + ".txt",
                   "a",
                   errors="ignore") as output:
             output.writelines(lines)
         self.utilities.pleasewait()
         self.startup()
Exemplo n.º 3
0
    def module_6(self):
        with open(Utilities().openfile(), 'r', errors="ignore") as file:
            total_lines = Utilities().rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            email = input(
                self.utilities.custom_color() +
                "[?] What email would you like to add? [Domain [Example: gmail.com]/Random]"
                .center(self.width).split("Random]")[0] + 'Random]: ').lower()
            with open("Settings/Email Providers.json") as json_file:
                emails = json.load(json_file)
            for lines in Utilities().progressbar(file, total_lines):
                if email == "random":
                    slines = lines.split(":")
                    username = slines[0]
                    self.to_write.append(username + "@" +
                                         random.choice(emails) + ":" +
                                         slines[1])
                else:
                    slines = lines.split(":")
                    username = slines[0]
                    self.to_write.append(username + "@" + email + ":" +
                                         slines[1])
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        output = Utilities().savelocation(
            "Combo Sorter") + '/' + Utilities().files("ComboSorter")
        with open(output + Utilities().currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 4
0
    def module_5(self):
        with open(Utilities().openfile(), 'r', errors="ignore") as file:
            total_lines = Utilities().rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            pick = input(
                "[?] Do you want to add a prefix or a suffix? - [prefix/suffix]: "
                .center(self.width).split(':')[0] + ': ')
            prefixorsuffix = input("[?] What would you like to add?: ".center(
                self.width).split(":")[0] + ': ')
            done = []
            for lines in Utilities().progressbar(file, total_lines):
                if pick == "prefix":
                    done.append(prefixorsuffix + f"{lines}")
                else:
                    done = ([
                        "".join([x.strip(), prefixorsuffix, "\n"])
                        for x in file.readlines()
                    ])
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        output = Utilities().savelocation(
            "Combo Sorter") + '/' + Utilities().files("ComboSorter")
        with open(output + Utilities().currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(done)
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 5
0
    def module_4(self):
        with open(Utilities().openfile(), 'r', errors="ignore") as file:
            pick = input(
                self.utilities.custom_color() +
                "[?] Do you want to add or remove commas? - [add/remove]: ".
                center(self.width).split(':')[0] + ': ')
            total_lines = Utilities().rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            for lines in Utilities().progressbar(file, total_lines):
                if pick == "remove":
                    lines = re.sub('(,)[^,]*$', "\r", lines.rstrip())
                    self.to_write.append(lines)
                else:
                    lines = lines.rstrip()
                    result = "".join(lines) + ",\n"
                    self.to_write.append(result)
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        with open(Utilities().savelocation("Combo Sorter") + '/' +
                  Utilities().files("ComboSorter") +
                  Utilities().currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 6
0
 def __init__(self):
     self.to_write = []
     self.utilities = Utilities()
     self.width = shutil.get_terminal_size().columns
     self.total_lines = None
Exemplo n.º 7
0
class EmailToUsername():
    def __init__(self):
        self.to_write = []
        self.utilities = Utilities()
        self.width = shutil.get_terminal_size().columns
        self.total_lines = None

    def startup(self):
        self.utilities.clear()
        self.to_write.clear()
        self.module_1()

    def module_1(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            output = self.utilities.savelocation(
                "Email To Username") + "/" + self.utilities.files(
                    "EmailToUsername")

            for line in file:
                lines = line.split(":")
                self.to_write.append(lines[0].split("@")[0] + ":" + lines[1])

        print(self.utilities.custom_color() +
              "[+] lines Converted: %s".rstrip().center(self.width) %
              total_lines)
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        with open(output + self.utilities.currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 8
0
class LineCounter():
    def __init__(self):
        self.to_write = []
        self.utilities = Utilities()
        self.width = shutil.get_terminal_size().columns
        self.total_lines = None

    def startup(self):
        self.to_write.clear()
        self.utilities.clear()
        print(self.utilities.custom_color() + "[1]" + Fore.LIGHTWHITE_EX +
              " | Count all lines")
        print(self.utilities.custom_color() + "[2]" + Fore.LIGHTWHITE_EX +
              " | Count all lines containing a certain string")
        print(self.utilities.custom_color() +
              "\nPress enter to go back to the main menu.")
        try:
            select = input("\n" + self.utilities.custom_color() +
                           "[?] Select the module you'd like to use: " +
                           Fore.LIGHTWHITE_EX)

            self.modules = {"1": "self.module_1()", "2": "self.module_2()"}
            if select in self.modules:
                eval(self.modules[select])

        except Exception as e:
            print(e)
            self.utilities.pleasewait()
            self.startup()

    def module_1(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        self.utilities.pleasewait()
        self.startup()

    def module_2(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            word = input(self.utilities.custom_color() +
                         "Input the word to search for: ".center(
                             self.width).split(':')[0] + ': ' +
                         Fore.LIGHTWHITE_EX)
            for lines in file:
                if word not in lines:
                    pass
                else:
                    self.to_write.append(lines)
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        output = self.utilities.savelocation(
            "Line Counter") + "/" + self.utilities.files(
                "linesCounter") + "[{}]".format(word)
        with open(output + self.utilities.currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()
class DuplicateRemover():
    def __init__(self):
        self.to_write = []
        self.utilities = Utilities()
        self.width = shutil.get_terminal_size().columns
        self.total_lines = None

    def startup(self):
        self.to_write.clear()
        self.utilities.clear()
        self.module_1()

    def module_1(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)
            uniquelines = set(file.readlines())

        if not len(uniquelines) == total_lines:
            output = self.utilities.savelocation(
                "Duplicate Remover") + "/" + self.utilities.files(
                    "DuplicateRemover")
            with open(output + self.utilities.currenttime() + '.txt',
                      'w',
                      errors="ignore") as outfile:
                outfile.writelines(uniquelines)
            print("[+] Duplicates Removed: %s".center(self.width) %
                  str(len(uniquelines) - total_lines))
        else:
            print("[-] No duplicates found".center(self.width))
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 10
0
class ComboParser():

    def __init__(self):
        self.to_write = []
        self.utilities = Utilities()
        self.width = shutil.get_terminal_size().columns
        self.total_lines = None

    def startup(self):
        self.utilities.clear()
        self.to_write.clear()
        print(self.utilities.custom_color() + "[1]" + Fore.LIGHTWHITE_EX + " | Password:Email/Username -> Email/Username:Password [Works for reversing email:password too]")
        print(self.utilities.custom_color() + "[2]" + Fore.LIGHTWHITE_EX + " | Username/email:Password:Email/username -> 2 files [user:pass, email:pass]")
        print(self.utilities.custom_color() + "[3]" + Fore.LIGHTWHITE_EX + " | Email Extractor")
        print(self.utilities.custom_color() + "\nPress enter to go back to the main menu.")
        try:
            select = input("\n" + self.utilities.custom_color() + "[?] Select the module you'd like to use: " + Fore.LIGHTWHITE_EX)

            self.modules = {
                "1": "self.module_1()",
                "2": "self.module_2()",
                "3": "self.module_3()"
            }
            if select in self.modules:
                eval(self.modules[select])
        except Exception:
            self.utilities.pleasewait()
            self.startup()


    def module_1(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines).center(self.width) + Style.RESET_ALL)

            for lines in self.utilities.progressbar(file, total_lines):
                tmp = lines.split(":")
                self.to_write.append(tmp[0].rstrip() + ':' + tmp[1].rstrip() + '\n')
        if len(self.to_write) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Parser") + '/' + self.utilities.files("ComboParser") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(self.to_write)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()

    def module_2(self):
        dest = []
        dest2 = []
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines).center(self.width) + Style.RESET_ALL)

            for lines in self.utilities.progressbar(file, total_lines):
                eachlines = lines.split()
                dest.append(eachlines[2] + ":" + eachlines[1] + "\n")
                dest2.append(eachlines[0] + ":" + eachlines[1] + "\n")
        if len(dest) >= 1 and len(dest2) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Parser") + '/' + self.utilities.files("ComboParser1") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(dest)
            with open(self.utilities.savelocation("Combo Parser") + '/' + self.utilities.files("ComboParser2") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile2:
                outfile2.writelines(dest2)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()
    
    def module_3(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines).center(self.width) + Style.RESET_ALL)

            for lines in self.utilities.progressbar(file, total_lines):
                match = re.search(r"""(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])""", lines)
                if match:
                    self.to_write.append(match.group(0) + "\n")

        if len(self.to_write) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Parser") + '/' + self.utilities.files("ComboParser") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(self.to_write)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 11
0
class EmptyLineRemover():

    def __init__(self):
        self.to_write = []
        self.utilities = Utilities()
        self.width = shutil.get_terminal_size().columns
        self.total_lines = None

    def startup(self):
        self.utilities.clear()
        self.to_write.clear()
        self.module_1()

    def module_1(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".format(total_lines).rstrip().center(self.width) + Style.RESET_ALL)

            cleaned = list(filter(lambda x: not re.match(r'^\s*$', x), file.readlines()))
            print(self.utilities.custom_color() + "[+] Time took: {}".rstrip().center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            if len(cleaned) >= 1 and len(cleaned) < total_lines:
                output = self.utilities.savelocation("Empty Line Remover") + "/" + self.utilities.files("EmptylinesRemover")
                with open(output + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                    outfile.writelines(cleaned)
                print(self.utilities.custom_color() + "[+] Empty Lines Removed: %s".rstrip().center(self.width) % str(int(total_lines) - int(len(cleaned))))
            else:
                print(self.utilities.custom_color() + "No invalid lines were found.".rstrip().center(self.width))
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 12
0
class PasswordFilterer():
    
    def __init__(self):
        self.to_write = []
        self.utilities = Utilities()
        self.width = shutil.get_terminal_size().columns
        self.total_lines = None

    def startup(self):
        self.to_write.clear()
        self.utilities.clear()
        print(self.utilities.custom_color() + "[1]" + Fore.LIGHTWHITE_EX + " | Remove all passwords that don't contain at least 1 uppercase letter.")
        print(self.utilities.custom_color() + "[2]" + Fore.LIGHTWHITE_EX + " | Remove all passwords that don't contain at least 1 number.")
        print(self.utilities.custom_color() + "[3]" + Fore.LIGHTWHITE_EX + " | Remove all passwords that don't contain at least 1 symbol.")
        print(self.utilities.custom_color() + "[4]" + Fore.LIGHTWHITE_EX + " | Remove all passwords that don't contain at least 1 uppercase and 1 symbol.")
        print(self.utilities.custom_color() + "[5]" + Fore.LIGHTWHITE_EX + " | Remove all passwords that don't contain at least 1 number and 1 uppercase.")
        print(self.utilities.custom_color() + "[6]" + Fore.LIGHTWHITE_EX + " | Remove all passwords that don't contain at least 1 number, 1 uppercase and is shorter than x amount of characters.")
        print(self.utilities.custom_color() + "[7]" + Fore.LIGHTWHITE_EX + " | Remove all passwords shorter or longer than x amount of characters.")
        print(self.utilities.custom_color() + "[8]" + Fore.LIGHTWHITE_EX + " | Custom Presets")

        print(self.utilities.custom_color() + "\nPress enter to go back to the main menu.")
        try:
            select = input("\n" + self.utilities.custom_color() + "[?] Select the module you'd like to use: " + Fore.LIGHTWHITE_EX).lower()

            self.modules = {
                "1": "self.module_1()",
                "2": "self.module_2()",
                "3": "self.module_3()",
                "4": "self.module_4()",
                "5": "self.module_5()",
                "6": "self.module_6()",
                "7": "self.module_7()",
                "8": "self.custom_presets()"
            }

            if select.lower() in self.modules:
                eval(self.modules[select])
        
        except Exception as e:
            print(e)
            self.utilities.pleasewait()
            self.startup()


    def module_1(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            for lines in self.utilities.progressbar(file, total_lines):
                try:
                    line = lines.split(':')[1]
                    reg = re.search(r".*[A-Z]+.*", line)
                    if reg:
                        self.to_write.append(lines)
                        pass
                    else:
                        pass
                except IndexError:
                    continue
        print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
        with open(self.utilities.savelocation('Password Filterer') + '/' + self.utilities.files("PasswordFilterer") + self.utilities.currenttime() + '.txt', 'w') as output:
            output.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()

    def module_2(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            for lines in self.utilities.progressbar(file, total_lines):
                try:
                    line = lines.split(':')[1]
                    reg = re.search(r".*[0-9]+.*", line)
                    if reg:
                        self.to_write.append(lines)
                    else:
                        pass
                except IndexError:
                    continue
        print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
        with open(self.utilities.savelocation('Password Filterer') + '/' + self.utilities.files("PasswordFilterer") + self.utilities.currenttime() + '.txt', 'w') as output:
            output.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()

    def module_3(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            for lines in self.utilities.progressbar(file, total_lines):
                try:
                    line = lines.split(':')[1]
                    reg = re.search(r".*[\\!$%^&*()_+|~\-=`{}[\]:\";'<>?,./@#]+.*", line)
                    if reg:
                        self.to_write.append(lines)
                    else:
                        pass
                except IndexError:
                    continue
        print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
        with open(self.utilities.savelocation('Password Filterer') + '/' + self.utilities.files("PasswordFilterer") + self.utilities.currenttime() + '.txt', 'w') as output:
            output.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()

    def module_4(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            for lines in self.utilities.progressbar(file, total_lines):
                try:
                    line = lines.split(':')[1]
                    reg = re.search(r"((.*[A-Z]+).*([\\!$%^&*()_+|~\-=`{}[\]:\";'<>?,./@#]+.*))", line)
                    if reg:
                        self.to_write.append(lines)
                    else:
                        pass
                except IndexError:
                    continue
        print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
        with open(self.utilities.savelocation('Password Filterer') + '/' + self.utilities.files("PasswordFilterer") + self.utilities.currenttime() + '.txt', 'w') as output:
            output.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()

    def module_5(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            for lines in self.utilities.progressbar(file, total_lines):
                try:
                    line = lines.split(':')[1]
                    reg = re.search(r"((.*[A-Z]+).*([0-9]+.*))", line)
                    if reg:
                        self.to_write.append(lines)
                    else:
                        pass
                except IndexError:
                    continue
        print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
        with open(self.utilities.savelocation('Password Filterer') + '/' + self.utilities.files("PasswordFilterer") + self.utilities.currenttime() + '.txt', 'w') as output:
            output.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()

    def module_6(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            amount = int(input("[?] How long should the password minimum be?: "))
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            for lines in self.utilities.progressbar(file, total_lines):
                try:
                    line = lines.split(':')[1]
                    if len(line) >= amount:
                        reg = re.search(r"((.*[A-Z]+).*([0-9]+.*))", line)
                        if reg:
                            self.to_write.append(lines)
                        else:
                            pass
                    else:
                        pass
                except IndexError:
                    continue
        print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
        with open(self.utilities.savelocation('Password Filterer') + '/' + self.utilities.files("PasswordFilterer") + self.utilities.currenttime() + '.txt', 'w') as output:
            output.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()

    def module_7(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            lonorsho = input(self.utilities.custom_color() + "[?] Would you like to remove passwords longer or shorter than x?: [Shorter/Longer] ".center(self.width).split("r] ")[0] + "r] ").lower()
            amount = int(input(self.utilities.custom_color() + "[?] How long should the password minimum be?: ".center(self.width).split("?: ")[0] + "?: " + Fore.LIGHTWHITE_EX))
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            for lines in self.utilities.progressbar(file, total_lines):
                try:
                    if lonorsho == "longer":
                        line = lines.split(':')[1]
                        if len(line) >= amount:
                            self.to_write.append(lines)
                        else:
                            pass
                    else:
                        line = lines.split(":")[1]
                        if len(line) <= amount:
                            self.to_write.append(lines)
                        else:
                            pass
                except IndexError:
                    continue
        print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
        with open(self.utilities.savelocation('Password Filterer') + '/' + self.utilities.files("PasswordFilterer") + self.utilities.currenttime() + '.txt', 'w') as output:
            output.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()
        
    def custom_presets(self):
        with open("Settings/Password Filterer Presets.json", "r") as file:
            file = json.load(file)
            for preset in file:
                print(preset)
            preset_selection = input(self.utilities.custom_color() + "\n[?] Select the preset you would like to use: " + Fore.LIGHTWHITE_EX)
            regex = file[preset_selection]['Regex']
            with open(self.utilities.openfile(), 'r', errors='ignore') as f:
                total_lines = self.utilities.rawbigcount(f.name)
                print(self.utilities.custom_color() + f"Loaded {os.path.basename(f.name)}".rstrip().center(self.width))
                print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines).center(self.width) + Style.RESET_ALL)
                for lines in self.utilities.progressbar(f, total_lines):
                    
                    if file[preset_selection]['Type'].lower() in ("pass", "password", "passw"):
                        line = lines.split(':')[1]
                    elif file[preset_selection]['Type'].lower() in ("email", "emailaddress"):
                        line = lines.split(":")[0]
                    elif file[preset_selection]['Type'].lower() == "line":
                        line = lines
                    
                    reg = re.search(regex, line)
                    if reg:
                        if file[preset_selection]['Group'].lower() != "none":
                            try:
                                reg_g = reg.group(file[preset_selection]['Group'])
                                self.to_write.append(reg_g)
                            except Exception:
                                continue
                        else:
                            self.to_write.append(lines)
                    else:
                        pass
        output = self.utilities.savelocation('Password Filterer') + "/" + self.utilities.files('PasswordFilterer')
        with open(output + f" [{preset_selection}] " + self.utilities.currenttime() + '.txt', 'a', errors="ignore") as output_files:
            output_files.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 13
0
class ComboSorter():
    def __init__(self):
        self.to_write = []
        self.utilities = Utilities()
        self.width = shutil.get_terminal_size().columns
        self.total_lines = None

    def startup(self):
        self.to_write.clear()
        self.utilities.clear()
        print(self.utilities.custom_color() + "[1]" + Fore.LIGHTWHITE_EX +
              " | Sort by lines length")
        print(self.utilities.custom_color() + "[2]" + Fore.LIGHTWHITE_EX +
              " | Sort by lines length [Reversed, longest first]")
        print(self.utilities.custom_color() + "[3]" + Fore.LIGHTWHITE_EX +
              " | Sort alphabetically ")
        print(self.utilities.custom_color() + "[4]" + Fore.LIGHTWHITE_EX +
              " | Comma adder + remover")
        print(self.utilities.custom_color() + "[5]" + Fore.LIGHTWHITE_EX +
              " | Add prefix or suffix")
        print(self.utilities.custom_color() + "[6]" + Fore.LIGHTWHITE_EX +
              " | Add domains to user:pass combos")
        print(self.utilities.custom_color() +
              "\nPress enter to go back to the main menu.")
        try:
            select = input("\n" + self.utilities.custom_color() +
                           "[?] Select the module you'd like to use: " +
                           Fore.LIGHTWHITE_EX)

            self.modules = {
                "1": "self.module_1()",
                "2": "self.module_2()",
                "3": "self.module_3()",
                "4": "self.module_4()",
                "5": "self.module_5()",
                "6": "self.module_6()"
            }

            if select in self.modules:
                eval(self.modules[select])

        except Exception as e:
            print(e)
            self.utilities.pleasewait()
            self.startup()

    def module_1(self):
        with open(Utilities().openfile(), 'r', errors="ignore") as file:
            total_lines = Utilities().rawbigcount(file.name)
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)
            start = time.time()
            lines = sorted(file.readlines(), key=len)
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        with open(Utilities().savelocation("Combo Sorter") + '/' +
                  Utilities().files("ComboSorter") +
                  Utilities().currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(lines)
        self.utilities.pleasewait()
        self.startup()

    def module_2(self):
        with open(Utilities().openfile(), 'r', errors="ignore") as file:
            total_lines = Utilities().rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            lines = sorted(file.readlines(), key=len, reverse=True)

        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        with open(Utilities().savelocation("Combo Sorter") + "/" +
                  Utilities().files("ComboSorter") +
                  Utilities().currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(lines)
        self.utilities.pleasewait()
        self.startup()

    def module_3(self):
        with open(Utilities().openfile(), 'r', errors="ignore") as file:
            total_lines = Utilities().rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)
            lines = sorted(file.readlines())
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        with open(Utilities().savelocation("Combo Sorter") + '/' +
                  Utilities().files("ComboSorter") +
                  Utilities().currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(lines)
        self.utilities.pleasewait()
        self.startup()

    def module_4(self):
        with open(Utilities().openfile(), 'r', errors="ignore") as file:
            pick = input(
                self.utilities.custom_color() +
                "[?] Do you want to add or remove commas? - [add/remove]: ".
                center(self.width).split(':')[0] + ': ')
            total_lines = Utilities().rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            for lines in Utilities().progressbar(file, total_lines):
                if pick == "remove":
                    lines = re.sub('(,)[^,]*$', "\r", lines.rstrip())
                    self.to_write.append(lines)
                else:
                    lines = lines.rstrip()
                    result = "".join(lines) + ",\n"
                    self.to_write.append(result)
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        with open(Utilities().savelocation("Combo Sorter") + '/' +
                  Utilities().files("ComboSorter") +
                  Utilities().currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()

    def module_5(self):
        with open(Utilities().openfile(), 'r', errors="ignore") as file:
            total_lines = Utilities().rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            pick = input(
                "[?] Do you want to add a prefix or a suffix? - [prefix/suffix]: "
                .center(self.width).split(':')[0] + ': ')
            prefixorsuffix = input("[?] What would you like to add?: ".center(
                self.width).split(":")[0] + ': ')
            done = []
            for lines in Utilities().progressbar(file, total_lines):
                if pick == "prefix":
                    done.append(prefixorsuffix + f"{lines}")
                else:
                    done = ([
                        "".join([x.strip(), prefixorsuffix, "\n"])
                        for x in file.readlines()
                    ])
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        output = Utilities().savelocation(
            "Combo Sorter") + '/' + Utilities().files("ComboSorter")
        with open(output + Utilities().currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(done)
        self.utilities.pleasewait()
        self.startup()

    def module_6(self):
        with open(Utilities().openfile(), 'r', errors="ignore") as file:
            total_lines = Utilities().rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            email = input(
                self.utilities.custom_color() +
                "[?] What email would you like to add? [Domain [Example: gmail.com]/Random]"
                .center(self.width).split("Random]")[0] + 'Random]: ').lower()
            with open("Settings/Email Providers.json") as json_file:
                emails = json.load(json_file)
            for lines in Utilities().progressbar(file, total_lines):
                if email == "random":
                    slines = lines.split(":")
                    username = slines[0]
                    self.to_write.append(username + "@" +
                                         random.choice(emails) + ":" +
                                         slines[1])
                else:
                    slines = lines.split(":")
                    username = slines[0]
                    self.to_write.append(username + "@" + email + ":" +
                                         slines[1])
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        output = Utilities().savelocation(
            "Combo Sorter") + '/' + Utilities().files("ComboSorter")
        with open(output + Utilities().currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 14
0
class RandomUtilities():
    def __init__(self):
        self.to_write = []
        self.utilities = Utilities()
        self.width = shutil.get_terminal_size().columns
        self.total_lines = None

    def startup(self):
        self.to_write.clear()
        self.utilities.clear()
        print(self.utilities.custom_color() + "[1]" + Fore.LIGHTWHITE_EX +
              " | Random string generator")
        print(self.utilities.custom_color() + "[2]" + Fore.LIGHTWHITE_EX +
              " | Number generator")
        print(self.utilities.custom_color() + "[3]" + Fore.LIGHTWHITE_EX +
              " | Line break remover")
        print(self.utilities.custom_color() + "[4]" + Fore.LIGHTWHITE_EX +
              " | Line break adder")
        print(self.utilities.custom_color() +
              "\nPress enter to go back to the main menu.")
        try:
            select = input("\n" + self.utilities.custom_color() +
                           "[?] Select the module you'd like to use: " +
                           Fore.LIGHTWHITE_EX)

            self.modules = {
                "1": "self.module_1()",
                "2": "self.module_2()",
                "3": "self.module_3()",
                "4": "self.module_4()"
            }

            if select in self.modules:
                eval(self.modules[select])

        except Exception as e:
            print(e)
            self.utilities.pleasewait()
            self.startup()

    def module_1(self):
        print(
            "[*] Generating over 25 keys will automatically get saved instead of getting printed."
        )
        amount = int(
            input(self.utilities.custom_color() +
                  "[?] How many would you like to generate?: "))
        length = int(
            input(self.utilities.custom_color() +
                  "[?] How long should the string be?: "))
        if amount >= 25:
            output = self.utilities.savelocation(
                "Random Utilities") + "/" + self.utilities.files(
                    "RandomUtilities")
            with open(output + self.utilities.currenttime() + '[String].txt',
                      'w') as outfile:
                start = time.time()
                for _ in range(amount)[::-1]:
                    self.to_write.append(''.join(
                        random.SystemRandom().choice(string.ascii_uppercase +
                                                     string.ascii_lowercase +
                                                     string.digits)
                        for _ in range(length)) + '\n')
                print(self.utilities.custom_color() +
                      "[+] Time took: {}".center(self.width - 7).format(
                          time.time() - start).split('.')[0] + " seconds")
                outfile.writelines(self.to_write)
        else:
            start = time.time()
            for _ in range(amount)[::-1]:
                print(Style.RESET_ALL + ''.join(
                    random.SystemRandom().choice(string.ascii_uppercase +
                                                 string.ascii_lowercase +
                                                 string.digits)
                    for _ in range(length)))
        self.utilities.pleasewait()
        self.startup()

    def module_2(self):
        output = self.utilities.savelocation(
            "Random Utilities") + "/" + self.utilities.files("RandomUtilities")
        amount = int(
            input(self.utilities.custom_color() +
                  "[?] Input how many numbers to generate: ".center(
                      self.width).split(":")[0] + ":"))
        start = time.time()
        for i in range(amount + 1):
            self.to_write.append(i)
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        with open(output + self.utilities.currenttime() + '.txt',
                  'w',
                  errors="ignore") as outfile:
            outfile.writelines(str((x)) + '\n' for x in self.to_write)
        self.utilities.pleasewait()
        self.startup()

    def module_3(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as inputf:
            start = time.time()
            for lines in inputf:
                self.to_write.append(lines.replace("\n", " "))
        output = self.utilities.savelocation(
            "Random Utilities") + "/" + self.utilities.files("RandomUtilities")
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        with open(output + self.utilities.currenttime() + '.txt',
                  'w') as outfile:
            outfile.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()

    def module_4(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as inputf:
            start = time.time()
            delimiter = input(
                self.utilities.custom_color() +
                "[?] What delimiter should I split at to add the lines break?: "
            )
            for lines in inputf:
                try:
                    lines = lines.split(str(delimiter))
                    a = lines[0]
                    b = lines[1]
                    outputs = a + '\n' + delimiter + b
                    self.to_write.append(outputs)
                except IndexError:
                    print(f"Unable to split at given delimiter: '{delimiter}'")
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        output = self.utilities.savelocation(
            "Random Utilities") + "/" + self.utilities.files("RandomUtilities")
        with open(output + self.utilities.currenttime() + '.txt',
                  'w') as outfile:
            outfile.writelines(self.to_write)
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 15
0
class ComboCleaner():
    
    def __init__(self):
        self.to_write = []
        self.utilities = Utilities()
        self.width = shutil.get_terminal_size().columns
        self.total_lines = None
    
    def startup(self):
        self.utilities.clear()
        self.to_write.clear()
        print(self.utilities.custom_color() + "[1]" + Fore.LIGHTWHITE_EX + " | Replace all ;'s with :'s")
        print(self.utilities.custom_color() + "[2]" + Fore.LIGHTWHITE_EX + " | Remove all lines containing '{' or '}'")
        print(self.utilities.custom_color() + "[3]" + Fore.LIGHTWHITE_EX + " | Remove all lines not containing ':' or ';'")
        print(self.utilities.custom_color() + "[4]" + Fore.LIGHTWHITE_EX + " | Remove all lines not containing '@'")
        print(self.utilities.custom_color() + "[5]" + Fore.LIGHTWHITE_EX + " | Remove all lines containing '@'")
        print(self.utilities.custom_color() + "[6]" + Fore.LIGHTWHITE_EX + " | Remove all of the above (Except option 5)")
        print(self.utilities.custom_color() + "[7]" + Fore.LIGHTWHITE_EX + " | Remove all lines containing a certain string")
        print(self.utilities.custom_color() + "[8]" + Fore.LIGHTWHITE_EX + " | Invalid combo remover [[email protected]: ] or [ :example]")
        print(self.utilities.custom_color() + "[9]" + Fore.LIGHTWHITE_EX + " | Remove all lines longer than or shorter than x")
        print(self.utilities.custom_color() + "\nPress enter to go back to the main menu.")
        try:
            select = input("\n" + self.utilities.custom_color() + "[?] Select the module you'd like to use: " + Fore.LIGHTWHITE_EX)
            
            self.modules = {
                "1": "self.module_1()",
                "2": "self.module_2()",
                "3": "self.module_3()",
                "4": "self.module_4()",
                "5": "self.module_5()",
                "6": "self.module_6()",
                "7": "self.module_7()",
                "8": "self.module_8()",
                "9": "self.module_9()"
            }
            if select in self.modules:
                eval(self.modules[select])
        
        except Exception as e:
            print(e)
            self.utilities.pleasewait()
            self.startup()

    
    def module_1(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            self.total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(self.total_lines).center(self.width) + Style.RESET_ALL)

            for lines in self.utilities.progressbar(file, self.total_lines):
                if ';' in lines:
                    line = lines.replace(";", ":")
                    self.to_write.append(line)
                else:
                    self.to_write.append(lines)
        if len(self.to_write) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Cleaner") + "/" + self.utilities.files("ComboCleaner") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(self.to_write)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()

    def module_2(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines).center(self.width) + Style.RESET_ALL)

            for lines in self.utilities.progressbar(file, total_lines):
                if "{" in lines or "}" in lines:
                    pass
                else:
                    self.to_write.append(lines)
        if len(self.to_write) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Cleaner") + "/" + self.utilities.files("ComboCleaner") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(self.to_write)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()

    def module_3(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines).center(self.width) + Style.RESET_ALL)

            for lines in self.utilities.progressbar(file, total_lines):
                if ":" in lines or ";" in lines:
                    self.to_write.append(lines)
                else:
                    pass
        if len(self.to_write) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Cleaner") + "/" + self.utilities.files("ComboCleaner") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(self.to_write)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()

    def module_4(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines).center(self.width) + Style.RESET_ALL)
            for lines in self.utilities.progressbar(file, total_lines):
                if "@" not in lines:
                    pass
                else:
                    self.to_write.append(lines)
        if len(self.to_write) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Cleaner") + "/" + self.utilities.files("ComboCleaner") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(self.to_write)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()

    def module_5(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines).center(self.width) + Style.RESET_ALL)
            for lines in self.utilities.progressbar(file, total_lines):
                if "@" not in lines:
                    self.to_write.append(lines)
                else:
                    pass
        if len(self.to_write) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Cleaner") + "/" + self.utilities.files("ComboCleaner") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(self.to_write)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()

    def module_6(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines+1).center(self.width) + Style.RESET_ALL)
            for lines in self.utilities.progressbar(file, total_lines):
                if "{" in lines or "}" in lines or "@" not in lines:
                    pass
                else:
                    if ";" in lines:
                        line = lines.replace(';', ':')
                        self.to_write.append(line)
                    else:
                        if ":" not in lines:
                            pass
                        else:
                            self.to_write.append(lines)

        if len(self.to_write) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Cleaner") + "/" + self.utilities.files("ComboCleaner") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(self.to_write)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()

    def module_7(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines).center(self.width) + Style.RESET_ALL)

            word = input(self.utilities.custom_color() + "[?] Input the word to search for: ".center(self.width).split(':')[0] + ': ' + Fore.LIGHTWHITE_EX)
            for lines in self.utilities.progressbar(file, total_lines):
                if word in lines:
                    pass
                else:
                    self.to_write.append(lines)
        if len(self.to_write) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Cleaner") + "/" + self.utilities.files("ComboCleaner") + self.utilities.currenttime() + f'{[word]}.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(self.to_write)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()

    def module_8(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines).center(self.width) + Style.RESET_ALL)

            for lines in self.utilities.progressbar(file, total_lines):
                try:
                    line = lines.split(":")
                    if line[0] in ("\n", ""):
                        pass
                    elif line[1] in ("\n", ""):
                        pass
                    else:
                        self.to_write.append(lines)
                except Exception:
                    pass
        if len(self.to_write) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Cleaner") + "/" + self.utilities.files("ComboCleaner") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(self.to_write)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()

    def module_9(self):
        with open(self.utilities.openfile(), 'r', errors="ignore") as file:
            pick = input(self.utilities.custom_color() + "[?] Would you like to remove lines longer or shorter than x? | [longer/shorter]: ".center(self.width).split(':')[0] + ': ' + Fore.LIGHTWHITE_EX).lower()
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() + f"Loaded {os.path.basename(file.name)}".rstrip().center(self.width))
            print(self.utilities.custom_color() + "File contains {:,} lines.".rstrip().format(total_lines).center(self.width) + Style.RESET_ALL)

            if pick == "longer":
                longest = int(input(self.utilities.custom_color() + "[?] How long should the maximum be? ".center(self.width).split('? ')[0] + '? ' + Fore.LIGHTWHITE_EX))
                for lines in self.utilities.progressbar(file, total_lines):
                    if len(lines) > longest:
                        pass
                    else:
                        self.to_write.append(lines)

            elif pick == "shorter":
                shortest = int(input(self.utilities.custom_color() + "[?] How long should the shortest be? ".center(self.width).split('? ')[0] + '? ' + Fore.LIGHTWHITE_EX))
                for lines in self.utilities.progressbar(file, total_lines):
                    if len(lines) < shortest:
                        pass
                    else:
                        self.to_write.append(lines)
        if len(self.to_write) >= 1:
            print(self.utilities.custom_color() + "[+] Time took: {}".center(self.width - 7).format(time.time() - start).split('.')[0] + " seconds")
            with open(self.utilities.savelocation("Combo Cleaner") + "/" + self.utilities.files("ComboCleaner") + self.utilities.currenttime() + '.txt', 'w', errors="ignore") as outfile:
                outfile.writelines(self.to_write)
        else:
            print(self.utilities.custom_color() + "No invalid lines were found.".center(self.width))
        self.utilities.pleasewait()
        self.startup()
Exemplo n.º 16
0
class ComboSplitter():
    def __init__(self):
        self.to_write = []
        self.utilities = Utilities()
        self.width = shutil.get_terminal_size().columns
        self.total_lines = None

    def startup(self):
        self.to_write.clear()
        self.utilities.clear()
        print(self.utilities.custom_color() + "[1]" + Fore.LIGHTWHITE_EX +
              " | Split combos into multiple smaller combos")
        print(self.utilities.custom_color() + "[2]" + Fore.LIGHTWHITE_EX +
              " | Split combo into 2 files, user/email + password")
        print(
            self.utilities.custom_color() + "[3]" + Fore.LIGHTWHITE_EX +
            " | Split Email:pass into 3 files, emails, passwords and usernames"
        )
        print(self.utilities.custom_color() +
              "\nPress enter to go back to the main menu.")
        try:
            select = input("\n" + self.utilities.custom_color() +
                           "[?] Select the module you'd like to use: " +
                           Fore.LIGHTWHITE_EX)
            self.modules = {
                "1": "self.module_1()",
                "2": "self.module_2()",
                "3": "self.module_3()"
            }

            if select in self.modules:
                eval(self.modules[select])
        except Exception as e:
            print(e)
            self.utilities.pleasewait()
            self.startup()

    def module_1(self):
        splitlen = int(
            input(self.utilities.custom_color() +
                  "Input the amount of lines you'd like per file: ".center(
                      self.width).split(':')[0] + ": "))
        with open(self.utilities.openfile(), "r", errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print("File contains {} lines.".format(total_lines).center(
                self.width))
            print("Estimated amount of files: {}".format(
                total_lines / splitlen).split(".")[0].center(self.width) +
                  Style.RESET_ALL)
            at = 0
            count = 0
            output = self.utilities.savelocation(
                "Combo Splitter") + "/" + self.utilities.files("ComboSplitter")
            for lines in file:
                if count % splitlen == 0:
                    dest = open(output + " - " + str(at) + " - " +
                                self.utilities.currenttime() + ".txt",
                                "a",
                                errors="ignore")
                    at += 1
                dest.writelines(lines)
                count += 1

        dest.close()
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        self.utilities.pleasewait()
        self.startup()

    def module_2(self):
        to_write0 = []
        to_write1 = []

        with open(self.utilities.openfile(), "r", errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            output = self.utilities.savelocation(
                "Combo Splitter") + "/" + self.utilities.files(
                    "ComboSplitter2Email")
            output2 = self.utilities.savelocation(
                "Combo Splitter") + "/" + self.utilities.files(
                    "ComboSplitter2Password")

            for lines in file:
                try:
                    inputlines = lines.split(":")
                    to_write0.append("{}".format(inputlines[0]))
                    to_write1.append("{}\n".format(inputlines[1]))
                except Exception:
                    pass
        with open(output + self.utilities.currenttime() + ".txt",
                  "a",
                  errors="ignore") as file1:
            file1.writelines(to_write0)
        with open(output2 + self.utilities.currenttime() + ".txt",
                  "a",
                  errors="ignore") as file2:
            file2.writelines(to_write1)
        print(self.utilities.custom_color() +
              "[+] Time took: {}".center(self.width -
                                         7).format(time.time() -
                                                   start).split('.')[0] +
              " seconds")
        self.utilities.pleasewait()
        self.startup()

    def module_3(self):
        emails = []
        usernames = []
        passwords = []

        with open(self.utilities.openfile(), "r", errors="ignore") as file:
            total_lines = self.utilities.rawbigcount(file.name)
            start = time.time()
            print(self.utilities.custom_color() +
                  f"Loaded {os.path.basename(file.name)}".rstrip().center(
                      self.width))
            print(self.utilities.custom_color() +
                  "File contains {:,} lines.".rstrip().format(
                      total_lines).center(self.width) + Style.RESET_ALL)

            output = self.utilities.savelocation(
                "Combo Splitter") + "/" + self.utilities.files(
                    "ComboSplitter3Email")
            output2 = self.utilities.savelocation(
                "Combo Splitter") + "/" + self.utilities.files(
                    "ComboSplitter3Username")
            output3 = self.utilities.savelocation(
                "Combo Splitter") + "/" + self.utilities.files(
                    "ComboSplitter3Password")
            try:
                for lines in file:
                    emails.append(lines.split(":")[0] + '\n')
                    usernames.append(lines.split(":")[0].split('@')[0] + '\n')
                    passwords.append(lines.split(":")[1])
            except IndexError:
                pass
        with open(output + self.utilities.currenttime() + '.txt',
                  'a',
                  errors="ignore") as outfile1:
            outfile1.writelines(emails)
        with open(output2 + self.utilities.currenttime() + ".txt",
                  "a",
                  errors="ignore") as outfile2:
            outfile2.writelines(usernames)
        with open(output3 + self.utilities.currenttime() + ".txt",
                  "a",
                  errors="ignore") as outfile3:
            outfile3.writelines(passwords)
        print(self.utilities.custom_color() +
              "[+] Time took: {}".rstrip().center(self.width - 7).format(
                  time.time() - start).split('.')[0] + " seconds")
        self.utilities.pleasewait()
        self.startup()