@@ -3950,6 +3950,8 @@ def is_venv():
39503950 is_first_run,
39513951 mark_first_run_complete,
39523952 show_first_run_helper,
3953+ log_cli_command_context,
3954+ build_cli_runtime_snapshot,
39533955)
39543956
39553957
@@ -8750,6 +8752,17 @@ def _start_bloodhound_ce():
87508752 except (HostHelperError, OSError) as exc:
87518753 telemetry.capture_exception(exc)
87528754 print_error("Failed to start BloodHound CE via host helper.")
8755+ marked_sock = mark_sensitive(sock_path, "path")
8756+ marked_compose = mark_sensitive(compose_path, "path")
8757+ print_info_debug(
8758+ "[bloodhound-ce] host-helper startup failure context: "
8759+ f"socket={marked_sock} socket_exists={Path(sock_path).exists()} "
8760+ f"compose_path={marked_compose}"
8761+ )
8762+ print_instruction(
8763+ "Inspect host-helper logs at ~/.adscan/logs/host-helper.log "
8764+ "and retry `adscan start`."
8765+ )
87538766 print_exception(show_locals=False, exception=exc)
87548767 return False
87558768
@@ -9417,6 +9430,11 @@ def _questionary_select(self, title: str, options: list[str], default_idx: int =
94179430
94189431 # Convert selected value back to index for compatibility with _curses_select
94199432 if selected_value is None:
9433+ try:
9434+ print_info_debug(f"[questionary] Cancelled: {title}")
9435+ print_telemetry_only(f"[questionary][answer] {title}: [cancelled]")
9436+ except Exception:
9437+ pass
94209438 return None
94219439
94229440 # Log user selection for telemetry/debug
@@ -13217,6 +13235,9 @@ def _extract_raw_args(original_input: str, cmd: str) -> str:
1321713235
1321813236 command_name = parts[0].lower()
1321913237 args_list = parts[1:]
13238+ marked_user_input = mark_sensitive(user_input.strip(), "text")
13239+ print_info_debug(f"[cli] Execute command: {marked_user_input}")
13240+ log_cli_command_context(self, command_name, args_list, source="cli")
1322013241 arg_string = " ".join(
1322113242 args_list
1322213243 ) # For compatibility with do_* methods expecting a string
@@ -13627,36 +13648,53 @@ def do_info(self, _args):
1362713648 """
1362813649 from adscan_internal.rich_output import BRAND_COLORS
1362913650
13651+ snapshot = build_cli_runtime_snapshot(shell=self)
13652+
1363013653 content = Text()
1363113654 content.append("Hosts: ", style=f"bold {BRAND_COLORS['info']}")
13632- content.append(str(self. hosts) + "\n", style="white")
13655+ content.append(str(snapshot.get(" hosts") ) + "\n", style="white")
1363313656 content.append("Interface: ", style=f"bold {BRAND_COLORS['info']}")
13634- content.append(str(self. interface) + "\n", style="white")
13657+ content.append(str(snapshot.get(" interface") ) + "\n", style="white")
1363513658 content.append("My IP: ", style=f"bold {BRAND_COLORS['info']}")
13636- content.append(str(self. myip) + "\n", style="white")
13659+ content.append(str(snapshot.get(" myip") ) + "\n", style="white")
1363713660 content.append("Starting Domain: ", style=f"bold {BRAND_COLORS['info']}")
13638- content.append(str(self.domain) + "\n", style="white")
13661+ content.append(str(snapshot.get("starting_domain")) + "\n", style="white")
13662+ content.append("Starting Domain Auth: ", style=f"bold {BRAND_COLORS['info']}")
13663+ content.append(str(snapshot.get("starting_domain_auth", "unknown")) + "\n", style="white")
1363913664 content.append("Configured Domains: ", style=f"bold {BRAND_COLORS['info']}")
13640- content.append(str(self.domains ) + "\n", style="white")
13665+ content.append(str(snapshot.get("configured_domains") ) + "\n", style="white")
1364113666 content.append("Automatic Mode: ", style=f"bold {BRAND_COLORS['info']}")
13642- content.append(str(self.auto ) + "\n", style="white")
13667+ content.append(str(snapshot.get("automatic_mode") ) + "\n", style="white")
1364313668 content.append("Pentest Type: ", style=f"bold {BRAND_COLORS['info']}")
1364413669 content.append(
13645- str(self.type) + "\n" if self.type else "Not set\n", style="white"
13670+ (
13671+ str(snapshot.get("pentest_type")) + "\n"
13672+ if snapshot.get("pentest_type")
13673+ else "Not set\n"
13674+ ),
13675+ style="white",
1364613676 )
1364713677 content.append("Current Workspace: ", style=f"bold {BRAND_COLORS['info']}")
13648- content.append(str(self.current_workspace_dir) + "\n", style="white")
13649- content.append("Neo4j Server: ", style=f"bold {BRAND_COLORS['info']}")
13650- content.append(str(self.neo4j_host) + "\n", style="white")
13651- content.append("Neo4j Port: ", style=f"bold {BRAND_COLORS['info']}")
13652- content.append(str(self.neo4j_port) + "\n", style="white")
13653- content.append("Neo4j User: ", style=f"bold {BRAND_COLORS['info']}")
13654- content.append(str(self.neo4j_db_user) + "\n", style="white")
13655- # Neo4j password is intentionally omitted for security
13678+ content.append(str(snapshot.get("current_workspace")) + "\n", style="white")
13679+ content.append("BloodHound CE URL: ", style=f"bold {BRAND_COLORS['info']}")
13680+ content.append(
13681+ mark_sensitive(str(snapshot.get("bloodhound_ce_url")), "host") + "\n",
13682+ style="white",
13683+ )
13684+ content.append("BloodHound CE User: ", style=f"bold {BRAND_COLORS['info']}")
13685+ content.append(
13686+ mark_sensitive(str(snapshot.get("bloodhound_ce_user")), "user") + "\n",
13687+ style="white",
13688+ )
13689+ content.append("BloodHound CE Password: ", style=f"bold {BRAND_COLORS['info']}")
13690+ content.append(
13691+ mark_sensitive(str(snapshot.get("bloodhound_ce_password")), "password")
13692+ + "\n",
13693+ style="white",
13694+ )
1365613695 content.append("Telemetry: ", style=f"bold {BRAND_COLORS['info']}")
13657- env_val = os.getenv("ADSCAN_TELEMETRY", None)
13658- enabled = telemetry._is_telemetry_enabled()
13659- suffix = " (session override)" if env_val is not None else " (persisted)"
13696+ enabled = bool(snapshot.get("telemetry_enabled"))
13697+ suffix = f" ({snapshot.get('telemetry_source', 'persisted')})"
1366013698 content.append(f"{'ON' if enabled else 'OFF'}{suffix}\n", style="white")
1366113699
1366213700 content.append("\nDomain Information:\n", style="bold green")
0 commit comments