cracker = InstaCrackerCLI(verbose=True) while True: print("\n" + "="*50) print("Commands: [1] Crack Hash [2] Analyze [3] Generate [4] Exit") choice = input("\nSelect option: ").strip() if choice == '1': target = input("Enter hash: ").strip() hash_type = input("Hash type (md5/sha1/sha256): ").strip() or 'md5' print("\nMethods: [1] Dictionary [2] Brute Force [3] Hybrid") method_choice = input("Select method: ").strip() if method_choice == '1': wordlist_file = input("Wordlist file (optional): ").strip() wordlist = None if wordlist_file: try: with open(wordlist_file, 'r') as f: wordlist = [line.strip() for line in f] except: print("[-] Could not load wordlist") result, attempts, elapsed = cracker.dictionary_attack(target, hash_type, wordlist) elif method_choice == '2': max_len = int(input("Max password length (default 5): ").strip() or '5') result, attempts, elapsed = cracker.brute_force_attack(target, hash_type, max_len) else: result, attempts, elapsed = cracker.hybrid_attack(target, hash_type) if result: print(f"\n[+] SUCCESS! Password: result") else: print(f"\n[-] Failed to crack hash after attempts:, attempts") print(f" Time: elapsed:.2f seconds") elif choice == '2': password = input("Enter password to analyze: ").strip() analysis = cracker.analyze_password(password) print(f"\n[+] Strength: analysis['strength']") print(f" Score: analysis['score']/6") if analysis['feedback']: print(" Suggestions:") for sug in analysis['feedback']: print(f" - sug") elif choice == '3': base = input("Base words (comma-separated): ").strip() output = input("Output file: ").strip() count = cracker.generate_wordlist(base.split(','), output) elif choice == '4': print("[+] Goodbye!") break if == " main ": print(""" ╔══════════════════════════════════════════════════╗ ║ InstaCracker CLI - Security Tool v1.0 ║ ║ Authorized Use Only! ║ ╚══════════════════════════════════════════════════╝ """) main()
#!/usr/bin/env python3 """ instacracker-cli - A command-line password strength testing tool For educational and security assessment purposes only """ import hashlib import itertools import string import time import sys import argparse import re from typing import Dict, List, Tuple, Optional import json instacracker-cli
# Analyze command analyze_parser = subparsers.add_parser('analyze', help='Analyze password strength') analyze_parser.add_argument('--password', required=True, help='Password to analyze') elapsed = cracker.dictionary_attack(target
def analyze_password(self, password: str) -> Dict: """Analyze password strength and provide feedback""" score = 0 feedback = [] # Length check if len(password) >= 12: score += 2 elif len(password) >= 8: score += 1 else: feedback.append("Password is too short (minimum 8 characters)") # Complexity checks if re.search(r'[A-Z]', password): score += 1 else: feedback.append("Add uppercase letters") if re.search(r'[a-z]', password): score += 1 else: feedback.append("Add lowercase letters") if re.search(r'\d', password): score += 1 else: feedback.append("Add numbers") if re.search(r'[!@#$%^&*(),.?":{}|<>]', password): score += 1 else: feedback.append("Add special characters") # Check against common passwords if password.lower() in self.common_passwords: score -= 2 feedback.append("Password is too common") # Entropy calculation (simplified) charset_size = 0 if re.search(r'[a-z]', password): charset_size += 26 if re.search(r'[A-Z]', password): charset_size += 26 if re.search(r'\d', password): charset_size += 10 if re.search(r'[!@#$%^&*(),.?":{}|<>]', password): charset_size += 32 entropy = len(password) * (charset_size.bit_length() - 1) if charset_size > 0 else 0 # Strength rating if score >= 5: strength = "Very Strong" elif score >= 4: strength = "Strong" elif score >= 3: strength = "Moderate" elif score >= 2: strength = "Weak" else: strength = "Very Weak" return { "score": score, "strength": strength, "entropy_bits": entropy, "feedback": feedback, "length": len(password), "has_upper": bool(re.search(r'[A-Z]', password)), "has_lower": bool(re.search(r'[a-z]', password)), "has_digits": bool(re.search(r'\d', password)), "has_special": bool(re.search(r'[!@#$%^&*(),.?":{}|<>]', password)) } def main(): parser = argparse.ArgumentParser( description='InstaCracker CLI - Password Security Testing Tool', formatter_class=argparse.RawDescriptionHelpFormatter, epilog=""" Examples: %(prog)s hash --target 5f4dcc3b5aa765d61d8327deb882cf99 --type md5 %(prog)s analyze --password "MySecurePass123!" %(prog)s brute --hash 5f4dcc3b5aa765d61d8327deb882cf99 --max-length 5 %(prog)s generate --words admin,password,test --output wordlist.txt """ ) elapsed = cracker.brute_force_attack(target
subparsers = parser.add_subparsers(dest='command', help='Commands')