• We just launched and are currently in beta. Join us as we build and grow the community.

PYTHON SCRIPT TO GET VALID PASSWORDS FROM A COMBOLIST

hamdyabdelmenem90

Crypto Security Auditor
H Rep
0
0
0
Rep
0
H Vouches
0
0
0
Vouches
0
Posts
163
Likes
121
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 200 XP
Link:
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:
--------------------------
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.
 

452,496

328,732

328,740

Top