OP 19 November, 2022 - 05:47 PM
(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:
How to use it?
You should have python 3 installed, then:
This is a bump
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.
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:
- Save your combo to a text file named combo.txt
- Save the code provided to a file named e.g. script.py in the same directory
- Run the code using the following command: python3 script.py
- In the end, the valid passwords will be in the output.txt file.
This is a bump