Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



 763

Python script to get valid passwords from a combolist

by cergo - 19 November, 2022 - 05:47 PM
This post is by a banned member (cergo) - Unhide
cergo  
Registered
20
Posts
2
Threads
4 Years of service
#1
(This post was last modified: 19 November, 2022 - 06:06 PM by cergo. Edited 3 times in total.)
Description:
This is a simple python 3 script, that will read your combo list line by line then keep only the line with valid passwords and save it to an output file.
The valid passwords (usually) are the ones with:
  • At least 1 lowercase character
  • At least 1 uppercase character
  • At least 1 special character, i.e: #?!@$%^&*-
  • 8-25 characters in length
  • The passwords are on the right side of : each line.
 The script:
Code:
import re

# open combo.txt in read mode
with open('combo.txt', 'r') as f:
    # read all lines in combo.txt
    lines = f.readlines()
    # check if a regex is found in each line
    regex = re.compile(r'(?<=:)(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,25}$')
    total = 0
    matched_lines_num = 0
    # loop through each line
    for line in lines:
        total += 1
        # if regex is found in line, print line
        if regex.search(line):
            matched_lines_num += 1
            # write line to output.txt
            with open('output.txt', 'a') as f:
                f.write(line)
        print(f'[{total}/{len(lines)}]: lines with a valid password: {matched_lines_num}')
    print(f'{matched_lines_num} lines matched the regex out of {total} lines')

 How to use it?
 
You should have python 3 installed, then:
 
  1. Save your combo to a text file named combo.txt
  2. Save the code provided to a file named e.g. script.py in the same directory
  3. Run the code using the following command: python3 script.py
  4. In the end, the valid passwords will be in the output.txt file.

This is a bump
This post is by a banned member (cergo) - Unhide
cergo  
Registered
20
Posts
2
Threads
4 Years of service
Bumped #2
This is a bump

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)