Skip to content

Instantly share code, notes, and snippets.

@kecs
Created September 6, 2018 11:11
Show Gist options
  • Save kecs/f998e2058914511f0a381faf19e27924 to your computer and use it in GitHub Desktop.
Save kecs/f998e2058914511f0a381faf19e27924 to your computer and use it in GitHub Desktop.
You have a password policy with special chars, you have rate limit, you want to know the most common special chars in passwords.
import re
from collections import defaultdict
d = defaultdict(int)
with open('/usr/share/wordlists/rockyou.txt', 'r') as f:
for l in f:
for c in re.findall('\W', l[:-1]):
d[c] += 1
print sorted(d.items(), key=lambda t: t[1], reverse=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment