Wordlist Rockyou Fix | WORKING • 2024 |

def get_hash(self, hash_type: str = 'md5') -> Dict[str, str]: """ Generate hashes for passwords Args: hash_type: 'md5', 'sha1', 'sha256' Returns: Dictionary mapping password to hash """ if not self.loaded: self.load() hash_func = getattr(hashlib, hash_type) return {pwd: hash_func(pwd.encode()).hexdigest() for pwd in self.wordlist[:1000]} # Limit for performance

def search(self, pattern: str, case_sensitive: bool = False) -> List[str]: """ Search for passwords matching a pattern Args: pattern: Regex pattern to search for case_sensitive: Whether search is case-sensitive Returns: List of matching passwords """ if not self.loaded: self.load() flags = 0 if case_sensitive else re.IGNORECASE regex = re.compile(pattern, flags) return [pwd for pwd in self.wordlist if regex.search(pwd)] wordlist rockyou

@staticmethod def add_suffixes(password: str, suffixes: List[str] = None) -> List[str]: """Add common suffixes""" if suffixes is None: suffixes = ['123', '1234', '!', '@', '2023', '2024'] return [f"{password}{suffix}" for suffix in suffixes] def get_hash(self, hash_type: str = 'md5') -> Dict[str,

def get_statistics(self) -> Dict: """ Analyze wordlist statistics Returns: Dictionary with statistics """ if not self.loaded: self.load() stats = { 'total_passwords': len(self.wordlist), 'unique_passwords': len(set(self.wordlist)), 'duplicates': len(self.wordlist) - len(set(self.wordlist)), 'length_distribution': {}, 'common_patterns': {}, 'character_types': { 'numeric_only': 0, 'alpha_only': 0, 'alphanumeric': 0, 'special_chars': 0 } } # Analyze password lengths lengths = [len(pwd) for pwd in self.wordlist] length_counter = Counter(lengths) stats['length_distribution'] = dict(length_counter.most_common(10)) # Analyze character types for pwd in self.wordlist: if pwd.isdigit(): stats['character_types']['numeric_only'] += 1 elif pwd.isalpha(): stats['character_types']['alpha_only'] += 1 elif pwd.isalnum(): stats['character_types']['alphanumeric'] += 1 elif any(not c.isalnum() for c in pwd): stats['character_types']['special_chars'] += 1 # Find common patterns common_passwords = Counter(self.wordlist).most_common(20) stats['common_patterns'] = dict(common_passwords) return stats hash_type: str = 'md5') -&gt

def filter_by_length(self, min_len: int = 0, max_len: Optional[int] = None) -> List[str]: """Filter passwords by length""" if not self.loaded: self.load() return [pwd for pwd in self.wordlist if len(pwd) >= min_len and (max_len is None or len(pwd) <= max_len)]

def find_similar(self, target_password: str, threshold: int = 2) -> List[str]: """ Find similar passwords using Levenshtein distance Args: target_password: Password to compare against threshold: Maximum edit distance Returns: List of similar passwords """ if not self.loaded: self.load() def levenshtein(s1: str, s2: str) -> int: if len(s1) < len(s2): return levenshtein(s2, s1) if len(s2) == 0: return len(s1) previous_row = range(len(s2) + 1) for i, c1 in enumerate(s1): current_row = [i + 1] for j, c2 in enumerate(s2): insertions = previous_row[j + 1] + 1 deletions = current_row[j] + 1 substitutions = previous_row[j] + (c1 != c2) current_row.append(min(insertions, deletions, substitutions)) previous_row = current_row return previous_row[-1] similar = [] for pwd in self.wordlist[:10000]: # Limit for performance distance = levenshtein(target_password, pwd) if distance <= threshold: similar.append(pwd) return similar def demo_rockyou_feature(): """Demonstrate the RockYou wordlist feature"""

""" RockYou Wordlist Feature A comprehensive utility for working with the rockyou.txt wordlist """ import os import gzip import hashlib from typing import List, Set, Dict, Optional, Iterator from pathlib import Path from collections import Counter import re

Scroll to Top