Wordlist Rockyou Direct
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 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)] wordlist rockyou
@staticmethod def leet_speak(password: str) -> List[str]: """Convert to leet speak variations""" leet_map = { 'a': ['4', '@'], 'e': ['3'], 'i': ['1', '!'], 'o': ['0'], 's': ['5', '$'], 't': ['7'] } variations = [password] for char, replacements in leet_map.items(): new_variations = [] for var in variations: for replacement in replacements: new_variations.append(var.replace(char, replacement)) variations.extend(new_variations) return list(set(variations))[:20] # Limit variations def get_hash(self, hash_type: str = 'md5') -> Dict[str,
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)] hash_type: str = 'md5') ->
def stream(self) -> Iterator[str]: """ Stream passwords without loading all into memory Yields: Passwords one by one """ if self.filepath.endswith('.gz'): with gzip.open(self.filepath, 'rt', encoding='latin-1', errors='ignore') as f: for line in f: password = line.strip() if password: yield password else: with open(self.filepath, 'r', encoding='latin-1', errors='ignore') as f: for line in f: password = line.strip() if password: yield password