MCPcopy Create free account
hub / github.com/CScorza/IntelOSINT / _run_ghunt_login_command

Method _run_ghunt_login_command

IntelOSINT.py:13226–13258  ·  view source on GitHub ↗
(self, cmd_base, run_dir, run_env)

Source from the content-addressed store, hash-verified

13224 return self._install_ghunt_runtime()
13225
13226 def _run_ghunt_login_command(self, cmd_base, run_dir, run_env):
13227 cmd = (cmd_base or []) + ["login"]
13228 cmd_str = subprocess.list2cmdline(cmd)
13229 run_dir_path = str(run_dir)
13230 if os.name == "nt":
13231 terminal_cmd = f'start "" /D "{run_dir_path}" cmd /k "{cmd_str}"'
13232 subprocess.Popen(terminal_cmd, cwd=run_dir_path, env=run_env, shell=True)
13233 return {"mode": "windows-cmd", "command": terminal_cmd}
13234
13235 terminals = [
13236 ("gnome-terminal", "--", "bash", "-lc"),
13237 ("konsole", "-e", "bash", "-lc"),
13238 ("xterm", "-hold", "-e", "bash", "-lc"),
13239 ("tilix", "-e", "bash", "-lc"),
13240 ("alacritty", "-e", "bash", "-lc")
13241 ]
13242 terminal_path = None
13243 terminal_cmd = None
13244 for terminal in terminals:
13245 exe = shutil.which(terminal[0])
13246 if exe:
13247 terminal_path = exe
13248 shell_args = list(terminal[1:])
13249 shell_payload = f'cd "{run_dir_path}" && {cmd_str} ; exec bash'
13250 terminal_cmd = [terminal[0], *shell_args, shell_payload]
13251 break
13252
13253 if terminal_path:
13254 subprocess.Popen(terminal_cmd, cwd=run_dir_path, env=run_env)
13255 return {"mode": "linux-terminal", "command": shlex.join(terminal_cmd)}
13256
13257 subprocess.Popen(cmd, cwd=run_dir_path, env=run_env, start_new_session=True)
13258 return {"mode": "background", "command": cmd_str}
13259
13260 def _ensure_ghunt_deps(self):
13261 if getattr(self, "_ghunt_deps_ready", False):

Callers 2

ghunt_login_launchMethod · 0.95
ghunt_smart_startMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected