π΅οΈββοΈ (2-in-1) Email & Username OSINT suite featuring native MCP support for deep data extraction just from a single Email/Username. Analyzes 2720+ actively maintained scan vectors (210+ email / 2510+ username) for security research, investigations, and digital footprinting.
Python cybersecuritycybersecurity-toolsemail-osintethical-hackingethical-hacking-toolsidentificationinfosecosintosint-emailosint-toolosint-toolsosint-usernamepentestingpythonredteam-toolsredteamingthreat-intelligence
feat: auto-update feature
kaifcodec06d2e9a55461
diff --git a/user_scanner/__main__.py b/user_scanner/__main__.pyindex 5cde60f..4c57a7f 100644--- a/user_scanner/__main__.py+++ b/user_scanner/__main__.py@@ -8,10 +8,13 @@ from user_scanner.cli.banner import print_bannerfrom typing import Listfrom user_scanner.core.result import Resultfrom user_scanner.core.utils import is_last_value+from user_scanner.utils.updater_logic import check_for_updates+from user_scanner.utils.update import update_selfMAX_PERMUTATIONS_LIMIT = 100 # To prevent excessive generationdef main():+parser = argparse.ArgumentParser(prog="user-scanner",description="Scan usernames across multiple platforms."@@ -51,18 +54,25 @@ def main():parser.add_argument("-o", "--output", type=str, help="Specify the output file")+ parser.add_argument(+ "-U", "--update", action="store_true", help="Update user-scanner to latest version"+ )args = parser.parse_args()Printer = printer.Printer(args.format)- if args.list:- Printer.print_modules(args.category)- return+ if args.update is True:+ update_self()++ check_for_updates()if not args.username:parser.print_help()return+ if args.list:+ Printer.print_modules(args.category)+ returnif Printer.is_console:@@ -77,7 +87,7 @@ def main():usernames = [args.username] # Default single username list- #Added permutation support , generate all possible permutation of given sequence.+ # Added permutation support , generate all possible permutation of given sequence.if args.permute:usernames = generate_permutations(args.username, args.permute , args.stop)if Printer.is_console:diff --git a/user_scanner/cli/banner.py b/user_scanner/cli/banner.pyindex 46b929c..9c40c7d 100644--- a/user_scanner/cli/banner.py+++ b/user_scanner/cli/banner.py@@ -1,6 +1,6 @@import jsonfrom colorama import Fore, Style, init-from ..utils.version import load_local_version+from ..core.version import load_local_versionversion, version_type = load_local_version()@@ -16,18 +16,9 @@ BANNER_ASCII = fr"""{C_CYAN} _ _ ___ ___ _ __ ___ ___ __ _ _ __ _\__,_|___/\___|_| |___/\___\__,_|_| |_|_| |_|\___|_| Version: {version}{Style.RESET_ALL}""".strip()-INFO_BOX = f"""{C_MAGENTA} ββββββββββββββββββββββββββββββββββββββββββ- β {C_RED}β {C_GREEN}Project Name{C_WHITE} : UserScanner {C_MAGENTA}β- β {C_RED}β {C_GREEN}Author{C_WHITE} : Kaif {C_MAGENTA}β- β {C_RED}β {C_GREEN}Github{C_WHITE} : github.com/kaifcodec {C_MAGENTA}β- β {C_RED}β {C_GREEN}Email{C_WHITE} : [email protected] {C_MAGENTA}β- ββββββββββββββββββββββββββββββββββββββββββ{Style.RESET_ALL}""".strip()-def print_banner():print(BANNER_ASCII)- print(INFO_BOX)- print(" ")if __name__ == "__main__":diff --git a/user_scanner/config.py b/user_scanner/config.pynew file mode 100644index 0000000..99e5131--- /dev/null+++ b/user_scanner/config.py@@ -0,0 +1 @@+auto_update_status=Truediff --git a/user_scanner/core/version.py b/user_scanner/core/version.pynew file mode 100644index 0000000..bda81aa--- /dev/null+++ b/user_scanner/core/version.py@@ -0,0 +1,31 @@+import json+import httpx+from pathlib import Path++SCRIPT_DIR = Path(__file__).parent+VERSION_FILE = SCRIPT_DIR.parent / "version.json"+++def load_local_version():+ try:+ data = json.loads(VERSION_FILE.read_text())+ return data.get("version", "error_report_via_gh_issues"), data.get("version_type", "local")+ except FileNotFoundError:+ return "N/A", "file_missing"+ except json.JSONDecodeError:+ return "N/A", "json_error"+ except Exception:+ return "N/A", "error"+++def get_pypi_version(pypi_url):+ try:+ pypi_version = httpx.get(pypi_url, timeout=7).json()["info"]["version"]+ except Exception as e:+ print(e)+ return None+ return pypi_version++if __name__ == "__main__":+ version, version_type = load_local_version()+ print(f"Version: {version}, Type: {version_type}")diff --git a/user_scanner/utils/__init__.py b/user_scanner/utils/__init__.pynew file mode 100644index 0000000..e69de29diff --git a/user_scanner/utils/update.py b/user_scanner/utils/update.pyindex e69de29..d2694aa 100644--- a/user_scanner/utils/update.py+++ b/user_scanner/utils/update.py@@ -0,0 +1,35 @@+import subprocess+import sys+from colorama import Fore++def get_version(package_name):+ try:+ from importlib.metadata import version # Python 3.8++ return version(package_name)+ except Exception:+ return "Unknown"++def update_self():+ print("Updating user-scanner using pip...\n")+ try:+ subprocess.check_call([+ sys.executable, "-m", "pip", "uninstall", "user-scanner", "-y"+ ])+ subprocess.check_call([+ sys.executable, "-m", "pip", "install", "--upgrade", "user-scanner"+ ])+ except subprocess.CalledProcessError as e:+ print(f"{Fore.RED}Failed to update user-scanner: {e}{Fore.reset}")+ return+++ user_scanner_ver = get_version("user-scanner")++ print("Installed Versions:")+ print(f" β’ user-scanner: {user-scanner_ver}")+ print("\nUpdates completed!\n")++if __name__ == "__main__":+ user_scanner_ver = get_version("user-scanner")+ print(user_scanner_ver)+diff --git a/user_scanner/utils/updater_logic.py b/user_scanner/utils/updater_logic.pynew file mode 100644index 0000000..01b8b45--- /dev/null+++ b/user_scanner/utils/updater_logic.py@@ -0,0 +1,42 @@+import httpx+import re+from pathlib import Path+from user_scanner.core.version import get_pypi_version, load_local_version+from user_scanner.utils.update import update_self++CONFIG_PATH = Path(__file__).parent.parent / "config.py"++def save_config_change(status):+ if not CONFIG_PATH.exists():+ return+ content = CONFIG_PATH.read_text()+ new_content = re.sub(r"auto_update_status\s*=\s*(True|False)", f"auto_update_status = {status}", content)+ CONFIG_PATH.write_text(new_content)++def check_for_updates():+ try:+ from user_scanner import config+ except ImportError:+ return++ if not getattr(config, 'auto_update_status', True):+ return++ try:+ PYPI_URL = "https://pypi.org/pypi/user-scanner/json"+ latest_ver = get_pypi_version(PYPI_URL)+ current_ver, _ = load_local_version()++ if current_ver != latest_ver:+ print(f"\n[!] New version available: {current_ver} -> {latest_ver}")+ choice = input("Do you want to update? (y/n/d: don't ask again): ").strip().lower()+ if choice == "y":+ update_self()+ print("[+] Update successful. Please restart the tool to use the new version.")+ import sys+ sys.exit(0)+ elif choice == "d":+ save_config_change(False)+ print("[*] Auto-update checks disabled.")+ except Exception:+ passdiff --git a/user_scanner/utils/version.py b/user_scanner/utils/version.pyindex b8c68ce..bda81aa 100644--- a/user_scanner/utils/version.py+++ b/user_scanner/utils/version.py@@ -1,14 +1,15 @@import json+import httpxfrom pathlib import Path-_SCRIPT_DIR = Path(__file__).resolve().parent-VERSION_FILE = _SCRIPT_DIR.parent / "version.json"+SCRIPT_DIR = Path(__file__).parent+VERSION_FILE = SCRIPT_DIR.parent / "version.json"def load_local_version():try:data = json.loads(VERSION_FILE.read_text())- return data.get("version", "0.0.0"), data.get("version_type", "local")+ return data.get("version", "error_report_via_gh_issues"), data.get("version_type", "local")except FileNotFoundError:return "N/A", "file_missing"except json.JSONDecodeError:@@ -17,6 +18,14 @@ def load_local_version():return "N/A", "error"+def get_pypi_version(pypi_url):+ try:+ pypi_version = httpx.get(pypi_url, timeout=7).json()["info"]["version"]+ except Exception as e:+ print(e)+ return None+ return pypi_version+if __name__ == "__main__":version, version_type = load_local_version()print(f"Version: {version}, Type: {version_type}")diff --git a/user_scanner/version.json b/user_scanner/version.jsonindex d396508..2c9fc50 100644--- a/user_scanner/version.json+++ b/user_scanner/version.json@@ -1,4 +1,4 @@{-"version": "1.0.9.1",+"version": "1.0.8.0","version_type": "pypi"}