chore: auto-commit (1 archivos)

- web_proxy

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-02 22:12:44 +02:00
parent c4c8e53915
commit b8ed53d468
+19 -5
View File
@@ -33,6 +33,7 @@ ADDON_PATH="$REGISTRY_ROOT/python/functions/cybersecurity/rotate_capture_flows.p
START_FN="$REGISTRY_ROOT/bash/functions/cybersecurity/start_mitm_capture.sh" START_FN="$REGISTRY_ROOT/bash/functions/cybersecurity/start_mitm_capture.sh"
QUERY_FN="$REGISTRY_ROOT/bash/functions/cybersecurity/query_mitm_flows.sh" QUERY_FN="$REGISTRY_ROOT/bash/functions/cybersecurity/query_mitm_flows.sh"
BROWSER_FN="$REGISTRY_ROOT/bash/functions/browser/launch_chromium_proxy.sh" BROWSER_FN="$REGISTRY_ROOT/bash/functions/browser/launch_chromium_proxy.sh"
EXT_DIR="$SCRIPT_DIR/extension"
# --- Configuracion ----------------------------------------------------------- # --- Configuracion -----------------------------------------------------------
@@ -225,7 +226,7 @@ cmd_status() {
} }
cmd_browser() { cmd_browser() {
local url="" proxy_port show_ui="yes" web_port local url="" proxy_port show_ui="yes" web_port mode="ext"
proxy_port="$(conf_get PORT "$DEFAULT_PORT")" proxy_port="$(conf_get PORT "$DEFAULT_PORT")"
web_port="$(conf_get WEB_PORT "")" web_port="$(conf_get WEB_PORT "")"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
@@ -233,6 +234,8 @@ cmd_browser() {
--url) url="$2"; shift 2 ;; --url) url="$2"; shift 2 ;;
--port) proxy_port="$2"; shift 2 ;; --port) proxy_port="$2"; shift 2 ;;
--no-ui) show_ui="no"; shift ;; --no-ui) show_ui="no"; shift ;;
--fixed) mode="fixed"; shift ;; # proxy siempre activo, sin extension
--ext) mode="ext"; shift ;; # extension con toggle (default)
*) err "browser: flag desconocido: $1"; return 2 ;; *) err "browser: flag desconocido: $1"; return 2 ;;
esac esac
done done
@@ -242,11 +245,22 @@ cmd_browser() {
return 1 return 1
fi fi
local args=(--proxy "http://127.0.0.1:${proxy_port}" --profile "$WEB_PROXY_HOME/chromium-profile") local args=(--profile "$WEB_PROXY_HOME/chromium-profile")
if [[ "$mode" == "fixed" ]]; then
# Proxy fijo: captura desde el primer request, sin toggle.
args+=(--proxy "http://127.0.0.1:${proxy_port}")
else
# Modo extension: la extension web_proxy toggle controla el proxy. Se
# carga desempaquetada y el navegador arranca SIN proxy fijo (toggle
# OFF por defecto). Un clic en su icono activa la captura.
args+=(--proxy none --ext "$EXT_DIR")
info "Extension de captura cargada. Clic en su icono (barra de extensiones) para ACTIVAR el proxy."
info "El proxy activo por defecto es 127.0.0.1:${proxy_port} (Captura web_proxy)."
fi
# Primera pestaña: la UI de registros en vivo (si el servicio corre en modo # Primera pestaña: la UI de registros en vivo (si el servicio corre en modo
# web). La UI es loopback y no se proxea (proxy-bypass de loopback), asi que # web). La UI es loopback y no se proxea, asi que carga directa. Las pestañas
# carga directa. Las pestañas a sitios reales si pasan por el proxy y van # a sitios reales pasan por el proxy y aparecen en la UI en tiempo real.
# apareciendo en la UI en tiempo real.
local ui_url="" local ui_url=""
[[ "$show_ui" == "yes" && -n "$web_port" ]] && ui_url="http://127.0.0.1:${web_port}" [[ "$show_ui" == "yes" && -n "$web_port" ]] && ui_url="http://127.0.0.1:${web_port}"
if [[ -n "$ui_url" ]]; then if [[ -n "$ui_url" ]]; then