OP 30 October, 2019 - 11:13 AM
Hello
I didn't find something for my tasks, so i'm wrote simple passlist checker.
Place all passwordlists in txt format (like username@domain:(;)password) in the directory where program is.
Run python.exe checker.py
It creates subdir "result" and 2 output files: right.txt and wrong.txt
All accounts that looks good (email looks like email, etc) are going to right.txt, bad are going to wrong.txt
for email check:
re.compile('(^|\s)[-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[a-zA-Z]{2,6}(\s|$)')
you can change that if you have your own rules for email check.
For passwords check:
re.compile(r'[A-Za-z0-9@#$%^&+=]{8,50}')
You can add symbols allowed in password and length. In code above the length is 8-50 symbols.
I don't know how to attach file here so i'll post the code:
import re
import glob
import os
import codecs
os.makedirs("result", exist_ok=True)
counter_good = 0
with open('result/right.txt', 'a', encoding="utf-8") as f1:
with open('result/wrong.txt', 'a', encoding="utf-8") as f2:
for filename in glob.glob('*.txt'):
print(filename)
for line in open(filename,encoding="utf-8"):
result = re.split(':', line.replace(';',':'))
email_p = re.compile('(^|\s)[-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[a-zA-Z]{2,6}(\s|$)')
pass_p = re.compile(r'[A-Za-z0-9@#$%^&+=]{8,50}')
if email_p.match(result[0]):
try:
if pass_p.match(result[1]):
counter_good = counter_good + 1
f1.write(line.replace(';',':'))
if not line.endswith('\n'):
f1.write("\n")
else:
f2.write(line)
if not line.endswith('\n'):
f2.write("\n")
except IndexError:
print('Wrong password', line)
else:
f2.write(line)
if not line.endswith('\n'):
f2.write("\n")
print("Total good %s" % counter_good)
I didn't find something for my tasks, so i'm wrote simple passlist checker.
Place all passwordlists in txt format (like username@domain:(;)password) in the directory where program is.
Run python.exe checker.py
It creates subdir "result" and 2 output files: right.txt and wrong.txt
All accounts that looks good (email looks like email, etc) are going to right.txt, bad are going to wrong.txt
for email check:
re.compile('(^|\s)[-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[a-zA-Z]{2,6}(\s|$)')
you can change that if you have your own rules for email check.
For passwords check:
re.compile(r'[A-Za-z0-9@#$%^&+=]{8,50}')
You can add symbols allowed in password and length. In code above the length is 8-50 symbols.
I don't know how to attach file here so i'll post the code:
import re
import glob
import os
import codecs
os.makedirs("result", exist_ok=True)
counter_good = 0
with open('result/right.txt', 'a', encoding="utf-8") as f1:
with open('result/wrong.txt', 'a', encoding="utf-8") as f2:
for filename in glob.glob('*.txt'):
print(filename)
for line in open(filename,encoding="utf-8"):
result = re.split(':', line.replace(';',':'))
email_p = re.compile('(^|\s)[-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[a-zA-Z]{2,6}(\s|$)')
pass_p = re.compile(r'[A-Za-z0-9@#$%^&+=]{8,50}')
if email_p.match(result[0]):
try:
if pass_p.match(result[1]):
counter_good = counter_good + 1
f1.write(line.replace(';',':'))
if not line.endswith('\n'):
f1.write("\n")
else:
f2.write(line)
if not line.endswith('\n'):
f2.write("\n")
except IndexError:
print('Wrong password', line)
else:
f2.write(line)
if not line.endswith('\n'):
f2.write("\n")
print("Total good %s" % counter_good)