-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from PaperMtn/feature/username-password-check
Version 3.2.0 Release
- Loading branch information
Showing
8 changed files
with
183 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "lil-pwny" | ||
version = "3.1.0" | ||
version = "3.2.0" | ||
description = "Fast offline auditing of Active Directory passwords using Python and multiprocessing" | ||
authors = ["PaperMtn <[email protected]>"] | ||
license = "GPL-3.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/lil_pwny/variant_generators/username_variant_generator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from typing import Dict, List | ||
|
||
|
||
class UsernameVariantGenerator: | ||
|
||
def generate_variations(self, ad_user_list: Dict[str, List[str]]) -> List[str]: | ||
""" Generates variations of usernames based on specific rules. | ||
- All uppercase | ||
- All lowercase | ||
- Remove dot "." | ||
- camelCase | ||
- PascalCase | ||
Args: | ||
ad_user_list: A dictionary where keys are NTLM hashes and values are lists of usernames. | ||
Returns: | ||
List: A list of generated username variations. | ||
""" | ||
|
||
variations = [] | ||
|
||
for ntlm_hash, usernames in ad_user_list.items(): | ||
for uname in usernames: | ||
if '.' in uname: | ||
split_uname = uname.split('.') | ||
|
||
if len(split_uname) > 1: | ||
camel_uname = split_uname[0].lower() + ''.join(part.capitalize() for part in split_uname[1:]) | ||
variations.append(camel_uname) | ||
|
||
pascal_uname = ''.join(part.capitalize() for part in split_uname) | ||
variations.append(pascal_uname) | ||
|
||
stripped_uname = uname.replace('.', '') | ||
variations.append(stripped_uname.upper()) | ||
variations.append(stripped_uname.lower()) | ||
|
||
variations.append(uname.upper()) | ||
variations.append(uname.lower()) | ||
|
||
return variations |