AI powered OSINT engine to discover and map 840+ social media identities across the web
Python aiartificial-intelligencedebainhackhackerhackinghackingtoolsinformationinformation-gatheringlinuxlinux-desktoposintpythonpython-scriptpython3social-mediasocialmediahackingtermuxtermux-tool
feat: say what the Advanced level will do before it starts (2.7.1)
arxhr007c081dddeb473
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 87b1eab..df3ad9e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,19 @@# Changelog+## 2.7.1 (2026-10-19)++### Added+- **The Advanced level now says what it will do before it starts.** It checks 123+ variations of the username, which on all sites is about 105,000 requests and close to two+ hours. Picking it from the menu now asks for confirmation first (the default is No, and+ declining returns to the menu). A level given as `-l advanced` is not asked about. Every+ level with more than one variation also prints its request count and a rough time under+ the scan banner. The time assumes about 16 sites a second, measured on a default scan.+ Prompted by a report of a very long scan on a small laptop (#26).++ Memory, for the record, measured on 2.7.0: a default scan peaks at about 350 MB, and 12+ variations of all 854 sites at about 415 MB.+## 2.7.0 (2026-10-08)### Fixeddiff --git a/pyproject.toml b/pyproject.tomlindex 28941a8..ac63bb6 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "hatchling.build"[project]name = "aliens-eye"-version = "2.7.0"+version = "2.7.1"description = "AI-powered OSINT username scanner across 800+ social media and web platforms"readme = "README.md"requires-python = ">=3.10"diff --git a/src/aliens_eye/__init__.py b/src/aliens_eye/__init__.pyindex 400b28d..9f6f78a 100644--- a/src/aliens_eye/__init__.py+++ b/src/aliens_eye/__init__.py@@ -1,3 +1,3 @@"""Aliens Eye - AI-powered OSINT username scanner."""-__version__ = "2.7.0"+__version__ = "2.7.1"diff --git a/src/aliens_eye/cli.py b/src/aliens_eye/cli.pyindex 3561d9e..4f0009f 100644--- a/src/aliens_eye/cli.py+++ b/src/aliens_eye/cli.py@@ -459,6 +459,32 @@ def prompt_scan_level() -> str:return {"1": "basic", "2": "intermediate", "3": "advanced"}[choice]+def confirm_scan_cost(level: str, username: str, n_sites: int, console) -> bool:+ """Ask before a level that makes tens of thousands of requests.++ Only Advanced is big enough to need it (123 variations of the username). A+ level the user typed as a flag is not asked about: they chose it knowingly.+ """+ from aliens_eye.core.variations import generate_username_variations, scan_cost++ if level != "advanced":+ return True+ cost = scan_cost(len(generate_username_variations(username, level)), n_sites)+ return Confirm.ask(+ f"Advanced will make {cost.describe()}. Continue?",+ default=False,+ console=console,+ )+++def choose_scan_level(username: str, n_sites: int, console) -> str:+ """Ask for a level, and ask again if the user backs out of an expensive one."""+ while True:+ level = prompt_scan_level()+ if confirm_scan_cost(level, username, n_sites, console):+ return level++def apply_scan_profile(config: ScannerConfig, profile: str, args) -> None:presets = {"quick": {@@ -729,7 +755,8 @@ async def run_scan(args) -> None:if scan_level not in {"basic", "intermediate", "advanced"}:scan_level = Noneif not scan_level:- scan_level = prompt_scan_level() if interactive else "basic"+ # Chosen from the menu, so it may have been picked without knowing the cost.+ scan_level = choose_scan_level(usernames[0], len(sites_data), console) if interactive else "basic"formats_value = args.format if args.format is not None else defaults.get("output_formats")formats = parse_formats_value(formats_value)diff --git a/src/aliens_eye/core/scanner.py b/src/aliens_eye/core/scanner.pyindex b17fe1f..5a7920b 100644--- a/src/aliens_eye/core/scanner.py+++ b/src/aliens_eye/core/scanner.py@@ -19,7 +19,7 @@ from .detector import Detectorfrom .fingerprints import FingerprintStore, build_fingerprintfrom .http import fetch_urlfrom .rate_limit import DomainRateLimiter-from .variations import generate_username_variations+from .variations import generate_username_variations, scan_cost@dataclass@@ -268,6 +268,8 @@ class UsernameScanner:preview = ", ".join(variations[:5])more = f" and {len(variations) - 5} more..." if len(variations) > 5 else ""self.console.print(f"[dim]Variations: {preview}{more}[/dim]")+ cost = scan_cost(len(variations), len(self.sites_data))+ self.console.print(f"[dim]This will make {cost.describe()}.[/dim]")if not base_username.isascii():self.console.print(diff --git a/src/aliens_eye/core/variations.py b/src/aliens_eye/core/variations.pyindex 3d1cb47..27c0bcb 100644--- a/src/aliens_eye/core/variations.py+++ b/src/aliens_eye/core/variations.py@@ -1,4 +1,5 @@import re+from dataclasses import dataclassdef usernames_from_email(email: str) -> list[str]:@@ -119,3 +120,37 @@ def generate_username_variations(username: str, level: str) -> list[str]:variations.append(f"{username}.{suffix}")return list(dict.fromkeys(variations))+++# Measured on the published 2.7.0: 854 sites take about 54 seconds at the default+# concurrency, so about 16 sites a second. Rough, and slower through a proxy or Tor.+SITES_PER_SECOND = 16.0+++@dataclass(frozen=True)+class ScanCost:+ variations: int+ sites: int++ @property+ def requests(self) -> int:+ return self.variations * self.sites++ @property+ def minutes(self) -> float:+ return self.requests / SITES_PER_SECOND / 60++ def describe(self) -> str:+ minutes = self.minutes+ if minutes >= 90:+ taken = f"about {minutes / 60:.1f} hours"+ elif minutes >= 2:+ taken = f"about {round(minutes)} minutes"+ else:+ taken = "about a minute"+ return f"{self.requests:,} requests, {taken} at default settings"+++def scan_cost(variations: int, sites: int) -> ScanCost:+ """What a scan will ask of the network, for telling the user before it starts."""+ return ScanCost(variations, sites)diff --git a/tests/test_config_cli.py b/tests/test_config_cli.pyindex 9babc9f..6afbf4f 100644--- a/tests/test_config_cli.py+++ b/tests/test_config_cli.py@@ -198,3 +198,88 @@ def test_control_check_is_on_by_default_and_can_be_turned_off():assert config.control_check is Trueapply_cli_overrides(config, build_parser().parse_args(["someone", "--no-control-check"]))assert config.control_check is False+++# --- warning before an expensive scan level (#26) ---------------------------------------+++def test_scan_cost_is_requests_and_a_rough_time():+ from aliens_eye.core.variations import scan_cost++ cost = scan_cost(variations=123, sites=854)+ assert cost.requests == 105_042+ assert 90 <= cost.minutes <= 130 # about 16 sites a second at the default concurrency+ assert scan_cost(variations=1, sites=854).requests == 854+++def test_cost_wording_is_in_hours_for_long_scans():+ from aliens_eye.core.variations import scan_cost++ assert "hour" in scan_cost(123, 854).describe()+ assert "minute" in scan_cost(1, 854).describe()+ assert "105,042" in scan_cost(123, 854).describe()+++def test_only_advanced_asks_before_starting(monkeypatch):+ from aliens_eye import cli++ asked = []+ monkeypatch.setattr(cli.Confirm, "ask", lambda *a, **k: asked.append(a[0]) or True)+ assert cli.confirm_scan_cost("basic", "someone", 854, console=None) is True+ assert cli.confirm_scan_cost("intermediate", "someone", 854, console=None) is True+ assert asked == []+ assert cli.confirm_scan_cost("advanced", "someone", 854, console=None) is True+ assert len(asked) == 1 and "105" in asked[0]+++def test_declining_the_warning_is_reported(monkeypatch):+ from aliens_eye import cli++ monkeypatch.setattr(cli.Confirm, "ask", lambda *a, **k: False)+ assert cli.confirm_scan_cost("advanced", "someone", 854, console=None) is False+++def test_the_prompt_defaults_to_no(monkeypatch):+ from aliens_eye import cli++ seen = {}+ monkeypatch.setattr(cli.Confirm, "ask", lambda *a, **k: seen.update(k) or False)+ cli.confirm_scan_cost("advanced", "someone", 854, console=None)+ assert seen["default"] is False+++def test_the_scan_banner_states_the_cost_for_multi_variation_levels(tmp_path, logger):+ import asyncio+ import io++ from rich.console import Console+ from test_scanner import make_scanner++ buffer = io.StringIO()+ scanner = make_scanner({"alpha": "http://127.0.0.1:9/{}"}, tmp_path, logger)+ scanner.console = Console(file=buffer, width=140, force_terminal=False)++ async def run():+ scanner.scan_all_sites = lambda name: asyncio.sleep(0, result=[]) # no network+ await scanner.scan_with_variations("someone", "advanced")++ asyncio.run(run())+ assert "123 username variation" in buffer.getvalue()+ assert "requests" in buffer.getvalue()+++def test_declining_an_expensive_level_asks_for_a_level_again(monkeypatch):+ from aliens_eye import cli++ picks = iter(["advanced", "basic"])+ monkeypatch.setattr(cli, "prompt_scan_level", lambda: next(picks))+ monkeypatch.setattr(cli.Confirm, "ask", lambda *a, **k: False)+ assert cli.choose_scan_level("someone", 854, console=None) == "basic"+++def test_accepting_an_expensive_level_keeps_it(monkeypatch):+ from aliens_eye import cli++ monkeypatch.setattr(cli, "prompt_scan_level", lambda: "advanced")+ monkeypatch.setattr(cli.Confirm, "ask", lambda *a, **k: True)+ assert cli.choose_scan_level("someone", 854, console=None) == "advanced"