diff options
| author | 5epi0l <91630053+5epi0l@users.noreply.github.com> | 2025-11-20 21:37:02 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-20 21:37:02 +0530 |
| commit | 0940f8c0b7136213c68cd871112854959ef8e279 (patch) | |
| tree | 03f681528d806a71ff39a5792371c1872449d984 | |
| parent | 11525471315f17cac93a49181590d3f9c0b22d74 (diff) | |
| parent | 2bc9d597128ee7ec9b95622f34964e5da68aa84c (diff) | |
Merge pull request #6 from ExtremeUday/main
| -rw-r--r-- | Userenum/README.MD | 65 | ||||
| -rw-r--r-- | Userenum/userenum.py | 74 |
2 files changed, 139 insertions, 0 deletions
diff --git a/Userenum/README.MD b/Userenum/README.MD new file mode 100644 index 0000000..beba07b --- /dev/null +++ b/Userenum/README.MD @@ -0,0 +1,65 @@ +# 📄 README.md + +# Username Variation Generator + +A lightweight Python tool to generate common username formats used in AD, Linux, and corporate environments. Useful for enumeration during pentesting or automation. + +--- + +## ✨ Features + +* Accepts **First Last** and **First.Last** formats +* Generates multiple username variations +* Supports custom input/output files +* Removes duplicates automatically + +--- + +## 🚀 Usage + +### Basic + +```bash +python3 gen_user.py -i names.txt +``` + +### Specify output file + +```bash +python3 gen_user.py -i names.txt -o users_final.txt +``` + +### Help + +```bash +python3 gen_user.py -h +``` + +--- + +## 📝 Input Examples + +``` +James Roberts +Sarah.Osvald +``` + +--- + +## 📤 Output Examples + +``` +james.roberts +jroberts +jamesr +james_roberts +jr +``` + +--- + +## 👤 Authors + +PaiN05, Uday + +--- diff --git a/Userenum/userenum.py b/Userenum/userenum.py new file mode 100644 index 0000000..c61c58c --- /dev/null +++ b/Userenum/userenum.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 + +# Author : PaiN05 , Uday +import argparse + +def generate_variations(first, last): + first = first.lower() + last = last.lower() + return list(set([ + f"{first}.{last}", + f"{first}{last}", + f"{first[0]}{last}", + f"{first}{last[0]}", + f"{first}_{last}", + f"{first}", + f"{last}", + f"{first[0]}.{last}", + f"{first}.{last[0]}", + f"{first[0]}{last[0]}", + f"{last}{first[0]}" + ])) + +def parse_name(line): + line = line.strip() + if not line: + return None + + # Support First Last OR First.Last + if "." in line and " " not in line: + parts = line.split(".") + else: + parts = line.split() + + if len(parts) == 2: + return parts[0], parts[1] + + return None + +def main(): + parser = argparse.ArgumentParser(description="Generate username variations.") + parser.add_argument("-i", "--input", required=True, help="Input file with names") + parser.add_argument("-o", "--output", default="users.txt", help="Output file for username variations") + + args = parser.parse_args() + + input_file = args.input + output_file = args.output + + usernames = set() + + try: + with open(input_file, "r") as f: + lines = f.readlines() + except FileNotFoundError: + print(f"[!] File '{input_file}' not found.") + return + + for line in lines: + parsed = parse_name(line) + if parsed: + first, last = parsed + variations = generate_variations(first, last) + usernames.update(variations) + else: + print(f"[!] Skipping invalid entry: {line.strip()}") + + with open(output_file, "w") as f: + for name in sorted(usernames): + f.write(name + "\n") + + print(f"[+] Wrote {len(usernames)} username variations to {output_file}") + +if __name__ == "__main__": + main() |
