Skip to content

Instantly share code, notes, and snippets.

@kecs
Created March 4, 2019 19:29
Show Gist options
  • Save kecs/dfa4cc30e90161906aa7a12df96298a2 to your computer and use it in GitHub Desktop.
Save kecs/dfa4cc30e90161906aa7a12df96298a2 to your computer and use it in GitHub Desktop.
Password policy says eg. pass must contain 3 chr set from 4
import re
rules = (
re.compile('[a-z]'),
re.compile('[A-Z]'),
re.compile('[1-9]'),
re.compile('[\!\+\-\@\.]'),
)
with open('wordlists/rockyou.txt', 'r') as f:
for l in f:
pw = l[:-1]
if sum([r.search(pw) and 1 or 0 for r in rules]) > 2:
print pw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment