From 5aa37e7221713b1c6de42c8098f9621288ac34f4 Mon Sep 17 00:00:00 2001 From: Ricardo Monla Date: Thu, 19 Mar 2026 09:52:29 -0300 Subject: [PATCH] =?UTF-8?q?[P2604]=20Fase=2015:=20Optimizaci=C3=B3n=20IA?= =?UTF-8?q?=20e=20integraci=C3=B3n=20de=20herramienta=20candados.=20Sincro?= =?UTF-8?q?nizaci=C3=B3n=20de=20bit=C3=A1coras=20y=20actualizaci=C3=B3n=20?= =?UTF-8?q?de=20planes=20de=20proyecto.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adn/01_ontologia.md | 2 +- adn/02_bitacora.md | 3 + adn/04_iconografia.md | 12 + adn/05_ia.md | 3 + adn/06_gobernanza.md | 2 +- adn/07_proyectos.md | 1 + .../_legacy_sonda_w-zombi}/README.md | 0 .../_hist/_legacy_sonda_w-zombi/bin/w-zombi | 43 + .../_hist/_legacy_sonda_w-zombi/cmd.json | 1 + adn/tools/_hist/_legacy_sonda_w-zombi/cmd.txt | 1 + .../_hist/_legacy_sonda_w-zombi/data/cmd.json | 1 + .../data/telemetria.log.bak | 2215 +++++++++++++++++ .../lib/wzombi/command_store.rb | 25 + .../lib/wzombi/config.rb | 22 + .../lib/wzombi/engine/ps1_builder.rb | 36 + .../lib/wzombi/logger.rb | 12 + .../lib/wzombi/routes/cmd.rb | 16 + .../lib/wzombi/routes/log.rb | 14 + .../lib/wzombi/routes/zombi.rb | 17 + .../lib/wzombi/server.rb | 25 + .../payloads/.gitignore | 0 .../payloads/dasu-pcv-0-ssh.ps1 | 65 + .../payloads/deploy_keys.ps1 | 41 + .../payloads/fix_key_encoding.ps1 | 27 + .../payloads/fix_logs.ps1 | 11 + .../payloads/fix_perfect_acl.ps1 | 28 + .../payloads/fix_ssh.ps1 | 15 + .../payloads/fix_ssh_rsa.ps1 | 33 + .../payloads/install_ssh.ps1 | 74 + .../payloads/join_domain_v2.ps1 | 1 + .../payloads/rebuild_sshd_config.ps1 | 21 + .../payloads/start_debug_sshd.ps1 | 13 + .../payloads/tailscale.ps1 | 68 + .../_hist/_legacy_sonda_w-zombi/test_key | 49 + .../_hist/_legacy_sonda_w-zombi/test_key.pub | 1 + adn/tools/_hist/sonda_w-zombi/README.md | 60 + .../_hist/sonda_w-zombi/payloads/.gitignore | 1 + .../sonda_w-zombi/payloads/activo.ps1 | 0 .../payloads/deploy_sysdasuten.ps1 | 0 .../sonda_w-zombi/payloads/install_ssh.ps1 | 0 .../payloads/install_ssh_fixtemp.ps1 | 0 .../payloads/install_ssh_legacy.ps1 | 0 .../sonda_w-zombi/payloads/setup.ps1 | 0 .../sonda_w-zombi/payloads/sonda.ps1 | 0 .../payloads/sql_sysadmin_fix.ps1 | 0 .../sonda_w-zombi/payloads/ssh_port7022.ps1 | 0 .../sonda_w-zombi/payloads/zombi_agent.bat | 0 .../{ => _hist}/sonda_w-zombi/servidor.rb | 0 adn/tools/_hist/wzombi/bin/w-zombi | 43 + adn/tools/_hist/wzombi/cmd.txt | 0 adn/tools/_hist/wzombi/data/cmd.json | 1 + .../_hist/wzombi/lib/wzombi/command_store.rb | 25 + adn/tools/_hist/wzombi/lib/wzombi/config.rb | 22 + .../wzombi/lib/wzombi/engine/ps1_builder.rb | 36 + adn/tools/_hist/wzombi/lib/wzombi/logger.rb | 12 + .../_hist/wzombi/lib/wzombi/routes/cmd.rb | 16 + .../_hist/wzombi/lib/wzombi/routes/log.rb | 14 + .../_hist/wzombi/lib/wzombi/routes/zombi.rb | 15 + adn/tools/_hist/wzombi/lib/wzombi/server.rb | 25 + .../{seguridad => candados}/.boveda.json | 3 +- adn/tools/candados/.session | 1 + adn/tools/{seguridad => candados}/README.md | 0 adn/tools/{seguridad => candados}/candados.rb | 0 adn/tools/cli/ayuda.rb | 466 ++-- adn/tools/cli/backup.rb | 74 +- adn/tools/cli/backup.rb.backup | 654 +++++ adn/tools/cli/candados.rb | 30 + adn/tools/cli/conocimiento.rb | 26 +- adn/tools/cli/contexto.rb | 32 +- adn/tools/cli/db.rb | 141 +- adn/tools/cli/generar.rb | 35 +- adn/tools/cli/jornada.rb | 42 +- adn/tools/cli/network.rb | 384 +++ adn/tools/cli/nodos.rb | 43 +- adn/tools/cli/nodos/info.rb | 29 +- adn/tools/cli/proceso.rb | 27 +- adn/tools/cli/ssh.rb | 167 +- adn/tools/cli/triggers.rb | 45 +- adn/tools/cli/wzombi.rb | 97 + adn/tools/db/core/bitacora_db.rb | 52 +- adn/tools/proy/generador.rb | 58 + adn/tools/proy/plantillas.rb | 109 + adn/tools/proy/proy.rb | 64 + adn/tools/run | 13 +- adn/tools/seguridad/.session | 1 - adn/tools/w-zombi/bin/w-zombi | 43 + adn/tools/w-zombi/data/cmd.json | 1 + adn/tools/w-zombi/lib/wzombi/command_store.rb | 25 + adn/tools/w-zombi/lib/wzombi/config.rb | 22 + .../w-zombi/lib/wzombi/engine/ps1_builder.rb | 46 + adn/tools/w-zombi/lib/wzombi/logger.rb | 12 + adn/tools/w-zombi/lib/wzombi/routes/cmd.rb | 16 + adn/tools/w-zombi/lib/wzombi/routes/log.rb | 14 + adn/tools/w-zombi/lib/wzombi/routes/zombi.rb | 17 + adn/tools/w-zombi/lib/wzombi/server.rb | 25 + adn/triggers.yml | 2 +- docs/prompt/260316-0812_Continua.md | 12 +- .../{plan => }/P2601.06.01_Red-SrvDasu.md | 0 .../{plan => }/P2601.06.02_AD-Join.md | 0 .../P2601.07.01_Integracion-DASU-PC-0.md | 49 + docs/proy/P2601_Dasuten/P2601_dasuten.md | 26 +- docs/proy/P2602_Backups/P2602_backups.md | 15 + docs/proy/P2603_Bitacoras/P2603_bitacoras.md | 14 + .../P2604.01.01_Estandarizacion-Ayudas-ADN.md | 76 + .../P2604.02.01_Generacion-Proyectos-ADN.md | 66 + .../P2604.03.01_Plan-W-ZOMBI-v2.0.md | 53 + ...4.04.01_Estandarizacion-Barras-Progreso.md | 47 + .../P2604.05.01_Estudio-Friccion-IA.md | 39 + ...04_mejoras_ADN.md => P2604_Mejoras-ADN.md} | 51 +- .../_hist/adn_proy_cli/tools/cli/proy.rb | 51 + .../adn_proy_cli/tools/cli/proy/generador.rb | 20 + .../adn_proy_cli/tools/cli/proy/plantillas.rb | 85 + .../adn_proy_cli/tools/core/help_formatter.rb | 26 + .../P2604_Mejoras-ADN/_hist/w-zombi_v1.2.md | 311 +++ .../_hist/w-zombi_v2.0/bin/w-zombi | 43 + .../_hist/w-zombi_v2.0/data/cmd.json | 1 + .../w-zombi_v2.0/lib/wzombi/command_store.rb | 25 + .../_hist/w-zombi_v2.0/lib/wzombi/config.rb | 22 + .../lib/wzombi/engine/ps1_builder.rb | 36 + .../_hist/w-zombi_v2.0/lib/wzombi/logger.rb | 12 + .../w-zombi_v2.0/lib/wzombi/routes/cmd.rb | 16 + .../w-zombi_v2.0/lib/wzombi/routes/log.rb | 14 + .../w-zombi_v2.0/lib/wzombi/routes/zombi.rb | 15 + .../_hist/w-zombi_v2.0/lib/wzombi/server.rb | 25 + .../P2605_Migracion_Solo_Bitacoras_Web.md | 13 + docs/proy/adn_cli_v2.rb | 156 ++ docs/proy/plantillas_adn.md | 217 ++ nodos/dasu-pc-0.md | 25 + nodos/dasu-pcv-0.md | 2 +- nodos/dasu-srvv-dc.md | 6 +- nodos/dasu-srvv-sql.md | 44 +- nodos/pc-dasu0.md | 24 - nodos/srv-dasu.md | 9 +- servicios/nginx/conf.d/bitacoras.conf | 3 +- .../dtic-bitacoras/frontend/package-lock.json | 1477 ++++++++++- .../dtic-bitacoras/frontend/package.json | 6 +- .../nginx/dtic-bitacoras/frontend/src/App.tsx | 112 +- .../frontend/src/pages/ProyectoDashboard.tsx | 13 +- 138 files changed, 8777 insertions(+), 464 deletions(-) rename adn/tools/{sonda_w-zombi => _hist/_legacy_sonda_w-zombi}/README.md (100%) create mode 100755 adn/tools/_hist/_legacy_sonda_w-zombi/bin/w-zombi create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/cmd.json create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/cmd.txt create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/data/cmd.json create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/data/telemetria.log.bak create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/command_store.rb create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/config.rb create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/engine/ps1_builder.rb create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/logger.rb create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/cmd.rb create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/log.rb create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/zombi.rb create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/server.rb rename adn/tools/{sonda_w-zombi => _hist/_legacy_sonda_w-zombi}/payloads/.gitignore (100%) create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/dasu-pcv-0-ssh.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/deploy_keys.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_key_encoding.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_logs.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_perfect_acl.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_ssh.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_ssh_rsa.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/install_ssh.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/join_domain_v2.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/rebuild_sshd_config.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/start_debug_sshd.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/payloads/tailscale.ps1 create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/test_key create mode 100644 adn/tools/_hist/_legacy_sonda_w-zombi/test_key.pub create mode 100644 adn/tools/_hist/sonda_w-zombi/README.md create mode 100644 adn/tools/_hist/sonda_w-zombi/payloads/.gitignore rename adn/tools/{ => _hist}/sonda_w-zombi/payloads/activo.ps1 (100%) rename adn/tools/{ => _hist}/sonda_w-zombi/payloads/deploy_sysdasuten.ps1 (100%) rename adn/tools/{ => _hist}/sonda_w-zombi/payloads/install_ssh.ps1 (100%) rename adn/tools/{ => _hist}/sonda_w-zombi/payloads/install_ssh_fixtemp.ps1 (100%) rename adn/tools/{ => _hist}/sonda_w-zombi/payloads/install_ssh_legacy.ps1 (100%) rename adn/tools/{ => _hist}/sonda_w-zombi/payloads/setup.ps1 (100%) rename adn/tools/{ => _hist}/sonda_w-zombi/payloads/sonda.ps1 (100%) rename adn/tools/{ => _hist}/sonda_w-zombi/payloads/sql_sysadmin_fix.ps1 (100%) rename adn/tools/{ => _hist}/sonda_w-zombi/payloads/ssh_port7022.ps1 (100%) rename adn/tools/{ => _hist}/sonda_w-zombi/payloads/zombi_agent.bat (100%) rename adn/tools/{ => _hist}/sonda_w-zombi/servidor.rb (100%) create mode 100755 adn/tools/_hist/wzombi/bin/w-zombi create mode 100644 adn/tools/_hist/wzombi/cmd.txt create mode 100644 adn/tools/_hist/wzombi/data/cmd.json create mode 100644 adn/tools/_hist/wzombi/lib/wzombi/command_store.rb create mode 100644 adn/tools/_hist/wzombi/lib/wzombi/config.rb create mode 100644 adn/tools/_hist/wzombi/lib/wzombi/engine/ps1_builder.rb create mode 100644 adn/tools/_hist/wzombi/lib/wzombi/logger.rb create mode 100644 adn/tools/_hist/wzombi/lib/wzombi/routes/cmd.rb create mode 100644 adn/tools/_hist/wzombi/lib/wzombi/routes/log.rb create mode 100644 adn/tools/_hist/wzombi/lib/wzombi/routes/zombi.rb create mode 100644 adn/tools/_hist/wzombi/lib/wzombi/server.rb rename adn/tools/{seguridad => candados}/.boveda.json (88%) create mode 100644 adn/tools/candados/.session rename adn/tools/{seguridad => candados}/README.md (100%) rename adn/tools/{seguridad => candados}/candados.rb (100%) create mode 100644 adn/tools/cli/backup.rb.backup create mode 100644 adn/tools/cli/candados.rb create mode 100644 adn/tools/cli/network.rb create mode 100644 adn/tools/cli/wzombi.rb create mode 100644 adn/tools/proy/generador.rb create mode 100644 adn/tools/proy/plantillas.rb create mode 100644 adn/tools/proy/proy.rb delete mode 100644 adn/tools/seguridad/.session create mode 100755 adn/tools/w-zombi/bin/w-zombi create mode 100644 adn/tools/w-zombi/data/cmd.json create mode 100644 adn/tools/w-zombi/lib/wzombi/command_store.rb create mode 100644 adn/tools/w-zombi/lib/wzombi/config.rb create mode 100644 adn/tools/w-zombi/lib/wzombi/engine/ps1_builder.rb create mode 100644 adn/tools/w-zombi/lib/wzombi/logger.rb create mode 100644 adn/tools/w-zombi/lib/wzombi/routes/cmd.rb create mode 100644 adn/tools/w-zombi/lib/wzombi/routes/log.rb create mode 100644 adn/tools/w-zombi/lib/wzombi/routes/zombi.rb create mode 100644 adn/tools/w-zombi/lib/wzombi/server.rb rename docs/proy/P2601_Dasuten/{plan => }/P2601.06.01_Red-SrvDasu.md (100%) rename docs/proy/P2601_Dasuten/{plan => }/P2601.06.02_AD-Join.md (100%) create mode 100644 docs/proy/P2601_Dasuten/P2601.07.01_Integracion-DASU-PC-0.md create mode 100644 docs/proy/P2604_Mejoras-ADN/P2604.01.01_Estandarizacion-Ayudas-ADN.md create mode 100644 docs/proy/P2604_Mejoras-ADN/P2604.02.01_Generacion-Proyectos-ADN.md create mode 100644 docs/proy/P2604_Mejoras-ADN/P2604.03.01_Plan-W-ZOMBI-v2.0.md create mode 100644 docs/proy/P2604_Mejoras-ADN/P2604.04.01_Estandarizacion-Barras-Progreso.md create mode 100644 docs/proy/P2604_Mejoras-ADN/P2604.05.01_Estudio-Friccion-IA.md rename docs/proy/P2604_Mejoras-ADN/{P2604_mejoras_ADN.md => P2604_Mejoras-ADN.md} (76%) create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/adn_proy_cli/tools/cli/proy.rb create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/adn_proy_cli/tools/cli/proy/generador.rb create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/adn_proy_cli/tools/cli/proy/plantillas.rb create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/adn_proy_cli/tools/core/help_formatter.rb create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/w-zombi_v1.2.md create mode 100755 docs/proy/P2604_Mejoras-ADN/_hist/w-zombi_v2.0/bin/w-zombi create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/w-zombi_v2.0/data/cmd.json create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/w-zombi_v2.0/lib/wzombi/command_store.rb create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/w-zombi_v2.0/lib/wzombi/config.rb create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/w-zombi_v2.0/lib/wzombi/engine/ps1_builder.rb create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/w-zombi_v2.0/lib/wzombi/logger.rb create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/w-zombi_v2.0/lib/wzombi/routes/cmd.rb create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/w-zombi_v2.0/lib/wzombi/routes/log.rb create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/w-zombi_v2.0/lib/wzombi/routes/zombi.rb create mode 100644 docs/proy/P2604_Mejoras-ADN/_hist/w-zombi_v2.0/lib/wzombi/server.rb create mode 100644 docs/proy/adn_cli_v2.rb create mode 100644 docs/proy/plantillas_adn.md create mode 100644 nodos/dasu-pc-0.md delete mode 100644 nodos/pc-dasu0.md diff --git a/adn/01_ontologia.md b/adn/01_ontologia.md index aff61336..9f041093 100644 --- a/adn/01_ontologia.md +++ b/adn/01_ontologia.md @@ -74,7 +74,7 @@ Facultad Regional La Rioja | Nodo | Ubicación | Descripción | | :--- | :--- | :--- | | **[cam-hikvision-24](../nodos/cam-hikvision-24.md)** | `10.0.10.24` | Cámara / DVR | -| **[pc-dasu0](../nodos/pc-dasu0.md)** | Oficina DASUTEN | Win10 Físico (Ryzen 5) | +| **[dasu-pc-0](../nodos/dasu-pc-0.md)** | Oficina DASUTEN | Win10 Físico (Ryzen 5) | | **[srv-dasu](../nodos/srv-dasu.md)** | Oficina DASUTEN | Proxmox VE Físico (Standalone) | --- diff --git a/adn/02_bitacora.md b/adn/02_bitacora.md index c4340090..74bb5dc8 100644 --- a/adn/02_bitacora.md +++ b/adn/02_bitacora.md @@ -33,6 +33,9 @@ Esta hebra define el formato, estructura y reglas de sincronización de las bit - **E (Estado [Modo])**: Combinación de Modo (`[P]` Presencial / `[R]` Remoto) y Estado Semántico (`✅`, `⏳`, `👁️`, `⚠️`). Ejemplo: `[P] ✅`. - **Estados (Tema)**: Estrictamente delimitados para trazabilidad (✅ Cerrado, ⏳ En Proceso, ⚠️ Fallo). - **Semántica (General)**: Uso de una taxonomía visual rica para escaneo visual ultrarrápido (ver hebra [04_iconografia.md](04_iconografia.md)). +- **Trazabilidad de Proyectos (Prefijos)**: Cuando una actividad forme parte de un plan formalizado en `docs/proy/`, la descripción del evento en la bitácora DEBE comenzar con el código del plan entre corchetes. + - **Formato**: `[PROY.FASE.ITEM] Descripción de la actividad` + - **Ejemplo**: `[P2601.07.01] Configuración de DNS en dasu-pc-0` - **Auto-Registro (IA)**: Cualquier acción técnica autónoma de la IA **DEBE** registrarse explícitamente en las tablas cronológicas indicando "(IA)" y el respectivo emoji semántico. ### 3.1 Ejemplo Estructural diff --git a/adn/04_iconografia.md b/adn/04_iconografia.md index c53773fe..d5c5073d 100644 --- a/adn/04_iconografia.md +++ b/adn/04_iconografia.md @@ -35,3 +35,15 @@ Representan la **naturaleza técnica** de la acción dentro de las tablas cronol | 📝 | **Documentación** | Actualización del ADN, manuales, reportes, logs manuales. | | 🧬 | **ADN** | Refactorización o evolución de las hebras del ADN. | | 🛡️ | **Seguridad** | Hardening, auditoría de accesos, bóveda de secretos. | + +## 3. Indicadores de Progreso (Manifiestos y Planes) + +Utilizados para representar el porcentaje de completitud de fases en proyectos y planes detallados. + +| Elemento | Carácter | Uso | +| :--- | :---: | :--- | +| Bloque Completo | `█` | Representa un 10% de avance. | +| Bloque Pendiente | `░` | Representa un 10% de carencia. | + +### Formato Estándar +`Fase N: ██████░░░░ 60% Nombre de la Fase` (Longitud fija de 10 bloques). diff --git a/adn/05_ia.md b/adn/05_ia.md index a68c6cee..40a3b7e1 100644 --- a/adn/05_ia.md +++ b/adn/05_ia.md @@ -22,6 +22,9 @@ Sincronización en cascada entre secciones de la bitácora. Ver hebra [`02_bitac ### 5. Iconografía Título Principal = Estado (ej. ✅, ⏳, ➡️). Eventos cronológicos = Emojis semánticos al inicio de la celda de tiempo. Ver hebra [`04_iconografia.md`](04_iconografia.md). +### 5.1 Trazabilidad de Proyectos +Toda entrada que responda a un plan de proyecto formalizado DEBE llevar el código identificador al inicio de la descripción: `[CODIGO] Detalle...`. Esto vincula inequívocamente el registro diario con la documentación técnica en `docs/proy/`. + ### 6. Armonía Consultar y seguir siempre las normativas vivas del ADN. Ver hebra [`06_gobernanza.md`](06_gobernanza.md). diff --git a/adn/06_gobernanza.md b/adn/06_gobernanza.md index 6028ceb1..3796009b 100644 --- a/adn/06_gobernanza.md +++ b/adn/06_gobernanza.md @@ -7,7 +7,7 @@ Esta hebra establece las reglas fundamentales de idioma, nomenclatura, coherenci ## 1. Idioma y Nomenclatura - **Directiva**: **Todo el contenido debe estar en español.** -- **Nomenclatura de Nodos**: Estrictamente **minúsculas** en nombres de archivo y referencias (ej: `srv-ns8`, `pc-dasu0`, `srvv-maurik`). +- **Nomenclatura de Nodos**: Estrictamente **minúsculas** en nombres de archivo y referencias (ej: `srv-ns8`, `dasu-pc-0`, `srvv-maurik`). - **Alcance**: - Interacciones con el asistente (chat). - Documentación (archivos `.md`). diff --git a/adn/07_proyectos.md b/adn/07_proyectos.md index 1fb354e7..d32133b5 100644 --- a/adn/07_proyectos.md +++ b/adn/07_proyectos.md @@ -75,6 +75,7 @@ Cada proyecto debe tener un archivo manifiesto con las siguientes secciones: | **Nodos Involucrados** | Qué infraestructura participa (links a `nodos/`). Categorizar en **Core** y **Soporte**. | | **Herramientas** | Software, scripts y servicios utilizados. | | **Hitos Clave** | Timeline de alto nivel con estados y fechas. | +| **Progreso** | Indicadores visuales mediante barras Unicode de completitud de fases. | | **Referencias** | Links a bitácoras, nodos, documentos técnicos. | ### Secciones Opcionales diff --git a/adn/tools/sonda_w-zombi/README.md b/adn/tools/_hist/_legacy_sonda_w-zombi/README.md similarity index 100% rename from adn/tools/sonda_w-zombi/README.md rename to adn/tools/_hist/_legacy_sonda_w-zombi/README.md diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/bin/w-zombi b/adn/tools/_hist/_legacy_sonda_w-zombi/bin/w-zombi new file mode 100755 index 00000000..c75f5c94 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/bin/w-zombi @@ -0,0 +1,43 @@ +#!/usr/bin/env ruby +require_relative '../lib/wzombi/config' +require_relative '../lib/wzombi/server' +require_relative '../lib/wzombi/command_store' + +base = File.expand_path("..", __dir__) +config = WZombi::Config.new(base_path: base) + +def help + puts <<~HELP + Uso: + w-zombi start + w-zombi cmd "" + w-zombi ayuda | -h | -help + + Ejemplo ADN: + adn tools w-zombi cmd "ipconfig" + HELP +end + +cmd = ARGV[0] + +case cmd +when "start" + WZombi::Server.new(config).start + +when "cmd" + command = ARGV[1] + if command.nil? + puts "Falta comando" + exit + end + store = WZombi::CommandStore.new(config.cmd_path) + store.update(command) + puts "Comando actualizado: #{command}" + +when "ayuda", "-h", "-help", nil + help + +else + puts "Comando desconocido" + help +end diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/cmd.json b/adn/tools/_hist/_legacy_sonda_w-zombi/cmd.json new file mode 100644 index 00000000..35e8c865 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/cmd.json @@ -0,0 +1 @@ +{"id":"1773805876","cmd":"whoami","status":"pending"} \ No newline at end of file diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/cmd.txt b/adn/tools/_hist/_legacy_sonda_w-zombi/cmd.txt new file mode 100644 index 00000000..e46dbd3c --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/cmd.txt @@ -0,0 +1 @@ +NO_CMD diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/data/cmd.json b/adn/tools/_hist/_legacy_sonda_w-zombi/data/cmd.json new file mode 100644 index 00000000..3e0558b5 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/data/cmd.json @@ -0,0 +1 @@ +{"id":0,"cmd":""} \ No newline at end of file diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/data/telemetria.log.bak b/adn/tools/_hist/_legacy_sonda_w-zombi/data/telemetria.log.bak new file mode 100644 index 00000000..33b227f3 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/data/telemetria.log.bak @@ -0,0 +1,2215 @@ +[16:18:19] ????????? (Zombi) v3.2 ONLINE - Esperando ordenes... +[16:19:44] >>> EJECUTANDO [ID:1773746383]: hostname; ipconfig | findstr IPv4 +[16:19:44] <<< FIN [ID:1773746383] (@0.1415934s): +dasu-srvv-sql + Direcci?n IPv4 de configuraci?n autom?tica: 169.254.83.107 + Direcci?n IPv4. . . . . . . . . . . . . . : 10.0.100.11 +[16:21:24] >>> EJECUTANDO [ID:1773746479]: http://100.111.195.4:8000/payloads/install_ssh.ps1 +TELEMETRIA: ========================================================== +TELEMETRIA: OPT ADN: GESTION INTELIGENTE DE OPENSSH SERVER (PORT 7022) +TELEMETRIA: ========================================================== +TELEMETRIA: Estado: NO INSTALADO. Iniciando instalacion... +TELEMETRIA: Caracteristica instalada con exito. +TELEMETRIA: Config: Puerto 7022 ya configurado en sshd_config. +TELEMETRIA: Firewall: Creando regla para puerto 7022... +TELEMETRIA: Servicio: sshd ya esta operando. +TELEMETRIA: OpenSSH Server verificado y operativo en el puerto 7022. +TELEMETRIA: ========================================================== +[16:22:30] !!! ERROR [ID:1773746479]: El trmino 'PS1' no se reconoce como nombre de un cmdlet, funcin, archivo de script o programa ejecutable. Compruebe si escribi correctamente el nombre o, si incluy una ruta de acceso, compruebe que dicha ruta es correcta e intntelo de nuevo. +[16:23:07] >>> EJECUTANDO [ID:1773746587]: http://100.111.195.4:8000/payloads/deploy_keys.ps1 +[SSH-KEY] Iniciando despliegue de llaves... +[SSH-KEY] Archivo escrito en C:\ProgramData\ssh\administrators_authorized_keys +[SSH-KEY] ERROR: Excepcin al llamar a "SetAccessRule" con los argumentos "1": "No se pudieron convertir algunas o todas las referencias de identidad." +[SSH-KEY] <<< FIN [ID:1773746587] (@1.1163976s): + + + +[16:23:40] >>> EJECUTANDO [ID:1773746617]: http://100.111.195.4:8000/payloads/deploy_keys.ps1 +[SSH-KEY] Iniciando despliegue de llaves... +[SSH-KEY] Archivo escrito en C:\ProgramData\ssh\administrators_authorized_keys +[SSH-KEY] Permisos ACL configurados correctamente. +[SSH-KEY] sshd_config actualizado (PubkeyAuthentication yes) +[SSH-KEY] <<< FIN [ID:1773746617] (@1.2589362s): + + + + +[16:24:08] >>> EJECUTANDO [ID:1773746647]: http://100.111.195.4:8000/payloads/tailscale.ps1 +[16:24:08] ========================================================== +[16:24:08] 🚀 INICIANDO DESPLIEGUE DE TAILSCALE +[16:24:09] ========================================================== +[16:24:09] ℹ️ Tailscale ya se encuentra instalado. +[16:24:09] 🔄 Reiniciando estado de Tailscale... +[16:24:16] 🔑 Autenticando con el nodo... +[16:24:24] 📄 Resultado: tailscale.exe : backend error: invalid key: API key kAMzGsVWZn11CNTRL not valid +En lnea: 38 Carcter: 15 ++ ... $output = & $tailscalePath up --authkey=$authKey --force-reauth --a ... ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + CategoryInfo : NotSpecified: (backend error: ...CNTRL not valid:String) [], RemoteException + + FullyQualifiedErrorId : NativeCommandError + +[16:24:24] ⏳ Esperando 15s para estabilización... +[16:24:39] ⚠️ Estado: Logged out. +[16:24:39] ⚙️ Configurando servicio en modo automático... +[16:24:40] ========================================================== +[16:24:40] 🏁 OPERACION FINALIZADA +[16:24:40] ========================================================== +[16:24:40] <<< FIN [ID:1773746647] (@32.6375503s): +[16:25:28] >>> EJECUTANDO [ID:1773746724]: Get-Service sshd; Get-NetFirewallRule -DisplayName '*OpenSSH*' | Select-Object Name, Enabled; Get-Content 'C:\ProgramData\ssh\sshd_config' | Select-String 'Port' +[16:25:28] <<< FIN [ID:1773746724] (@0.4667939s): + +Status Name DisplayName +------ ---- ----------- +Running sshd OpenSSH SSH Server + +Name : OpenSSH-22 +Enabled : True + + +Name : OpenSSH-7022 +Enabled : True + + +Name : OpenSSH-Server-In-TCP +Enabled : True + + +Name : OpenSSH-Server-In-TCP-7022 +Enabled : True + + +IgnoreCase : True +LineNumber : 1 +Line : Port 7022 +Filename : InputStream +Path : InputStream +Pattern : Port +Context : +Matches : {0} + + +IgnoreCase : True +LineNumber : 59 +Line : #GatewayPorts no +Filename : InputStream +Path : InputStream +Pattern : Port +Context : +Matches : {0} + + + +[16:25:39] >>> EJECUTANDO [ID:1773746737]: Get-Service sshd | Select-Object Status; (Get-Content 'C:\ProgramData\ssh\sshd_config' -Raw) -match 'Port 7022' +[16:25:40] <<< FIN [ID:1773746737] (@0.0783305s): + + Status + ------ +Running +True + + +[16:25:50] >>> EJECUTANDO [ID:1773746750]: Restart-Service sshd -Force +[16:25:51] !!! ERROR [ID:1773746750]: No se puede abrir el servicio sshd en el equipo '.'. +[16:26:07] >>> EJECUTANDO [ID:1773746765]: whoami +[16:26:07] <<< FIN [ID:1773746765] (@0.1134971s): +dasu-srvv-sql\administrador +[16:27:15] >>> EJECUTANDO [ID:1773746834]: Restart-Computer -Force +[16:27:16] <<< FIN [ID:1773746834] (@0.2759523s): +[16:29:25] ????????? (Zombi) v3.2 ONLINE - Esperando ordenes... +[16:29:26] >>> EJECUTANDO [ID:1773746834]: Restart-Computer -Force +[16:31:11] ????????? (Zombi) v3.3 ONLINE - Esperando ordenes... +[16:31:38] >>> EJECUTANDO [ID:1773747095]: +Get-Service sshd; Get-NetTCPConnection -LocalPort 7022 -ErrorAction SilentlyContinue +[16:31:40] <<< FIN [ID:1773747095] (@1.9856779s): +[16:31:51] >>> EJECUTANDO [ID:1773747110]: +Get-Service sshd | Select-Object Name, Status, StartType | Out-String +[16:31:51] <<< FIN [ID:1773747110] (@0.0602938s): + +[16:32:07] >>> EJECUTANDO [ID:1773747126]: +whoami +[16:32:07] <<< FIN [ID:1773747126] (@0.1468901s): +dasu-srvv-sql\administrador +[16:32:18] >>> EJECUTANDO [ID:1773747138]: +Get-Service s* | Select-Object -First 5 | Out-String +[16:32:18] <<< FIN [ID:1773747138] (@0.1051709s): + +Status Name DisplayName +------ ---- ----------- +Stopped sacsvr Ayudante especial de la consola de ... +Running SamSs Administrador de cuentas de seguridad +Stopped SCardSvr Tarjeta inteligente +Stopped ScDeviceEnum Servicio de enumeracin de disposit... +Running Schedule Programador de tareas + + + +[16:33:00] >>> EJECUTANDO [ID:1773747179]: +Get-Service *ssh* | Select-Object Name, DisplayName, Status, StartType | Out-String +[16:33:01] <<< FIN [ID:1773747179] (@0.0480329s): + +Name DisplayName Status StartType +---- ----------- ------ --------- +ssh-agent OpenSSH Authentication Agent Stopped Manual + + + +[16:33:17] >>> EJECUTANDO [ID:1773747194]: +Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*' | Select-Object Name, State | Out-String +[16:33:21] <<< FIN [ID:1773747194] (@3.4641591s): + +Name State +---- ----- +OpenSSH.Server~~~~0.0.1.0 Installed + + + +[16:33:37] >>> EJECUTANDO [ID:1773747216]: +Test-Path C:\Windows\System32\OpenSSH\sshd.exe; Get-ChildItem C:\Windows\System32\OpenSSH\ | Out-String +[16:33:37] <<< FIN [ID:1773747216] (@0.2133179s): +True + + + Directorio: C:\Windows\System32\OpenSSH + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +-a---- 07/05/2021 16:17 396211 moduli +-a---- 07/05/2021 17:17 307712 scp.exe +-a---- 07/05/2021 16:17 307200 sftp-server.exe +-a---- 07/05/2021 17:17 374272 sftp.exe +-a---- 07/05/2021 17:17 481280 ssh-add.exe +-a---- 07/05/2021 17:17 382976 ssh-agent.exe +-a---- 07/05/2021 17:17 662016 ssh-keygen.exe +-a---- 07/05/2021 17:17 557568 ssh-keyscan.exe +-a---- 07/05/2021 16:17 151552 ssh-shellhost.exe +-a---- 07/05/2021 17:17 946176 ssh.exe +-a---- 07/05/2021 16:18 1008128 sshd.exe +-a---- 07/05/2021 16:17 2297 sshd_config_default + + + +[16:33:53] >>> EJECUTANDO [ID:1773747231]: +Start-Process -FilePath 'C:\Windows\System32\OpenSSH\sshd.exe' -ArgumentList '/install' -Wait; Get-Service sshd | Out-String +[16:33:54] <<< FIN [ID:1773747231] (@1.3754175s): + +[16:34:16] >>> EJECUTANDO [ID:1773747253]: +Get-Service | Where-Object { $_.Name -match 'ssh' } | Out-String +[16:34:16] <<< FIN [ID:1773747253] (@0.0876635s): + +Status Name DisplayName +------ ---- ----------- +Stopped ssh-agent OpenSSH Authentication Agent + + + +[16:34:27] >>> EJECUTANDO [ID:1773747267]: +New-Service -Name sshd -BinaryPathName 'C:\Windows\System32\OpenSSH\sshd.exe' -DisplayName 'OpenSSH SSH Server' -Description 'OpenSSH based secure shell (ssh) server, for secure connections from remote machines.' -StartupType Automatic; Start-Service sshd; Get-Service sshd | Out-String +[16:34:28] <<< FIN [ID:1773747267] (@0.8793786s): + +Status Name DisplayName +------ ---- ----------- +Stopped sshd OpenSSH SSH Server + +Status Name DisplayName +------ ---- ----------- +Running sshd OpenSSH SSH Server + + + + + +[16:35:00] >>> EJECUTANDO [ID:1773747299]: +New-NetFirewallRule -Name OpenSSH-Server-In-TCP-7022 -DisplayName 'OpenSSH Server (Port 7022)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 7022 -ErrorAction SilentlyContinue; Get-Content 'C:\ProgramData\ssh\sshd_config' | Select-String 'Port' +[16:35:00] <<< FIN [ID:1773747299] (@0.4072224s): + +Port 7022 +#GatewayPorts no + + +[16:35:21] >>> EJECUTANDO [ID:1773747319]: +Get-Content C:\ProgramData\ssh\administrators_authorized_keys | Select-Object -First 2 +[16:35:22] <<< FIN [ID:1773747319] (@0.1055216s): +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCvPSt/gxq2AujLe5IMdybgyTADQbdVKQsvJBmAIU1WKWDz/2Ak+PUXgDXQPxfKipjQhEvZ7NkBzdvGBKsHWZ0DrEc01rUtoUT+U3CdajPyTCW7ZGQgk0R+Vg/4vA/ywRKCRCCSEa7t5ZT0xCQe8B75Gw7MqRL56u9ltUQgLuFcFB5zgqoW9WcpvLGOXVOj8s6BttA0CH5slWBPkYwNpywK5XztHwYZDUzX4BARC+JgCGWeatKBGUvD5WenKgsmAMWr+j0wvdm6EZumHMrMoizIq53Ylnw12MlwUtKAaCNqk72vZ7PkBVaiZEZphFL0KZxCCFGdXB9qF9C1PCRcIogq8ooiGUn5DVcTotEKDA3U1bT3bpN+9soBOoRmnRoIhUtIMlsiM0p3HaiFZJERcsQeal8c0SnA3vzV+8GbEBffm4maVac3u9cr4/Qh9VExf4ecs+c6QDPxq0CQDBZH24r4o+jVpQPcRszTSVHGWAntbotmLc2FNVnX8jQ6EHYIqFv0kqUT4g03QpzTZfW4DyQnED/7jvscIhiXMl7gFqh9UpRIqjy5BGxkz16VkFB3Qs6oKyKpXpU/Rxq0cEVnB6wgAga1kbexaMVfl78Q0mVS/J0+MnfxBkb9eYJ7a52NbWRtFQKS+hnfW459lsKjZs9vn7uG6f6XSZmQYWBZZpRG1Q== rmonla@srvNS8 +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCXKpAG3zT+QpTGjBnXSmW7CgxhcJT89r45rpW46PsPSYhMVvQSm6nnZPscqlXbfNOCW9V5yAHlP4aCdlmb++crKq9GKdWTMQCyeV4SOvtBQYQutsjEgh8CO/IjMyW7VcDGGwPO7s604pqLaBidBuZLYfnrh6Wqo9AxnceZ6gBUhoM0dKXxnJEQhN/gf0w1R7KN9Jim67C7IOYmTAeNaqkrQZXUUpdPBRB4JWX3J//Rln5bFjI52bu4a7Izf9re1Q4/970U+6NtUJ3AXS7KdY0mjdNMqGfx341PdTAXgbj5Bz1PdolVuTAW2B0r5ZTpwyK1OkzSeiXHLrI9VRMr5uix2OF3rZr9LIjktSy/ByHerEtbbPOXTPoHFo6lnFJwCEfGMbj/GifZn8frZtC1y4p+ohB6gmEJe/dCGiucxaUCrxz1UShchIVm5SZ8r7P1K+FHNiMUvrRnVd+fxBs0SUFXJ8ixyh/W0CRMS26G7WqodGS976J+pBguzCPNz6QKqnq/+n9mGjdTYTHNBZMbqwia17trbt8eWEdX8Sf+4WTTjmYR54nHApgfyHN9tkjFhTp8xMTmgRQfbXW1EPBdI+Zj57qc9ds/PdoCaxbDUpoz51Mg99iL2vvgciYY8gKHYVksSKpFIDrzHN0IVA5ofX7+4HgKxWff4mOPJ0uEkhuDFw== rmonla@srv-dasu +[16:35:32] >>> EJECUTANDO [ID:1773747332]: +Get-Content 'C:\ProgramData\ssh\sshd_config' | Select-Object -Last 10 +[16:35:33] <<< FIN [ID:1773747332] (@0.0430976s): +Subsystem sftp sftp-server.exe + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server + +Match Group administrators + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys +[16:35:54] >>> EJECUTANDO [ID:1773747354]: +netstat -an | findstr 7022 +[16:35:54] <<< FIN [ID:1773747354] (@0.1794517s): + TCP 0.0.0.0:7022 0.0.0.0:0 LISTENING + TCP [::]:7022 [::]:0 LISTENING +[16:36:10] >>> EJECUTANDO [ID:1773747368]: +net localgroup Administradores | Out-String; net localgroup Administrators | Out-String +[16:36:11] <<< FIN [ID:1773747368] (@0.199354s): +Nombre de alias Administradores +Comentario Los administradores tienen acceso completo y sin restricciones al equipo o dominio + +Miembros + +------------------------------------------------------------------------------- +Administrador +DASUTEN\Domain Admins +Se ha completado el comando correctamente. + + + +[16:42:02] >>> EJECUTANDO [ID:1773747719]: +Get-Content C:\ProgramData\ssh\logs\sshd.log | Select-Object -Last 20 +[16:42:02] <<< FIN [ID:1773747719] (@0.0620559s): +[16:42:13] >>> EJECUTANDO [ID:1773747731]: +net localgroup Administrators +[16:42:13] <<< FIN [ID:1773747731] (@0.1485439s): +[16:42:29] >>> EJECUTANDO [ID:1773747745]: +(Get-Content C:\ProgramData\ssh\sshd_config) -replace 'Match Group administrators', 'Match Group Administradores' | Set-Content C:\ProgramData\ssh\sshd_config; Restart-Service sshd -Force +[16:42:30] <<< FIN [ID:1773747745] (@0.4024855s): +[16:43:28] >>> EJECUTANDO [ID:1773747806]: +Get-Acl C:\ProgramData\ssh\administrators_authorized_keys | Format-List; whoami /groups | Select-String 'Administradores' +[16:43:28] <<< FIN [ID:1773747806] (@0.4395173s): + + +Path : Microsoft.PowerShell.Core\FileSystem::C:\ProgramData\ssh\administrators_authorized_keys +Owner : NT AUTHORITY\SYSTEM +Group : DASU-SRVV-SQL\Ninguno +Access : NT AUTHORITY\SYSTEM Allow FullControl + BUILTIN\Administradores Allow FullControl +Audit : +Sddl : O:SYG:S-1-5-21-955788249-592386137-2439445177-513D:PAI(A;;FA;;;SY)(A;;FA;;;BA) + + + + +NT AUTHORITY\Cuenta local y miembro del grupo de administradores Grupo conocido S-1-5-114 Grupo obligatorio, +Habilitado de manera predeterminada, Grupo habilitado +BUILTIN\Administradores Alias S-1-5-32-544 Grupo obligatorio, +Habilitado de manera predeterminada, Grupo habilitado, Propietario de grupo + + +[16:43:44] >>> EJECUTANDO [ID:1773747823]: +Get-Content C:\ProgramData\ssh\logs\sshd.log -Tail 20 +[16:43:45] <<< FIN [ID:1773747823] (@0.058478s): +[16:44:01] >>> EJECUTANDO [ID:1773747836]: +Test-Path C:\ProgramData\ssh\logs\sshd.log; Get-Content C:\ProgramData\ssh\sshd_config | Select-String 'LogLevel,SyslogFacility' +[16:44:01] <<< FIN [ID:1773747836] (@0.0516564s): +False +[16:44:12] >>> EJECUTANDO [ID:1773747848]: +Get-Content C:\ProgramData\ssh\sshd_config +[16:44:12] <<< FIN [ID:1773747848] (@0.0521043s): +Port 7022 +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented. Uncommented options override the +# default value. + +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key + +# Ciphers and keying +#RekeyLimit default none + +# Logging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +#PermitRootLogin prohibit-password +#StrictModes yes +#MaxAuthTries 6 +#MaxSessions 10 + +PubkeyAuthentication yes + +# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 +# but this is overridden so installations will only check .ssh/authorized_keys +AuthorizedKeysFile .ssh/authorized_keys + +#AuthorizedPrincipalsFile none + +# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts +#HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# HostbasedAuthentication +#IgnoreUserKnownHosts no +# Don't read the user's ~/.rhosts and ~/.shosts files +#IgnoreRhosts yes + +# To disable tunneled clear text passwords, change to no here! +PasswordAuthentication yes +#PermitEmptyPasswords no + +# GSSAPI options +#GSSAPIAuthentication no + +#AllowAgentForwarding yes +#AllowTcpForwarding yes +#GatewayPorts no +#PermitTTY yes +#PrintMotd yes +#PrintLastLog yes +#TCPKeepAlive yes +#UseLogin no +#PermitUserEnvironment no +#ClientAliveInterval 0 +#ClientAliveCountMax 3 +#UseDNS no +#PidFile /var/run/sshd.pid +#MaxStartups 10:30:100 +#PermitTunnel no +#ChrootDirectory none +#VersionAddendum none + +# no default banner path +#Banner none + +# override default of no subsystems +Subsystem sftp sftp-server.exe + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server + +Match Group Administradores + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys +[16:44:28] >>> EJECUTANDO [ID:1773747865]: +Get-Service sshd; netstat -ano | findstr :7022 +[16:44:28] <<< FIN [ID:1773747865] (@0.1150663s): + +Status Name DisplayName +------ ---- ----------- +Running sshd OpenSSH SSH Server + TCP 0.0.0.0:7022 0.0.0.0:0 LISTENING 2388 + TCP [::]:7022 [::]:0 LISTENING 2388 + + +[16:51:29] >>> EJECUTANDO [ID:1773748285]: +hostname +[16:51:30] <<< FIN [ID:1773748285] (@0.1036511s): +dasu-srvv-sql +[16:53:52] >>> EJECUTANDO [ID:1773748429]: +http://100.111.195.4:8000/payloads/tailscale.ps1 +[16:53:52] ========================================================== +[16:53:52] 🚀 INICIANDO DESPLIEGUE DE TAILSCALE +[16:53:53] ========================================================== +[16:53:53] ℹ️ Tailscale ya se encuentra instalado. +[16:53:53] 🔄 Reiniciando estado de Tailscale... +[16:54:01] 🔑 Autenticando con el nodo... +[16:54:09] 📄 Resultado: +[16:54:09] ⏳ Esperando 15s para estabilización... +[16:54:24] ✨ Conexión establecida exitosamente. +[16:54:25] 📍 IP Tailscale: 100.107.24.124 +[16:54:25] ⚙️ Configurando servicio en modo automático... +[16:54:25] ========================================================== +[16:54:25] 🏁 OPERACION FINALIZADA +[16:54:26] ========================================================== +[16:54:26] <<< FIN [ID:1773748429] (@34.036063s): +[16:58:01] >>> EJECUTANDO [ID:1773748680]: +Get-Service sshd; Get-NetTCPConnection -LocalPort 7022 -ErrorAction SilentlyContinue | Select-Object LocalAddress, LocalPort, State | Out-String +[16:58:01] <<< FIN [ID:1773748680] (@0.3693213s): + +Status Name DisplayName +------ ---- ----------- +Running sshd OpenSSH SSH Server + +LocalAddress LocalPort State +------------ --------- ----- +:: 7022 Listen +100.107.24.124 7022 Established +0.0.0.0 7022 Listen + + + + + +[16:58:12] >>> EJECUTANDO [ID:1773748692]: +netstat -ano | findstr :7022 +[16:58:12] <<< FIN [ID:1773748692] (@0.1014265s): + TCP 0.0.0.0:7022 0.0.0.0:0 LISTENING 2388 + TCP 100.107.24.124:7022 100.111.195.4:50248 ESTABLISHED 2388 + TCP [::]:7022 [::]:0 LISTENING 2388 +[16:59:42] >>> EJECUTANDO [ID:1773748782]: +Get-Content C:\ProgramData\ssh\logs\sshd.log -Tail 30 | Out-String +[16:59:42] <<< FIN [ID:1773748782] (@0.060713s): + +[17:00:24] >>> EJECUTANDO [ID:1773748821]: +Get-Content C:\ProgramData\ssh\sshd_config | Select-String 'PubkeyAuthentication' +[17:00:24] <<< FIN [ID:1773748821] (@0.0424014s): + +PubkeyAuthentication yes + + +[17:01:33] >>> EJECUTANDO [ID:1773748890]: +net user; net localgroup Administradores +[17:01:33] <<< FIN [ID:1773748890] (@0.1544813s): + +Cuentas de usuario de \\DASU-SRVV-SQL + +------------------------------------------------------------------------------- +Administrador DefaultAccount Invitado +WDAGUtilityAccount +Se ha completado el comando correctamente. + +Nombre de alias Administradores +Comentario Los administradores tienen acceso completo y sin restricciones al equipo o dominio + +Miembros + +------------------------------------------------------------------------------- +Administrador +DASUTEN\Domain Admins +Se ha completado el comando correctamente. + +[17:01:49] >>> EJECUTANDO [ID:1773748907]: +Get-ComputerInfo | Select-Object CsDomain, CsDomainRole, CsWorkgroup +[17:01:52] <<< FIN [ID:1773748907] (@2.6325807s): + +CsDomain CsDomainRole CsWorkgroup +-------- ------------ ----------- +dasuten.utnlr MemberServer + + +[17:02:13] >>> EJECUTANDO [ID:1773748929]: +(Get-Content C:\ProgramData\ssh\sshd_config) -replace '#LogLevel INFO', 'LogLevel DEBUG1' | Set-Content C:\ProgramData\ssh\sshd_config; Restart-Service sshd -Force +[17:02:14] <<< FIN [ID:1773748929] (@0.3355704s): +[17:04:30] >>> EJECUTANDO [ID:1773749066]: +Get-Content C:\ProgramData\ssh\sshd_config | Select-String 'LogLevel'; Get-Content C:\ProgramData\ssh\logs\sshd.log -Tail 30 | Out-String +[17:04:30] <<< FIN [ID:1773749066] (@0.0561627s): + +LogLevel DEBUG1 + + + +[14:04:39] ????????? (Zombi) v3.4 ONLINE - Esperando ordenes... +[14:04:40] >>> EJECUTANDO [ID:1773749153]: + Test-Path C:\Users\admindasu; Get-ChildItem C:\Users\admindasu -Force | Out-String +[14:04:41] <<< FIN [ID:1773749153] (@0.5354499s): +True + + + Directorio: C:\Users\admindasu + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +d-r--- 28/2/2026 03:40 3D Objects +d--h-- 28/2/2026 03:40 AppData +d--hsl 28/2/2026 03:40 Configuracin local +d-r--- 28/2/2026 03:40 Contacts +d--hsl 28/2/2026 03:40 Cookies +d--hsl 28/2/2026 03:40 Datos de programa +d-r--- 16/3/2026 04:33 Desktop +d-r--- 28/2/2026 03:41 Documents +d-r--- 17/3/2026 13:41 Downloads +d--hsl 28/2/2026 03:40 Entorno de red +d-r--- 28/2/2026 03:40 Favorites +d--hsl 28/2/2026 03:40 Impresoras +d-r--- 28/2/2026 03:41 Links +d--hsl 28/2/2026 03:40 Men Inicio +d--hsl 28/2/2026 03:40 Mis documentos +d-r--- 28/2/2026 03:41 Music +d-r--- 28/2/2026 03:40 Pictures +d--hsl 28/2/2026 03:40 Plantillas +d--hsl 28/2/2026 03:40 Reciente +d-r--- 28/2/2026 03:41 Saved Games +d-r--- 28/2/2026 03:41 Searches +d--hsl 28/2/2026 03:40 SendTo +d-r--- 28/2/2026 03:40 Videos +-a-h-- 16/3/2026 20:48 1572864 NTUSER.DAT +-a-hs- 28/2/2026 03:40 65536 ntuser.dat.LOG1 +-a-hs- 28/2/2026 03:40 442368 ntuser.dat.LOG2 +-a-hs- 28/2/2026 04:25 65536 NTUSER.DAT{53b39e88-18c4-11ea-a811-000d3aa4692b}.TM.blf +-a-hs- 28/2/2026 03:40 524288 NTUSER.DAT{53b39e88-18c4-11ea-a811-000d3aa4692b}.TMContainer000000000 + 00000000001.regtrans-ms +-a-hs- 28/2/2026 03:40 524288 NTUSER.DAT{53b39e88-18c4-11ea-a811-000d3aa4692b}.TMContainer000000000 + 00000000002.regtrans-ms +---hs- 28/2/2026 03:40 20 ntuser.ini + + + + +[14:07:29] >>> EJECUTANDO [ID:1773752847]: + Get-Service sshd; Get-NetTCPConnection -LocalPort 7022; Test-Path C:\ProgramData\ssh\administrators_authorized_keys; Test-Path C:\Users\admindasu\.ssh\authorized_keys +[14:07:31] <<< FIN [ID:1773752847] (@2.5012537s): + +Status Name DisplayName +------ ---- ----------- +Running sshd OpenSSH SSH Server + +Caption : +Description : +ElementName : +InstanceID : ::++7022++::++0 +CommunicationStatus : +DetailedStatus : +HealthState : +InstallDate : +Name : +OperatingStatus : +OperationalStatus : +PrimaryStatus : +Status : +StatusDescriptions : +AvailableRequestedStates : +EnabledDefault : 2 +EnabledState : +OtherEnabledState : +RequestedState : 5 +TimeOfLastStateChange : +TransitioningToState : 12 +AggregationBehavior : +Directionality : +CreationTime : 16/3/2026 20:48:34 +LocalAddress : :: +LocalPort : 7022 +OwningProcess : 2640 +AppliedSetting : +OffloadState : InHost +RemoteAddress : :: +RemotePort : 0 +State : Listen +PSComputerName : + + +Caption : +Description : +ElementName : +InstanceID : 0.0.0.0++7022++0.0.0.0++0 +CommunicationStatus : +DetailedStatus : +HealthState : +InstallDate : +Name : +OperatingStatus : +OperationalStatus : +PrimaryStatus : +Status : +StatusDescriptions : +AvailableRequestedStates : +EnabledDefault : 2 +EnabledState : +OtherEnabledState : +RequestedState : 5 +TimeOfLastStateChange : +TransitioningToState : 12 +AggregationBehavior : +Directionality : +CreationTime : 16/3/2026 20:48:34 +LocalAddress : 0.0.0.0 +LocalPort : 7022 +OwningProcess : 2640 +AppliedSetting : +OffloadState : InHost +RemoteAddress : 0.0.0.0 +RemotePort : 0 +State : Listen +PSComputerName : + +True +False + + + +[14:08:13] >>> EJECUTANDO [ID:1773752893]: + Get-Content C:\ProgramData\ssh\administrators_authorized_keys +[14:08:14] <<< FIN [ID:1773752893] (@0.0965187s): +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCXKpAG3zT+QpTGjBnXSmW7CgxhcJT89r45rpW46PsPSYhMVvQSm6nnZPscqlXbfNOCW9V5yAHlP4aCdlmb++crKq9GKdWTMQCyeV4SOvtBQYQutsjEgh8CO/IjMyW7VcDGGwPO7s604pqLaBidBuZLYfnrh6Wqo9AxnceZ6gBUhoM0dKXxnJEQhN/gf0w1R7KN9Jim67C7IOYmTAeNaqkrQZXUUpdPBRB4JWX3J//Rln5bFjI52bu4a7Izf9re1Q4/970U+6NtUJ3AXS7KdY0mjdNMqGfx341PdTAXgbj5Bz1PdolVuTAW2B0r5ZTpwyK1OkzSeiXHLrI9VRMr5uix2OF3rZr9LIjktSy/ByHerEtbbPOXTPoHFo6lnFJwCEfGMbj/GifZn8frZtC1y4p+ohB6gmEJe/dCGiucxaUCrxz1UShchIVm5SZ8r7P1K+FHNiMUvrRnVd+fxBs0SUFXJ8ixyh/W0CRMS26G7WqodGS976J+pBguzCPNz6QKqnq/+n9mGjdTYTHNBZMbqwia17trbt8eWEdX8Sf+4WTTjmYR54nHApgfyHN9tkjFhTp8xMTmgRQfbXW1EPBdI+Zj57qc9ds/PdoCaxbDUpoz51Mg99iL2vvgciYY8gKHYVksSKpFIDrzHN0IVA5ofX7+4HgKxWff4mOPJ0uEkhuDFw== rmonla@srv-dasu + +[14:09:43] >>> EJECUTANDO [ID:1773752984]: + Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" +[14:09:48] <<< FIN [ID:1773752984] (@4.1719508s): + + +Name : OpenSSH-Server-In-TCP +DisplayName : OpenSSH SSH Server (sshd) +Description : Inbound rule for OpenSSH SSH Server (sshd) +DisplayGroup : OpenSSH Server +Group : OpenSSH Server +Enabled : True +Profile : Any +Platform : {} +Direction : Inbound +Action : Allow +EdgeTraversalPolicy : Block +LooseSourceMapping : False +LocalOnlyMapping : False +Owner : +PrimaryStatus : OK +Status : Se analiz la regla correctamente desde el almacn. (65536) +EnforcementStatus : NotApplicable +PolicyStoreSource : PersistentStore +PolicyStoreSourceType : Local +RemoteDynamicKeywordAddresses : +PolicyAppId : + + + + +[14:19:47] >>> EJECUTANDO [ID:1773753586]: + Get-Content C:\ProgramData\ssh\sshd_config | Select-String "Port", "AuthorizedKeysFile", "PubkeyAuthentication" +[14:19:48] <<< FIN [ID:1773753586] (@0.1784334s): + +Port 7022 +#PubkeyAuthentication yes +AuthorizedKeysFile .ssh/authorized_keys +#GatewayPorts no + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + + + +[14:20:30] >>> EJECUTANDO [ID:1773753628]: + icacls C:\ProgramData\ssh\administrators_authorized_keys +[14:20:30] <<< FIN [ID:1773753628] (@0.1169807s): +C:\ProgramData\ssh\administrators_authorized_keys NT AUTHORITY\SYSTEM:(I)(F) + BUILTIN\Administradores:(I)(F) + NT AUTHORITY\Usuarios autentificados:(I)(RX) + +Se procesaron correctamente 1 archivos; error al procesar 0 archivos + +[14:21:34] >>> EJECUTANDO [ID:1773753693]: + $path = "C:\ProgramData\ssh\administrators_authorized_keys"; $acl = Get-Acl $path; $acl.SetAccessRuleProtection($true, $false); $administratorsRule = New-Object System.Security.AccessControl.FileSystemAccessRule("BUILTIN\Administradores", "FullControl", "Allow"); $systemRule = New-Object System.Security.AccessControl.FileSystemAccessRule("NT AUTHORITY\SYSTEM", "FullControl", "Allow"); $acl.SetAccessRule($administratorsRule); $acl.SetAccessRule($systemRule); Set-Acl $path $acl; Restart-Service sshd +[14:21:34] <<< FIN [ID:1773753693] (@0.5957312s): + +[14:22:38] >>> EJECUTANDO [ID:1773753755]: + powershell -c "Get-ChildItem -Path C:\Users\admindasu" +[14:22:39] <<< FIN [ID:1773753755] (@0.852768s): + + + Directorio: C:\Users\admindasu + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +d-r--- 28/2/2026 03:40 3D Objects +d-r--- 28/2/2026 03:40 Contacts +d-r--- 16/3/2026 04:33 Desktop +d-r--- 28/2/2026 03:41 Documents +d-r--- 17/3/2026 13:41 Downloads +d-r--- 28/2/2026 03:40 Favorites +d-r--- 28/2/2026 03:41 Links +d-r--- 28/2/2026 03:41 Music +d-r--- 28/2/2026 03:40 Pictures +d-r--- 28/2/2026 03:41 Saved Games +d-r--- 28/2/2026 03:41 Searches +d-r--- 28/2/2026 03:40 Videos + + + +[14:23:42] >>> EJECUTANDO [ID:1773753822]: + powershell -c "New-Item -ItemType Directory -Force -Path C:\Users\admindasu\.ssh; Set-Content -Path C:\Users\admindasu\.ssh\authorized_keys -Value \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCXKpAG3zT+QpTGjBnXSmW7CgxhcJT89r45rpW46PsPSYhMVvQSm6nnZPscqlXbfNOCW9V5yAHlP4aCdlmb++crKq9GKdWTMQCyeV4SOvtBQYQutsjEgh8CO/IjMyW7VcDGGwPO7s604pqLaBidBuZLYfnrh6Wqo9AxnceZ6gBUhoM0dKXxnJEQhN/gf0w1R7KN9Jim67C7IOYmTAeNaqkrQZXUUpdPBRB4JWX3J//Rln5bFjI52bu4a7Izf9re1Q4/970U+6NtUJ3AXS7KdY0mjdNMqGfx341PdTAXgbj5Bz1PdolVuTAW2B0r5ZTpwyK1OkzSeiXHLrI9VRMr5uix2OF3rZr9LIjktSy/ByHerEtbbPOXTPoHFo6lnFJwCEfGMbj/GifZn8frZtC1y4p+ohB6gmEJe/dCGiucxaUCrxz1UShchIVm5SZ8r7P1K+FHNiMUvrRnVd+fxBs0SUFXJ8ixyh/W0CRMS26G7WqodGS976J+pBguzCPNz6QKqnq/+n9mGjdTYTHNBZMbqwia17trbt8eWEdX8Sf+4WTTjmYR54nHApgfyHN9tkjFhTp8xMTmgRQfbXW1EPBdI+Zj57qc9ds/PdoCaxbDUpoz51Mg99iL2vvgciYY8gKHYVksSKpFIDrzHN0IVA5ofX7+4HgKxWff4mOPJ0uEkhuDFw== rmonla@srv-dasu\"" +[14:23:43] <<< FIN [ID:1773753822] (@0.5433024s): + +[14:29:09] >>> EJECUTANDO [ID:1773754146]: + Add-Content -Path C:\ProgramData\ssh\administrators_authorized_keys -Value "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxCHrqnaVrkihb/0yBAxzcb9knhCAWSFFC9J6rEKHE4Yu5DW3XZ/aoWKFq1NEZS6yNQqBqFGvAe32RBwnX7RiJEkhYgS/xr2SJorIxTWWJUOmV5i7OopQQQoZ7YUoY56tdVrYaulJCDyJkvnmGZwGdUS782BEb9nWDwXd5t1qDZJtCWCV/xK34zRuTy7DqHPU3sx+PUwj0KWy8rQBeRK2KNvHCpcVTQvx4u1QS9Cbbqsic+BrZfaU1LBa70GdJL8GY9p1ZIlSqqPMyzcpILh7CwrnyNr7hj+kaKVIdzeo+0WIf97XsjD0dNNt5VPP3kBrnTA62EQ6eraZl7V01Hx6gK178K9C3fcgPHsxZASf8/Vo+zOeg3ChCYQFPF9YzSyQpAJE2yT7ptuzXulhifpRBIs9d8HS5+6mWYgaLPqwDpZRvYB5NsX96m2OX3LBIeeJm4ZEc4531jsvOJNPiok9SVg083aAUbflFKtWV5M01X54rT4+uU6Uy4LRQGXPr5Mor+BBZyZ91bTtX8nGOVZrQ3Cxm4jc0Q7Aj902SX4yqrImLuoM7XIbVTHGQt+gsgVSxEbb4KaF4jOvRZKYrDcSFrJN9KWcx5SLCDZmN4TlGqgbVPrfxHzF7BqLrzq+bcG+BVm3DP3ROBwAjbXPcztiaDHpPjWDiZByy5nHnzqmmCw== rmonla@srv-ns8" +[14:29:09] <<< FIN [ID:1773754146] (@0.058754s): + +[14:30:23] >>> EJECUTANDO [ID:1773754223]: + Get-Content C:\ProgramData\ssh\sshd_config | tail -n 15 +[14:30:24] !!! ERROR [ID:1773754223]: El trmino 'tail' no se reconoce como nombre de un cmdlet, funcin, archivo de script o programa ejecutable. Compruebe si escribi correctamente el nombre o, si incluy una ruta de acceso, compruebe que dicha ruta es correcta e intntelo de nuevo. +[14:31:22] >>> EJECUTANDO [ID:1773754283]: + Get-Content C:\ProgramData\ssh\sshd_config | Select-Object -Last 15 +[14:31:23] <<< FIN [ID:1773754283] (@0.0877766s): +# no default banner path +#Banner none + +# override default of no subsystems +Subsystem sftp sftp-server.exe + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server + +Match Group administrators + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + + +[14:32:10] >>> EJECUTANDO [ID:1773754330]: + powershell -c "Get-Acl C:\ProgramData\ssh\administrators_authorized_keys | Format-List" +[14:32:11] <<< FIN [ID:1773754330] (@0.9316798s): + + +Path : Microsoft.PowerShell.Core\FileSystem::C:\ProgramData\ssh\administrators_authorized_keys +Owner : BUILTIN\Administradores +Group : DASUTEN\Domain Users +Access : NT AUTHORITY\SYSTEM Allow FullControl + BUILTIN\Administradores Allow FullControl +Audit : +Sddl : O:BAG:DUD:PAI(A;;FA;;;SY)(A;;FA;;;BA) + + + + +[14:33:20] >>> EJECUTANDO [ID:1773754398]: + powershell -c "Get-Content C:\ProgramData\ssh\administrators_authorized_keys" +[14:33:21] <<< FIN [ID:1773754398] (@0.447384s): +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCXKpAG3zT+QpTGjBnXSmW7CgxhcJT89r45rpW46PsPSYhMVvQSm6nnZPscqlXbfNOCW9V5yAHlP4aCdlmb++crKq9GKdWTMQCyeV4SOvtBQYQutsjEgh8CO/IjMyW7VcDGGwPO7s604pqLaBidBuZLYfnrh6Wqo9AxnceZ6gBUhoM0dKXxnJEQhN/gf0w1R7KN9Jim67C7IOYmTAeNaqkrQZXUUpdPBRB4JWX3J//Rln5bFjI52bu4a7Izf9re1Q4/970U+6NtUJ3AXS7KdY0mjdNMqGfx341PdTAXgbj5Bz1PdolVuTAW2B0r5ZTpwyK1OkzSeiXHLrI9VRMr5uix2OF3rZr9LIjktSy/ByHerEtbbPOXTPoHFo6lnFJwCEfGMbj/GifZn8frZtC1y4p+ohB6gmEJe/dCGiucxaUCrxz1UShchIVm5SZ8r7P1K+FHNiMUvrRnVd+fxBs0SUFXJ8ixyh/W0CRMS26G7WqodGS976J+pBguzCPNz6QKqnq/+n9mGjdTYTHNBZMbqwia17trbt8eWEdX8Sf+4WTTjmYR54nHApgfyHN9tkjFhTp8xMTmgRQfbXW1EPBdI+Zj57qc9ds/PdoCaxbDUpoz51Mg99iL2vvgciYY8gKHYVksSKpFIDrzHN0IVA5ofX7+4HgKxWff4mOPJ0uEkhuDFw== rmonla@srv-dasu +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxCHrqnaVrkihb/0yBAxzcb9knhCAWSFFC9J6rEKHE4Yu5DW3XZ/aoWKFq1NEZS6yNQqBqFGvAe32RBwnX7RiJEkhYgS/xr2SJorIxTWWJUOmV5i7OopQQQoZ7YUoY56tdVrYaulJCDyJkvnmGZwGdUS782BEb9nWDwXd5t1qDZJtCWCV/xK34zRuTy7DqHPU3sx+PUwj0KWy8rQBeRK2KNvHCpcVTQvx4u1QS9Cbbqsic+BrZfaU1LBa70GdJL8GY9p1ZIlSqqPMyzcpILh7CwrnyNr7hj+kaKVIdzeo+0WIf97XsjD0dNNt5VPP3kBrnTA62EQ6eraZl7V01Hx6gK178K9C3fcgPHsxZASf8/Vo+zOeg3ChCYQFPF9YzSyQpAJE2yT7ptuzXulhifpRBIs9d8HS5+6mWYgaLPqwDpZRvYB5NsX96m2OX3LBIeeJm4ZEc4531jsvOJNPiok9SVg083aAUbflFKtWV5M01X54rT4+uU6Uy4LRQGXPr5Mor+BBZyZ91bTtX8nGOVZrQ3Cxm4jc0Q7Aj902SX4yqrImLuoM7XIbVTHGQt+gsgVSxEbb4KaF4jOvRZKYrDcSFrJN9KWcx5SLCDZmN4TlGqgbVPrfxHzF7BqLrzq+bcG+BVm3DP3ROBwAjbXPcztiaDHpPjWDiZByy5nHnzqmmCw== rmonla@srv-ns8 + +[14:33:57] >>> EJECUTANDO [ID:1773754438]: + powershell -c "(Get-Content C:\ProgramData\ssh\administrators_authorized_keys).Count" +[14:33:58] <<< FIN [ID:1773754438] (@0.535282s): +2 + +[14:35:49] >>> EJECUTANDO [ID:1773754544]: + powershell -c "Get-WinEvent -LogName OpenSSH/Admin -MaxEvents 5 | Format-List" +[14:35:50] <<< FIN [ID:1773754544] (@0.8690054s): + + +TimeCreated : 27/2/2026 21:47:00 +ProviderName : OpenSSH +Id : 1 +Message : sshd: fatal: ga_init, unable to resolve user administrador + +TimeCreated : 27/2/2026 21:47:00 +ProviderName : OpenSSH +Id : 2 +Message : sshd: error: get_user_token - unable to generate token on 2nd attempt for user administrador + +TimeCreated : 27/2/2026 21:46:51 +ProviderName : OpenSSH +Id : 1 +Message : sshd: fatal: ga_init, unable to resolve user administrador + +TimeCreated : 27/2/2026 21:46:51 +ProviderName : OpenSSH +Id : 2 +Message : sshd: error: get_user_token - unable to generate token on 2nd attempt for user administrador + + + + +[14:36:32] >>> EJECUTANDO [ID:1773754592]: + powershell -c "Get-ChildItem C:\ProgramData\ssh\logs" +[14:36:33] <<< FIN [ID:1773754592] (@0.4908574s): + +[14:37:20] >>> EJECUTANDO [ID:1773754637]: + powershell -c "(Get-Content C:\ProgramData\ssh\sshd_config) -replace \"#PubkeyAuthentication yes\", \"PubkeyAuthentication yes\" | Set-Content C:\ProgramData\ssh\sshd_config; Restart-Service sshd" +[14:37:21] <<< FIN [ID:1773754637] (@0.6228322s): + +[14:38:24] >>> EJECUTANDO [ID:1773754700]: + powershell -c "net localgroup administradores" +[14:38:25] <<< FIN [ID:1773754700] (@0.5409896s): +Nombre de alias administradores +Comentario Los administradores tienen acceso completo y sin restricciones al equipo o dominio + +Miembros + +------------------------------------------------------------------------------- +Administrador +DASUTEN\Domain Admins +usuarioDASUTEN +Se ha completado el comando correctamente. + + +[14:39:23] >>> EJECUTANDO [ID:1773754760]: + powershell -c "Get-Acl C:\Users\admindasu\.ssh\authorized_keys | Format-List" +[14:39:24] <<< FIN [ID:1773754760] (@0.6975168s): + +[14:40:17] >>> EJECUTANDO [ID:1773754814]: + powershell -c "Test-Path C:\Users\admindasu\.ssh\authorized_keys" +[14:40:18] <<< FIN [ID:1773754814] (@0.5216087s): +False + +[14:43:13] >>> EJECUTANDO [ID:1773754993]: + whoami; net user admindasu +[14:43:14] <<< FIN [ID:1773754993] (@0.1691577s): +dasuten\admindasu + +[14:44:03] >>> EJECUTANDO [ID:1773755041]: + powershell -c "net user admindasu /domain" +[14:44:04] <<< FIN [ID:1773755041] (@0.662856s): +Se procesar la solicitud en un controlador de dominio del dominio dasuten.utnlr. + +Nombre de usuario admindasu +Nombre completo +Comentario +Comentario del usuario +Cdigo de pas o regin 000 (Predeterminado por el equipo) +Cuenta activa S +La cuenta expira Nunca + +Ultimo cambio de contrasea 28/2/2026 03:23:39 +La contrasea expira Nunca +Cambio de contrasea 1/3/2026 03:23:39 +Contrasea requerida S +El usuario puede cambiar la contrasea S + +Estaciones de trabajo autorizadas Todas +Script de inicio de sesin +Perfil de usuario +Directorio principal +Ultima sesin iniciada 17/3/2026 14:44:03 + +Horas de inicio de sesin autorizadas Todas + +Miembros del grupo local +Miembros del grupo global *Domain Admins + *Domain Users +Se ha completado el comando correctamente. + + +[14:45:07] >>> EJECUTANDO [ID:1773755104]: + powershell -c "Get-Content C:\ProgramData\ssh\administrators_authorized_keys" +[14:45:07] <<< FIN [ID:1773755104] (@0.4565582s): +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCXKpAG3zT+QpTGjBnXSmW7CgxhcJT89r45rpW46PsPSYhMVvQSm6nnZPscqlXbfNOCW9V5yAHlP4aCdlmb++crKq9GKdWTMQCyeV4SOvtBQYQutsjEgh8CO/IjMyW7VcDGGwPO7s604pqLaBidBuZLYfnrh6Wqo9AxnceZ6gBUhoM0dKXxnJEQhN/gf0w1R7KN9Jim67C7IOYmTAeNaqkrQZXUUpdPBRB4JWX3J//Rln5bFjI52bu4a7Izf9re1Q4/970U+6NtUJ3AXS7KdY0mjdNMqGfx341PdTAXgbj5Bz1PdolVuTAW2B0r5ZTpwyK1OkzSeiXHLrI9VRMr5uix2OF3rZr9LIjktSy/ByHerEtbbPOXTPoHFo6lnFJwCEfGMbj/GifZn8frZtC1y4p+ohB6gmEJe/dCGiucxaUCrxz1UShchIVm5SZ8r7P1K+FHNiMUvrRnVd+fxBs0SUFXJ8ixyh/W0CRMS26G7WqodGS976J+pBguzCPNz6QKqnq/+n9mGjdTYTHNBZMbqwia17trbt8eWEdX8Sf+4WTTjmYR54nHApgfyHN9tkjFhTp8xMTmgRQfbXW1EPBdI+Zj57qc9ds/PdoCaxbDUpoz51Mg99iL2vvgciYY8gKHYVksSKpFIDrzHN0IVA5ofX7+4HgKxWff4mOPJ0uEkhuDFw== rmonla@srv-dasu +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxCHrqnaVrkihb/0yBAxzcb9knhCAWSFFC9J6rEKHE4Yu5DW3XZ/aoWKFq1NEZS6yNQqBqFGvAe32RBwnX7RiJEkhYgS/xr2SJorIxTWWJUOmV5i7OopQQQoZ7YUoY56tdVrYaulJCDyJkvnmGZwGdUS782BEb9nWDwXd5t1qDZJtCWCV/xK34zRuTy7DqHPU3sx+PUwj0KWy8rQBeRK2KNvHCpcVTQvx4u1QS9Cbbqsic+BrZfaU1LBa70GdJL8GY9p1ZIlSqqPMyzcpILh7CwrnyNr7hj+kaKVIdzeo+0WIf97XsjD0dNNt5VPP3kBrnTA62EQ6eraZl7V01Hx6gK178K9C3fcgPHsxZASf8/Vo+zOeg3ChCYQFPF9YzSyQpAJE2yT7ptuzXulhifpRBIs9d8HS5+6mWYgaLPqwDpZRvYB5NsX96m2OX3LBIeeJm4ZEc4531jsvOJNPiok9SVg083aAUbflFKtWV5M01X54rT4+uU6Uy4LRQGXPr5Mor+BBZyZ91bTtX8nGOVZrQ3Cxm4jc0Q7Aj902SX4yqrImLuoM7XIbVTHGQt+gsgVSxEbb4KaF4jOvRZKYrDcSFrJN9KWcx5SLCDZmN4TlGqgbVPrfxHzF7BqLrzq+bcG+BVm3DP3ROBwAjbXPcztiaDHpPjWDiZByy5nHnzqmmCw== rmonla@srv-ns8 + +[14:45:50] >>> EJECUTANDO [ID:1773755149]: + icacls C:\ProgramData\ssh\administrators_authorized_keys +[14:45:50] <<< FIN [ID:1773755149] (@0.0226878s): +C:\ProgramData\ssh\administrators_authorized_keys NT AUTHORITY\SYSTEM:(F) + BUILTIN\Administradores:(F) + +Se procesaron correctamente 1 archivos; error al procesar 0 archivos + +[14:47:14] >>> EJECUTANDO [ID:1773755231]: + powershell -c "Get-WinEvent -LogName OpenSSH/Admin -MaxEvents 10 | Format-List" +[14:47:15] <<< FIN [ID:1773755231] (@0.5962491s): + + +TimeCreated : 27/2/2026 21:47:00 +ProviderName : OpenSSH +Id : 1 +Message : sshd: fatal: ga_init, unable to resolve user administrador + +TimeCreated : 27/2/2026 21:47:00 +ProviderName : OpenSSH +Id : 2 +Message : sshd: error: get_user_token - unable to generate token on 2nd attempt for user administrador + +TimeCreated : 27/2/2026 21:46:51 +ProviderName : OpenSSH +Id : 1 +Message : sshd: fatal: ga_init, unable to resolve user administrador + +TimeCreated : 27/2/2026 21:46:51 +ProviderName : OpenSSH +Id : 2 +Message : sshd: error: get_user_token - unable to generate token on 2nd attempt for user administrador + + + + +[14:48:03] >>> EJECUTANDO [ID:1773755281]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config | Select-Object -Last 10" +[14:48:03] <<< FIN [ID:1773755281] (@0.5496927s): + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server + +Match Group administrators + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + + +[14:49:07] >>> EJECUTANDO [ID:1773755347]: + powershell -c "Test-Path C:\Users\admindasu\.ssh" +[14:49:07] <<< FIN [ID:1773755347] (@0.4793649s): +False + +[14:49:55] >>> EJECUTANDO [ID:1773755393]: + powershell -c "ls C:\Users" +[14:49:56] <<< FIN [ID:1773755393] (@0.5877511s): + + + Directorio: C:\Users + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +d----- 16/3/2026 03:57 admindasu +d-r--- 27/2/2026 20:58 Public +d----- 27/2/2026 20:58 usuarioDASUTEN + + + +[14:50:33] >>> EJECUTANDO [ID:1773755433]: + powershell -c "New-Item -Path 'C:\Users\admindasu\.ssh' -ItemType Directory -Force" +[14:50:52] <<< FIN [ID:1773755433] (@0.6101642s): + + + Directorio: C:\Users\admindasu + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +d----- 17/3/2026 14:50 .ssh + + + +[14:51:29] >>> EJECUTANDO [ID:1773755488]: + powershell -c "Set-Content -Path 'C:\Users\admindasu\.ssh\authorized_keys' -Value 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxCHrqnaVrkihb/0yBAxzcb9knhCAWSFFC9J6rEKHE4Yu5DW3XZ/aoWKFq1NEZS6yNQqBqFGvAe32RBwnX7RiJEkhYgS/xr2SJorIxTWWJUOmV5i7OopQQQoZ7YUoY56tdVrYaulJCDyJkvnmGZwGdUS782BEb9nWDwXd5t1qDZJtCWCV/xK34zRuTy7DqHPU3sx+PUwj0KWy8rQBeRK2KNvHCpcVTQvx4u1QS9Cbbqsic+BrZfaU1LBa70GdJL8GY9p1ZIlSqqPMyzcpILh7CwrnyNr7hj+kaKVIdzeo+0WIf97XsjD0dNNt5VPP3kBrnTA62EQ6eraZl7V01Hx6gK178K9C3fcgPHsxZASf8/Vo+zOeg3ChCYQFPF9YzSyQpAJE2yT7ptuzXulhifpRBIs9d8HS5+6mWYgaLPqwDpZRvYB5NsX96m2OX3LBIeeJm4ZEc4531jsvOJNPiok9SVg083aAUbflFKtWV5M01X54rT4+uU6Uy4LRQGXPr5Mor+BBZyZ91bTtX8nGOVZrQ3Cxm4jc0Q7Aj902SX4yqrImLuoM7XIbVTHGQt+gsgVSxEbb4KaF4jOvRZKYrDcSFrJN9KWcx5SLCDZmN4TlGqgbVPrfxHzF7BqLrzq+bcG+BVm3DP3ROBwAjbXPcztiaDHpPjWDiZByy5nHnzqmmCw== rmonla@srv-ns8'; icacls 'C:\Users\admindasu\.ssh\authorized_keys' /inheritance:r /grant 'admindasu:F' 'SYSTEM:F'" +[14:51:30] <<< FIN [ID:1773755488] (@0.5797299s): +archivo procesado: C:\Users\admindasu\.ssh\authorized_keys +Se procesaron correctamente 1 archivos; error al procesar 0 archivos + +[14:52:12] >>> EJECUTANDO [ID:1773755530]: + powershell -c "Restart-Service sshd" +[14:52:13] <<< FIN [ID:1773755530] (@0.751628s): + +[14:53:27] >>> EJECUTANDO [ID:1773755602]: + powershell -c "(Get-Content C:\ProgramData\ssh\sshd_config) -replace \"Match Group administrators\", \"#Match Group administrators\" -replace \" AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys\", \"# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys\" | Set-Content C:\ProgramData\ssh\sshd_config; Restart-Service sshd" +[14:53:27] <<< FIN [ID:1773755602] (@0.5741823s): + +[14:54:11] >>> EJECUTANDO [ID:1773755651]: + icacls C:\Users\admindasu\.ssh +[14:54:11] <<< FIN [ID:1773755651] (@0.0683752s): +C:\Users\admindasu\.ssh NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F) + BUILTIN\Administradores:(I)(OI)(CI)(F) + DASUTEN\admindasu:(I)(OI)(CI)(F) + +Se procesaron correctamente 1 archivos; error al procesar 0 archivos + +[14:58:39] >>> EJECUTANDO [ID:1773755916]: + powershell -c "icacls C:\Users\admindasu\.ssh\authorized_keys" +[14:58:40] <<< FIN [ID:1773755916] (@0.4427083s): +C:\Users\admindasu\.ssh\authorized_keys NT AUTHORITY\SYSTEM:(F) + DASUTEN\admindasu:(F) + +Se procesaron correctamente 1 archivos; error al procesar 0 archivos + +[14:59:27] >>> EJECUTANDO [ID:1773755966]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config | Select-String \"PubkeyAuthentication\"" +[14:59:28] <<< FIN [ID:1773755966] (@0.5389951s): + +[15:00:22] >>> EJECUTANDO [ID:1773756019]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config" +[15:00:22] <<< FIN [ID:1773756019] (@0.5298334s): +Port 7022 +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented. Uncommented options override the +# default value. + +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key + +# Ciphers and keying +#RekeyLimit default none + +# Logging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +#PermitRootLogin prohibit-password +#StrictModes yes +#MaxAuthTries 6 +#MaxSessions 10 + +#PubkeyAuthentication yes + +# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 +# but this is overridden so installations will only check .ssh/authorized_keys +AuthorizedKeysFile .ssh/authorized_keys + +#AuthorizedPrincipalsFile none + +# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts +#HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# HostbasedAuthentication +#IgnoreUserKnownHosts no +# Don't read the user's ~/.rhosts and ~/.shosts files +#IgnoreRhosts yes + +# To disable tunneled clear text passwords, change to no here! +#PasswordAuthentication yes +#PermitEmptyPasswords no + +#AllowAgentForwarding yes +#AllowTcpForwarding yes +#GatewayPorts no +#PermitTTY yes +#PrintMotd yes +#PrintLastLog yes +#TCPKeepAlive yes +#UseLogin no +#PermitUserEnvironment no +#ClientAliveInterval 0 +#ClientAliveCountMax 3 +#UseDNS no +#PidFile /var/run/sshd.pid +#MaxStartups 10:30:100 +#PermitTunnel no +#ChrootDirectory none +#VersionAddendum none + +# no default banner path +#Banner none + +# override default of no subsystems +Subsystem sftp sftp-server.exe + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server + +Match Group administrators + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + + +[15:01:31] >>> EJECUTANDO [ID:1773756088]: + powershell -c "$c = Get-Content C:\ProgramData\ssh\sshd_config; $c = $c -replace \"#PubkeyAuthentication yes\", \"PubkeyAuthentication yes\"; $c = $c -replace \"#AuthorizedKeysFile\", \"AuthorizedKeysFile\"; $c = $c -replace \"Match Group administrators\", \"#Match Group administrators\"; $c = $c -replace \" AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys\", \"# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys\"; $c | Set-Content C:\ProgramData\ssh\sshd_config; Restart-Service sshd" +[15:01:32] <<< FIN [ID:1773756088] (@0.5484794s): + +[15:01:48] >>> EJECUTANDO [ID:1773756106]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config | Select-Object -Last 10" +[15:01:48] <<< FIN [ID:1773756106] (@0.4875456s): + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server + +Match Group administrators + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + + +[15:02:36] >>> EJECUTANDO [ID:1773756153]: + powershell -c "$c = Get-Content C:\ProgramData\ssh\sshd_config; $newC = foreach ($line in $c) { if ($line -match \"Match Group administrators\" -or $line -match \"AuthorizedKeysFile __PROGRAMDATA__\") { \"# $line\" } else { $line } }; $newC | Set-Content C:\ProgramData\ssh\sshd_config; Restart-Service sshd" +[15:02:37] <<< FIN [ID:1773756153] (@0.5386104s): + +[15:04:27] >>> EJECUTANDO [ID:1773756263]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config | Select-Object -Last 10" +[15:04:28] <<< FIN [ID:1773756263] (@0.5217591s): + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server + +Match Group administrators + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + + +[15:17:05] >>> EJECUTANDO [ID:1773757020]: + powershell -c "$env:USERPROFILE" +[15:17:08] <<< FIN [ID:1773757020] (@0.7717206s): + +[15:18:19] >>> EJECUTANDO [ID:1773757097]: + powershell -c "Get-ChildItem -Path C:\Users\admindasu -Recurse -Filter authorized_keys | Select-Object FullName" +[15:18:21] <<< FIN [ID:1773757097] (@0.6046728s): + +FullName +-------- +C:\Users\admindasu\.ssh\authorized_keys + + + +[15:19:07] >>> EJECUTANDO [ID:1773757143]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config" +[15:19:07] <<< FIN [ID:1773757143] (@0.3930951s): +Port 7022 +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented. Uncommented options override the +# default value. + +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key + +# Ciphers and keying +#RekeyLimit default none + +# Logging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +#PermitRootLogin prohibit-password +#StrictModes yes +#MaxAuthTries 6 +#MaxSessions 10 + +#PubkeyAuthentication yes + +# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 +# but this is overridden so installations will only check .ssh/authorized_keys +AuthorizedKeysFile .ssh/authorized_keys + +#AuthorizedPrincipalsFile none + +# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts +#HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# HostbasedAuthentication +#IgnoreUserKnownHosts no +# Don't read the user's ~/.rhosts and ~/.shosts files +#IgnoreRhosts yes + +# To disable tunneled clear text passwords, change to no here! +#PasswordAuthentication yes +#PermitEmptyPasswords no + +#AllowAgentForwarding yes +#AllowTcpForwarding yes +#GatewayPorts no +#PermitTTY yes +#PrintMotd yes +#PrintLastLog yes +#TCPKeepAlive yes +#UseLogin no +#PermitUserEnvironment no +#ClientAliveInterval 0 +#ClientAliveCountMax 3 +#UseDNS no +#PidFile /var/run/sshd.pid +#MaxStartups 10:30:100 +#PermitTunnel no +#ChrootDirectory none +#VersionAddendum none + +# no default banner path +#Banner none + +# override default of no subsystems +Subsystem sftp sftp-server.exe + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server + +Match Group administrators + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + + +[15:20:03] >>> EJECUTANDO [ID:1773757198]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config | Select-Object -First 50" +[15:20:04] <<< FIN [ID:1773757198] (@0.6162078s): +Port 7022 +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented. Uncommented options override the +# default value. + +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key + +# Ciphers and keying +#RekeyLimit default none + +# Logging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +#PermitRootLogin prohibit-password +#StrictModes yes +#MaxAuthTries 6 +#MaxSessions 10 + +#PubkeyAuthentication yes + +# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 +# but this is overridden so installations will only check .ssh/authorized_keys +AuthorizedKeysFile .ssh/authorized_keys + +#AuthorizedPrincipalsFile none + +# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts +#HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# HostbasedAuthentication +#IgnoreUserKnownHosts no +# Don't read the user's ~/.rhosts and ~/.shosts files +#IgnoreRhosts yes + +# To disable tunneled clear text passwords, change to no here! + +[15:20:43] >>> EJECUTANDO [ID:1773757239]: + powershell -c "(Get-Content C:\ProgramData\ssh\sshd_config) -replace \"#PubkeyAuthentication yes\", \"PubkeyAuthentication yes\" -replace \"Match Group administrators\", \"#Match Group administrators\" -replace \"AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys\", \"#AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys\" | Set-Content C:\ProgramData\ssh\sshd_config; Restart-Service sshd" +[15:20:44] <<< FIN [ID:1773757239] (@0.5554905s): + +[15:21:16] >>> EJECUTANDO [ID:1773757270]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config | Select-String \"PubkeyAuthentication\", \"Match Group\", \"administrators_authorized_keys\"" +[15:21:20] <<< FIN [ID:1773757270] (@0.8480583s): + +[15:22:42] >>> EJECUTANDO [ID:1773757356]: + iwr http://100.111.195.4:8000/payloads/fix_ssh.ps1 -useb | iex +[15:22:47] <<< FIN [ID:1773757356] (@1.6368351s): + +[15:23:41] >>> EJECUTANDO [ID:1773757418]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config | Select-String \"PubkeyAuthentication\", \"Match Group\", \"administrators_authorized_keys\"" +[15:23:42] <<< FIN [ID:1773757418] (@0.6211263s): + +[15:24:33] >>> EJECUTANDO [ID:1773757465]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config | Select-String \"Pubkey\"" +[15:24:35] <<< FIN [ID:1773757465] (@0.5118907s): + +[15:25:15] >>> EJECUTANDO [ID:1773757513]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config" +[15:25:16] <<< FIN [ID:1773757513] (@0.4566023s): +Port 7022 +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented. Uncommented options override the +# default value. + +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key + +# Ciphers and keying +#RekeyLimit default none + +# Logging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +#PermitRootLogin prohibit-password +#StrictModes yes +#MaxAuthTries 6 +#MaxSessions 10 + +PubkeyAuthentication yes + +# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 +# but this is overridden so installations will only check .ssh/authorized_keys +AuthorizedKeysFile .ssh/authorized_keys + +#AuthorizedPrincipalsFile none + +# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts +#HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# HostbasedAuthentication +#IgnoreUserKnownHosts no +# Don't read the user's ~/.rhosts and ~/.shosts files +#IgnoreRhosts yes + +# To disable tunneled clear text passwords, change to no here! +#PasswordAuthentication yes +#PermitEmptyPasswords no + +#AllowAgentForwarding yes +#AllowTcpForwarding yes +#GatewayPorts no +#PermitTTY yes +#PrintMotd yes +#PrintLastLog yes +#TCPKeepAlive yes +#UseLogin no +#PermitUserEnvironment no +#ClientAliveInterval 0 +#ClientAliveCountMax 3 +#UseDNS no +#PidFile /var/run/sshd.pid +#MaxStartups 10:30:100 +#PermitTunnel no +#ChrootDirectory none +#VersionAddendum none + +# no default banner path +#Banner none + +# override default of no subsystems +Subsystem sftp sftp-server.exe + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server + +#Match Group administrators +# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + + +[15:26:21] >>> EJECUTANDO [ID:1773757578]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config | Select-String \"PubkeyAuthentication\"" +[15:26:22] <<< FIN [ID:1773757578] (@0.4476449s): + +[15:28:38] >>> EJECUTANDO [ID:1773757716]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config" +[15:28:40] <<< FIN [ID:1773757716] (@0.4407093s): +Port 7022 +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented. Uncommented options override the +# default value. + +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key + +# Ciphers and keying +#RekeyLimit default none + +# Logging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +#PermitRootLogin prohibit-password +#StrictModes yes +#MaxAuthTries 6 +#MaxSessions 10 + +PubkeyAuthentication yes + +# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 +# but this is overridden so installations will only check .ssh/authorized_keys +AuthorizedKeysFile .ssh/authorized_keys + +#AuthorizedPrincipalsFile none + +# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts +#HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# HostbasedAuthentication +#IgnoreUserKnownHosts no +# Don't read the user's ~/.rhosts and ~/.shosts files +#IgnoreRhosts yes + +# To disable tunneled clear text passwords, change to no here! +#PasswordAuthentication yes +#PermitEmptyPasswords no + +#AllowAgentForwarding yes +#AllowTcpForwarding yes +#GatewayPorts no +#PermitTTY yes +#PrintMotd yes +#PrintLastLog yes +#TCPKeepAlive yes +#UseLogin no +#PermitUserEnvironment no +#ClientAliveInterval 0 +#ClientAliveCountMax 3 +#UseDNS no +#PidFile /var/run/sshd.pid +#MaxStartups 10:30:100 +#PermitTunnel no +#ChrootDirectory none +#VersionAddendum none + +# no default banner path +#Banner none + +# override default of no subsystems +Subsystem sftp sftp-server.exe + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server + +#Match Group administrators +# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + + +[15:33:28] >>> EJECUTANDO [ID:1773758004]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config" +[15:33:29] <<< FIN [ID:1773758004] (@0.3960849s): +Port 7022 +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented. Uncommented options override the +# default value. + +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key +#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key + +# Ciphers and keying +#RekeyLimit default none + +# Logging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +#PermitRootLogin prohibit-password +#StrictModes yes +#MaxAuthTries 6 +#MaxSessions 10 + +PubkeyAuthentication yes + +# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 +# but this is overridden so installations will only check .ssh/authorized_keys +AuthorizedKeysFile .ssh/authorized_keys + +#AuthorizedPrincipalsFile none + +# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts +#HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# HostbasedAuthentication +#IgnoreUserKnownHosts no +# Don't read the user's ~/.rhosts and ~/.shosts files +#IgnoreRhosts yes + +# To disable tunneled clear text passwords, change to no here! +#PasswordAuthentication yes +#PermitEmptyPasswords no + +#AllowAgentForwarding yes +#AllowTcpForwarding yes +#GatewayPorts no +#PermitTTY yes +#PrintMotd yes +#PrintLastLog yes +#TCPKeepAlive yes +#UseLogin no +#PermitUserEnvironment no +#ClientAliveInterval 0 +#ClientAliveCountMax 3 +#UseDNS no +#PidFile /var/run/sshd.pid +#MaxStartups 10:30:100 +#PermitTunnel no +#ChrootDirectory none +#VersionAddendum none + +# no default banner path +#Banner none + +# override default of no subsystems +Subsystem sftp sftp-server.exe + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server + +#Match Group administrators +# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + + +[15:35:14] >>> EJECUTANDO [ID:1773758109]: + iwr http://100.111.195.4:8000/payloads/fix_ssh_rsa.ps1 -useb | iex +[15:35:16] <<< FIN [ID:1773758109] (@0.8271154s): + +[15:37:20] >>> EJECUTANDO [ID:1773758240]: + powershell -c "Get-Content C:\Users\admindasu\.ssh\authorized_keys" +[15:37:21] <<< FIN [ID:1773758240] (@0.5401499s): +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxCHrqnaVrkihb/0yBAxzcb9knhCAWSFFC9J6rEKHE4Yu5DW3XZ/aoWKFq1NEZS6yNQqBqFGvAe32RBwnX7RiJEkhYgS/xr2SJorIxTWWJUOmV5i7OopQQQoZ7YUoY56tdVrYaulJCDyJkvnmGZwGdUS782BEb9nWDwXd5t1qDZJtCWCV/xK34zRuTy7DqHPU3sx+PUwj0KWy8rQBeRK2KNvHCpcVTQvx4u1QS9Cbbqsic+BrZfaU1LBa70GdJL8GY9p1ZIlSqqPMyzcpILh7CwrnyNr7hj+kaKVIdzeo+0WIf97XsjD0dNNt5VPP3kBrnTA62EQ6eraZl7V01Hx6gK178K9C3fcgPHsxZASf8/Vo+zOeg3ChCYQFPF9YzSyQpAJE2yT7ptuzXulhifpRBIs9d8HS5+6mWYgaLPqwDpZRvYB5NsX96m2OX3LBIeeJm4ZEc4531jsvOJNPiok9SVg083aAUbflFKtWV5M01X54rT4+uU6Uy4LRQGXPr5Mor+BBZyZ91bTtX8nGOVZrQ3Cxm4jc0Q7Aj902SX4yqrImLuoM7XIbVTHGQt+gsgVSxEbb4KaF4jOvRZKYrDcSFrJN9KWcx5SLCDZmN4TlGqgbVPrfxHzF7BqLrzq+bcG+BVm3DP3ROBwAjbXPcztiaDHpPjWDiZByy5nHnzqmmCw== rmonla@srv-ns8 + +[15:38:41] >>> EJECUTANDO [ID:1773758318]: + powershell -c "icacls C:\Users\admindasu\.ssh; icacls C:\Users\admindasu" +[15:38:42] <<< FIN [ID:1773758318] (@0.4482052s): +C:\Users\admindasu\.ssh NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F) + BUILTIN\Administradores:(I)(OI)(CI)(F) + DASUTEN\admindasu:(I)(OI)(CI)(F) + +Se procesaron correctamente 1 archivos; error al procesar 0 archivos +C:\Users\admindasu NT AUTHORITY\SYSTEM:(OI)(CI)(F) + BUILTIN\Administradores:(OI)(CI)(F) + DASUTEN\admindasu:(OI)(CI)(F) + +Se procesaron correctamente 1 archivos; error al procesar 0 archivos + +[15:39:19] >>> EJECUTANDO [ID:1773758358]: + powershell -c "Get-WinEvent -LogName OpenSSH/Admin -MaxEvents 5 | Format-List" +[15:39:20] <<< FIN [ID:1773758358] (@0.5196272s): + + +TimeCreated : 27/2/2026 21:47:00 +ProviderName : OpenSSH +Id : 1 +Message : sshd: fatal: ga_init, unable to resolve user administrador + +TimeCreated : 27/2/2026 21:47:00 +ProviderName : OpenSSH +Id : 2 +Message : sshd: error: get_user_token - unable to generate token on 2nd attempt for user administrador + +TimeCreated : 27/2/2026 21:46:51 +ProviderName : OpenSSH +Id : 1 +Message : sshd: fatal: ga_init, unable to resolve user administrador + +TimeCreated : 27/2/2026 21:46:51 +ProviderName : OpenSSH +Id : 2 +Message : sshd: error: get_user_token - unable to generate token on 2nd attempt for user administrador + + + + +[15:41:07] >>> EJECUTANDO [ID:1773758462]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config | Select-String \"PubkeyAuthentication\", \"Match Group\", \"AuthorizedKeysFile\"" +[15:41:08] <<< FIN [ID:1773758462] (@0.7621569s): + +[15:49:55] >>> EJECUTANDO [ID:1773758991]: + iwr http://100.111.195.4:8000/payloads/rebuild_sshd_config.ps1 -useb | iex +[15:49:56] <<< FIN [ID:1773758991] (@0.716791s): +sshd_config reescrito OK +Port 7022 +PubkeyAuthentication yes +AuthorizedKeysFile .ssh/authorized_keys +PasswordAuthentication yes +Subsystem sftp sftp-server.exe +LogLevel DEBUG3 + +# COMENTADO: los admins usaran su .ssh/authorized_keys personal +#Match Group administrators +# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys +sshd reiniciado + +[15:51:26] >>> EJECUTANDO [ID:1773759082]: + powershell -c "Get-WinEvent -LogName OpenSSH/Admin -MaxEvents 10 | Format-List" +[15:51:27] <<< FIN [ID:1773759082] (@0.5142235s): + + +TimeCreated : 27/2/2026 21:47:00 +ProviderName : OpenSSH +Id : 1 +Message : sshd: fatal: ga_init, unable to resolve user administrador + +TimeCreated : 27/2/2026 21:47:00 +ProviderName : OpenSSH +Id : 2 +Message : sshd: error: get_user_token - unable to generate token on 2nd attempt for user administrador + +TimeCreated : 27/2/2026 21:46:51 +ProviderName : OpenSSH +Id : 1 +Message : sshd: fatal: ga_init, unable to resolve user administrador + +TimeCreated : 27/2/2026 21:46:51 +ProviderName : OpenSSH +Id : 2 +Message : sshd: error: get_user_token - unable to generate token on 2nd attempt for user administrador + + + + +[15:52:30] >>> EJECUTANDO [ID:1773759146]: + powershell -c "Get-ChildItem C:\ProgramData\ssh\ssh_host_* | Select-Object Name, Length" +[15:52:31] <<< FIN [ID:1773759146] (@0.6137555s): + +Name Length +---- ------ +ssh_host_dsa_key 1405 +ssh_host_dsa_key.pub 620 +ssh_host_ecdsa_key 525 +ssh_host_ecdsa_key.pub 192 +ssh_host_ed25519_key 419 +ssh_host_ed25519_key.pub 112 +ssh_host_rsa_key 2622 +ssh_host_rsa_key.pub 584 + + + +[15:53:29] >>> EJECUTANDO [ID:1773759208]: + powershell -c "Get-ChildItem C:\ProgramData\ssh\logs" +[15:53:30] <<< FIN [ID:1773759208] (@0.4162948s): + +[15:54:38] >>> EJECUTANDO [ID:1773759277]: + powershell -c "Get-WinEvent -LogName OpenSSH/Operational -MaxEvents 20 | Format-List" +[15:54:39] <<< FIN [ID:1773759277] (@0.6174706s): + + +TimeCreated : 17/3/2026 15:49:56 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Server listening on 0.0.0.0 port 7022. + +TimeCreated : 17/3/2026 15:49:56 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Server listening on :: port 7022. + +TimeCreated : 17/3/2026 15:35:16 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Server listening on 0.0.0.0 port 7022. + +TimeCreated : 17/3/2026 15:35:16 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Server listening on :: port 7022. + +TimeCreated : 17/3/2026 15:22:46 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Server listening on 0.0.0.0 port 7022. + +TimeCreated : 17/3/2026 15:22:46 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Server listening on :: port 7022. + +TimeCreated : 17/3/2026 14:52:13 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Server listening on 0.0.0.0 port 7022. + +TimeCreated : 17/3/2026 14:52:13 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Server listening on :: port 7022. + +TimeCreated : 17/3/2026 14:21:34 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Server listening on 0.0.0.0 port 7022. + +TimeCreated : 17/3/2026 14:21:34 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Server listening on :: port 7022. + +TimeCreated : 16/3/2026 22:33:51 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Disconnected from 10.0.100.1 port 44242 + +TimeCreated : 16/3/2026 22:33:51 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Received disconnect from 10.0.100.1 port 44242:11: disconnected by user + +TimeCreated : 16/3/2026 22:33:51 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Accepted publickey for admindasu from 10.0.100.1 port 44242 ssh2: RSA SHA256:UauHH7Bx+4l9NFMkxLp70E5veqaohb2kUNe599+qxo4 + +TimeCreated : 16/3/2026 22:29:38 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Connection closed by invalid user rmonla 10.0.100.1 port 37050 [preauth] + +TimeCreated : 16/3/2026 22:29:38 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Failed password for invalid user rmonla from 10.0.100.1 port 37050 ssh2 + +TimeCreated : 16/3/2026 22:29:38 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Failed password for invalid user rmonla from 10.0.100.1 port 37050 ssh2 + +TimeCreated : 16/3/2026 22:29:38 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Failed none for invalid user rmonla from 10.0.100.1 port 37050 ssh2 + +TimeCreated : 16/3/2026 22:29:38 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Invalid user rmonla from 10.0.100.1 port 37050 + +TimeCreated : 16/3/2026 22:17:37 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Connection closed by invalid user rmonla 10.0.100.1 port 40356 [preauth] + +TimeCreated : 16/3/2026 22:17:37 +ProviderName : OpenSSH +Id : 4 +Message : sshd: Failed password for invalid user rmonla from 10.0.100.1 port 40356 ssh2 + + + + +[15:55:37] >>> EJECUTANDO [ID:1773759334]: + powershell -c "Get-WinEvent -LogName OpenSSH/Admin -Newest 5; Get-WinEvent -LogName OpenSSH/Operational -Newest 5; Get-Content C:\ProgramData\ssh\logs\sshd.log -ErrorAction SilentlyContinue -Tail 30" +[15:55:38] <<< FIN [ID:1773759334] (@0.7159413s): + +[15:57:06] >>> EJECUTANDO [ID:1773759424]: + iwr http://100.111.195.4:8000/payloads/fix_ssh_rsa.ps1 -useb | iex +[15:57:07] <<< FIN [ID:1773759424] (@0.6657757s): +>>> sshd_config reescrito con Match Group administrators HABILITADO +>>> Permisos corregidos en administrators_authorized_keys +>>> Contenido actual: +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCXKpAG3zT+QpTGjBnXSmW7CgxhcJT89r45rpW46PsPSYhMVvQSm6nnZPscqlXbfNOCW9V5yAHlP4aCdlmb++crKq9GKdWTMQCyeV4SOvtBQYQutsjEgh8CO/IjMyW7VcDGGwPO7s604pqLaBidBuZLYfnrh6Wqo9AxnceZ6gBUhoM0dKXxnJEQhN/gf0w1R7KN9Jim67C7IOYmTAeNaqkrQZXUUpdPBRB4JWX3J//Rln5bFjI52bu4a7Izf9re1Q4/970U+6NtUJ3AXS7KdY0mjdNMqGfx341PdTAXgbj5Bz1PdolVuTAW2B0r5ZTpwyK1OkzSeiXHLrI9VRMr5uix2OF3rZr9LIjktSy/ByHerEtbbPOXTPoHFo6lnFJwCEfGMbj/GifZn8frZtC1y4p+ohB6gmEJe/dCGiucxaUCrxz1UShchIVm5SZ8r7P1K+FHNiMUvrRnVd+fxBs0SUFXJ8ixyh/W0CRMS26G7WqodGS976J+pBguzCPNz6QKqnq/+n9mGjdTYTHNBZMbqwia17trbt8eWEdX8Sf+4WTTjmYR54nHApgfyHN9tkjFhTp8xMTmgRQfbXW1EPBdI+Zj57qc9ds/PdoCaxbDUpoz51Mg99iL2vvgciYY8gKHYVksSKpFIDrzHN0IVA5ofX7+4HgKxWff4mOPJ0uEkhuDFw== rmonla@srv-dasu +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxCHrqnaVrkihb/0yBAxzcb9knhCAWSFFC9J6rEKHE4Yu5DW3XZ/aoWKFq1NEZS6yNQqBqFGvAe32RBwnX7RiJEkhYgS/xr2SJorIxTWWJUOmV5i7OopQQQoZ7YUoY56tdVrYaulJCDyJkvnmGZwGdUS782BEb9nWDwXd5t1qDZJtCWCV/xK34zRuTy7DqHPU3sx+PUwj0KWy8rQBeRK2KNvHCpcVTQvx4u1QS9Cbbqsic+BrZfaU1LBa70GdJL8GY9p1ZIlSqqPMyzcpILh7CwrnyNr7hj+kaKVIdzeo+0WIf97XsjD0dNNt5VPP3kBrnTA62EQ6eraZl7V01Hx6gK178K9C3fcgPHsxZASf8/Vo+zOeg3ChCYQFPF9YzSyQpAJE2yT7ptuzXulhifpRBIs9d8HS5+6mWYgaLPqwDpZRvYB5NsX96m2OX3LBIeeJm4ZEc4531jsvOJNPiok9SVg083aAUbflFKtWV5M01X54rT4+uU6Uy4LRQGXPr5Mor+BBZyZ91bTtX8nGOVZrQ3Cxm4jc0Q7Aj902SX4yqrImLuoM7XIbVTHGQt+gsgVSxEbb4KaF4jOvRZKYrDcSFrJN9KWcx5SLCDZmN4TlGqgbVPrfxHzF7BqLrzq+bcG+BVm3DP3ROBwAjbXPcztiaDHpPjWDiZByy5nHnzqmmCw== rmonla@srv-ns8 +>>> ACL actual: +C:\ProgramData\ssh\administrators_authorized_keys NT AUTHORITY\SYSTEM:(F) + BUILTIN\Administradores:(F) + +Se procesaron correctamente 1 archivos; error al procesar 0 archivos +>>> sshd reiniciado OK + +[16:08:44] >>> EJECUTANDO [ID:1773760121]: + iwr http://100.111.195.4:8000/payloads/fix_ssh_rsa.ps1 -useb | iex +[16:08:45] <<< FIN [ID:1773760121] (@0.603529s): +>>> sshd_config reescrito con StrictModes no para prueba +>>> sshd reiniciado OK + +[16:11:35] ????????? (Zombi) v3.4 ONLINE - Esperando ordenes... +[16:11:36] >>> EJECUTANDO [ID:1773760121]: + iwr http://100.111.195.4:8000/payloads/fix_ssh_rsa.ps1 -useb | iex +[16:11:37] <<< FIN [ID:1773760121] (@0.5414699s): +>>> sshd_config reescrito con StrictModes no para prueba +>>> sshd reiniciado OK + +[16:13:01] >>> EJECUTANDO [ID:1773760377]: + powershell -c "Get-Content C:\ProgramData\ssh\logs\sshd.log -Tail 50" +[16:13:02] <<< FIN [ID:1773760377] (@0.5278687s): +7848 2026-03-17 15:57:07.488 debug2: fd 3 setting O_NONBLOCK +7848 2026-03-17 15:57:07.488 debug3: sock_set_v6only: set socket 3 IPV6_V6ONLY +7848 2026-03-17 15:57:07.488 debug1: Bind to port 7022 on ::. +7848 2026-03-17 15:57:07.488 Server listening on :: port 7022. +7848 2026-03-17 15:57:07.488 debug2: fd 4 setting O_NONBLOCK +7848 2026-03-17 15:57:07.488 debug1: Bind to port 7022 on 0.0.0.0. +7848 2026-03-17 15:57:07.488 Server listening on 0.0.0.0 port 7022. +7848 2026-03-17 15:57:07.488 debug3: pselect: installing signal handler for 3, previous 00007FF684C38600 +7848 2026-03-17 15:57:07.488 debug3: pselect: installing signal handler for 6, previous 00007FF684C38500 +7848 2026-03-17 15:57:07.488 debug3: pselect: installing signal handler for 7, previous 00007FF684C385F0 +7848 2026-03-17 15:57:07.488 debug3: pselect: installing signal handler for 8, previous 00007FF684C385F0 +7848 2026-03-17 15:57:07.488 debug3: pselect_notify_setup: initializing +7848 2026-03-17 15:57:07.488 debug2: fd 7 setting O_NONBLOCK +7848 2026-03-17 15:57:07.488 debug2: fd 5 setting O_NONBLOCK +7848 2026-03-17 15:57:07.488 debug3: pselect_notify_setup: pid 7848 saved 7848 pipe0 7 pipe1 5 +7768 2026-03-17 16:08:45.126 debug2: fd 3 setting O_NONBLOCK +7768 2026-03-17 16:08:45.126 debug3: sock_set_v6only: set socket 3 IPV6_V6ONLY +7768 2026-03-17 16:08:45.126 debug1: Bind to port 7022 on ::. +7768 2026-03-17 16:08:45.126 Server listening on :: port 7022. +7768 2026-03-17 16:08:45.126 debug2: fd 4 setting O_NONBLOCK +7768 2026-03-17 16:08:45.126 debug1: Bind to port 7022 on 0.0.0.0. +7768 2026-03-17 16:08:45.126 Server listening on 0.0.0.0 port 7022. +7768 2026-03-17 16:08:45.126 debug3: pselect: installing signal handler for 3, previous 00007FF684C38600 +7768 2026-03-17 16:08:45.126 debug3: pselect: installing signal handler for 6, previous 00007FF684C38500 +7768 2026-03-17 16:08:45.126 debug3: pselect: installing signal handler for 7, previous 00007FF684C385F0 +7768 2026-03-17 16:08:45.126 debug3: pselect: installing signal handler for 8, previous 00007FF684C385F0 +7768 2026-03-17 16:08:45.126 debug3: pselect_notify_setup: initializing +7768 2026-03-17 16:08:45.141 debug2: fd 7 setting O_NONBLOCK +7768 2026-03-17 16:08:45.141 debug2: fd 5 setting O_NONBLOCK +7768 2026-03-17 16:08:45.141 debug3: pselect_notify_setup: pid 7768 saved 7768 pipe0 7 pipe1 5 +6228 2026-03-17 16:11:36.938 debug2: fd 3 setting O_NONBLOCK +6228 2026-03-17 16:11:36.938 debug3: sock_set_v6only: set socket 3 IPV6_V6ONLY +6228 2026-03-17 16:11:36.938 debug1: Bind to port 7022 on ::. +6228 2026-03-17 16:11:36.938 Server listening on :: port 7022. +6228 2026-03-17 16:11:36.938 debug2: fd 4 setting O_NONBLOCK +6228 2026-03-17 16:11:36.938 debug1: Bind to port 7022 on 0.0.0.0. +6228 2026-03-17 16:11:36.938 Server listening on 0.0.0.0 port 7022. +6228 2026-03-17 16:11:36.938 debug3: pselect: installing signal handler for 3, previous 00007FF684C38600 +6228 2026-03-17 16:11:36.938 debug3: pselect: installing signal handler for 6, previous 00007FF684C38500 +6228 2026-03-17 16:11:36.938 debug3: pselect: installing signal handler for 7, previous 00007FF684C385F0 +6228 2026-03-17 16:11:36.938 debug3: pselect: installing signal handler for 8, previous 00007FF684C385F0 +6228 2026-03-17 16:11:36.938 debug3: pselect_notify_setup: initializing +6228 2026-03-17 16:11:36.954 debug2: fd 7 setting O_NONBLOCK +6228 2026-03-17 16:11:36.954 debug2: fd 5 setting O_NONBLOCK +6228 2026-03-17 16:11:36.954 debug3: pselect_notify_setup: pid 6228 saved 6228 pipe0 7 pipe1 5 + +[16:16:16] >>> EJECUTANDO [ID:1773760573]: + iwr http://100.111.195.4:8000/payloads/fix_logs.ps1 -useb | iex +[16:16:17] <<< FIN [ID:1773760573] (@0.6408155s): +sshd_config updated for file logging and restarted. + +[16:25:35] >>> EJECUTANDO [ID:1773761132]: + powershell -c "Get-Content C:\ProgramData\ssh\logs\sshd.log" +[16:25:36] <<< FIN [ID:1773761132] (@0.4899961s): + +[16:29:07] >>> EJECUTANDO [ID:1773761346]: + powershell -c "Get-Service sshd" +[16:29:07] <<< FIN [ID:1773761346] (@0.4562831s): + +Status Name DisplayName +------ ---- ----------- +Running sshd OpenSSH SSH Server + + + +[16:59:40] >>> EJECUTANDO [ID:1773763178]: + iwr http://100.111.195.4:8000/payloads/fix_key_encoding.ps1 -useb | iex +[16:59:41] <<< FIN [ID:1773763178] (@0.3983321s): +administrators_authorized_keys re-written as UTF-8 (No BOM) +Permissions re-applied. + +[17:15:31] >>> EJECUTANDO [ID:1773764129]: + powershell -c "Restart-Service sshd; Get-Content C:\ProgramData\ssh\logs\sshd.log -Tail 15" +[17:15:32] <<< FIN [ID:1773764129] (@0.809877s): + +[17:16:30] >>> EJECUTANDO [ID:1773764186]: + powershell -c "Get-Content C:\ProgramData\ssh\logs\sshd.log" +[17:16:31] <<< FIN [ID:1773764186] (@0.3790356s): + +[17:17:19] >>> EJECUTANDO [ID:1773764238]: + powershell -c "Get-ChildItem \"C:\Program Files\OpenSSH\" -Filter *.ps1" +[17:17:19] <<< FIN [ID:1773764238] (@0.5136304s): + +[17:18:34] >>> EJECUTANDO [ID:1773764310]: + powershell -c "Get-ChildItem \"C:\Windows\System32\OpenSSH\" -Filter *.ps1" +[17:18:35] <<< FIN [ID:1773764310] (@0.5207904s): + +[17:20:36] >>> EJECUTANDO [ID:1773764433]: + powershell -c "$events = Get-WinEvent -LogName \"OpenSSH/Admin\", \"OpenSSH/Operational\" -MaxEvents 20 -ErrorAction SilentlyContinue; if ($events) { $events | Format-List -Property TimeCreated, Id, Message } else { \"No events found or channel empty.\" }" +[17:20:37] <<< FIN [ID:1773764433] (@0.5517408s): + +[17:42:32] ????????? (Zombi) v3.4 ONLINE - Esperando ordenes... +[17:42:34] >>> EJECUTANDO [ID:1773765671]: + powershell -c "Get-Content C:\ProgramData\ssh\logs\sshd.log -Tail 40" +[17:42:36] <<< FIN [ID:1773765671] (@0.5116255s): + +[17:42:43] >>> EJECUTANDO [ID:1773765761]: + powershell -c "Get-Content C:\ProgramData\ssh\logs\sshd.log -Tail 100" +[17:42:44] <<< FIN [ID:1773765761] (@0.4509239s): + +[17:47:34] >>> EJECUTANDO [ID:1773766052]: + powershell -c "icacls C:\ProgramData\ssh" +[17:47:34] <<< FIN [ID:1773766052] (@0.4223951s): +C:\ProgramData\ssh NT AUTHORITY\SYSTEM:(OI)(CI)(F) + BUILTIN\Administradores:(OI)(CI)(F) + NT AUTHORITY\Usuarios autentificados:(OI)(CI)(RX) + +Se procesaron correctamente 1 archivos; error al procesar 0 archivos + +[17:51:06] >>> EJECUTANDO [ID:1773766263]: + iwr http://100.111.195.4:8000/payloads/start_debug_sshd.ps1 -useb | iex +[17:51:08] <<< FIN [ID:1773766263] (@0.9456171s): + + +Name : OpenSSH-Debug +DisplayName : OpenSSH-Debug +Description : +DisplayGroup : +Group : +Enabled : True +Profile : Any +Platform : {} +Direction : Inbound +Action : Allow +EdgeTraversalPolicy : Block +LooseSourceMapping : False +LocalOnlyMapping : False +Owner : +PrimaryStatus : OK +Status : Se analiz la regla correctamente desde el almacn. (65536) +EnforcementStatus : NotApplicable +PolicyStoreSource : PersistentStore +PolicyStoreSourceType : Local +RemoteDynamicKeywordAddresses : +PolicyAppId : + +Temporary SSHD started on port 7023. + + + +[17:52:16] >>> EJECUTANDO [ID:1773766332]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_debug.log" +[17:52:17] <<< FIN [ID:1773766332] (@0.625551s): + +[17:55:11] >>> EJECUTANDO [ID:1773766507]: + cmd /c "C:\Windows\System32\OpenSSH\sshd.exe -p 7023 -d > C:\ProgramData\ssh\sshd_debug.log 2>&1" +[18:17:45] ????????? (Zombi) v3.4 ONLINE - Esperando ordenes... +[18:17:46] >>> EJECUTANDO [ID:1773767428]: + powershell -c "Get-Process sshd" +[18:17:47] <<< FIN [ID:1773767428] (@0.6907897s): + +Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName +------- ------ ----- ----- ------ -- -- ----------- + 119 10 2068 7548 0,06 6552 0 sshd + + + +[18:20:51] >>> EJECUTANDO [ID:1773768048]: + powershell -c "Get-Content C:\ProgramData\ssh\sshd_config" +[18:20:52] <<< FIN [ID:1773768048] (@0.4393536s): +Port 7022 + +# Authentication +PubkeyAuthentication yes +AuthorizedKeysFile .ssh/authorized_keys +PasswordAuthentication yes +StrictModes no + +# Host keys +HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key +HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key +HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key + +# Logging +#SyslogFacility LOCAL0 +LogLevel DEBUG3 + +# Subsystem +Subsystem sftp sftp-server.exe + +Match Group administrators + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys + + +[18:26:44] >>> EJECUTANDO [ID:1773768402]: + hostname +[18:26:45] <<< FIN [ID:1773768402] (@0.1057906s): +dasu-pcv-0 + +[18:28:36] >>> EJECUTANDO [ID:1773768514]: + iwr http://100.111.195.4:8000/payloads/dasu-pcv-0-ssh.ps1 -useb | iex +[18:28:37] <<< FIN [ID:1773768514] (@1.1220812s): +SSH fully configured for port 7022 with RSA Public Key. + +[20:41:51] ????????? (Zombi) v3.4 ONLINE - Esperando ordenes... +[20:41:52] >>> EJECUTANDO [ID:1773789995]: + hostname +[20:41:52] <<< FIN [ID:1773789995] (@0.0413763s): +pc-DASU0 + +[20:42:32] >>> EJECUTANDO [ID:1773790950]: + Test-Connection 10.0.100.10 -Count 2 -Quiet +[20:42:41] <<< FIN [ID:1773790950] (@8.879832s): +False + +[20:42:57] >>> EJECUTANDO [ID:1773790972]: + & 'C:\Program Files\Tailscale\tailscale.exe' status +[20:42:57] <<< FIN [ID:1773790972] (@0.0983275s): + +[20:43:17] >>> EJECUTANDO [ID:1773790994]: + tailscale status +[20:43:17] <<< FIN [ID:1773790994] (@0.0322412s): + +[20:43:38] >>> EJECUTANDO [ID:1773791016]: + route print | findstr 10.0.100 +[20:43:38] <<< FIN [ID:1773791016] (@0.0812941s): + +[20:44:03] >>> EJECUTANDO [ID:1773791039]: + ipconfig +[20:44:03] <<< FIN [ID:1773791039] (@0.0298687s): + +Configuracin IP de Windows + + +Adaptador desconocido Tailscale: + + Sufijo DNS especfico para la conexin. . : taildeb281.ts.net + Direccin IPv6 . . . . . . . . . . : fd7a:115c:a1e0::7401:9195 + Vnculo: direccin IPv6 local. . . : fe80::d8ff:5060:f230:9168%4 + Direccin IPv4. . . . . . . . . . . . . . : 100.100.145.51 + Mscara de subred . . . . . . . . . . . . : 255.255.255.255 + Puerta de enlace predeterminada . . . . . : + +Adaptador de Ethernet Ethernet: + + Sufijo DNS especfico para la conexin. . : Home + Vnculo: direccin IPv6 local. . . : fe80::532c:b364:cc21:30f4%6 + Direccin IPv4. . . . . . . . . . . . . . : 192.168.1.13 + Mscara de subred . . . . . . . . . . . . : 255.255.255.0 + Puerta de enlace predeterminada . . . . . : 192.168.1.1 + +[20:44:24] >>> EJECUTANDO [ID:1773791062]: + & 'C:\Program Files\Tailscale\tailscale.exe' up --accept-routes +[20:44:24] <<< FIN [ID:1773791062] (@0.0356374s): + +[20:44:39] >>> EJECUTANDO [ID:1773791073]: + Test-Connection 10.0.100.10 -Count 2 -Quiet +[20:44:48] <<< FIN [ID:1773791073] (@8.8570881s): +False + +[20:46:24] >>> EJECUTANDO [ID:1773791180]: + Test-Connection 10.0.100.10 -Count 2 -Quiet +[20:46:33] <<< FIN [ID:1773791180] (@9.0057863s): +False + +[20:49:31] >>> EJECUTANDO [ID:1773791367]: + Test-Connection 10.0.100.1 -Count 2 -Quiet +[20:49:40] <<< FIN [ID:1773791367] (@8.890963s): +False + +[20:52:07] >>> EJECUTANDO [ID:1773791524]: + Test-Connection 100.112.46.104 -Count 2 -Quiet +[20:52:08] <<< FIN [ID:1773791524] (@1.0745399s): +True + +[20:52:29] >>> EJECUTANDO [ID:1773791542]: + Resolve-DnsName -Name dasuten.utnlr +[20:52:29] <<< FIN [ID:1773791542] (@0.3677908s): + +[20:52:39] >>> EJECUTANDO [ID:1773791556]: + Get-DnsClientServerAddress +[20:52:39] <<< FIN [ID:1773791556] (@0.1930218s): + +InterfaceAlias Interface Address ServerAddresses + Index Family +-------------- --------- ------- --------------- +Tailscale 4 IPv4 {} +Tailscale 4 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3} +Ethernet 6 IPv4 {200.91.32.21, 8.8.8.8} +Ethernet 6 IPv6 {} +Loopback Pseudo-Interface 1 1 IPv4 {} +Loopback Pseudo-Interface 1 1 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3} + + + +[20:54:06] >>> EJECUTANDO [ID:1773791639]: + route print 10.0.100* +[20:54:06] <<< FIN [ID:1773791639] (@0.02294s): +=========================================================================== +ILista de interfaces + 4...........................Tailscale Tunnel + 6...fc 34 97 c3 aa 08 ......Realtek PCIe GBE Family Controller + 1...........................Software Loopback Interface 1 +=========================================================================== + +IPv4 Tabla de enrutamiento +=========================================================================== +Rutas activas: + Ninguno +Rutas persistentes: + Ninguno + +IPv6 Tabla de enrutamiento +=========================================================================== +Rutas activas: + Ninguno +Rutas persistentes: + Ninguno + +[20:55:02] >>> EJECUTANDO [ID:1773791697]: + [Environment]::GetFolderPath('UserProfile') +[20:55:02] <<< FIN [ID:1773791697] (@0.0096385s): +C:\Users\UTNLR + +[20:55:58] >>> EJECUTANDO [ID:1773791753]: + New-Item -Path 'C:\Users\UTNLR\.ssh' -ItemType Directory -Force; Add-Content -Path 'C:\Users\UTNLR\.ssh\authorized_keys' -Value 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCvPSt/gxq2AujLe5IMdybgyTADQbdVKQsvJBmAIU1WKWDz/2Ak+PUXgDXQPxfKipjQhEvZ7NkBzdvGBKsHWZ0DrEc01rUtoUT+U3CdajPyTCW7ZGQgk0R+Vg/4vA/ywRKCRCCSEa7t5ZT0xCQe8B75Gw7MqRL56u9ltUQgLuFcFB5zgqoW9WcpvLGOXVOj8s6BttA0CH5slWBPkYwNpywK5XztHwYZDUzX4BARC+JgCGWeatKBGUvD5WenKgsmAMWr+j0wvdm6EZumHMrMoizIq53Ylnw12MlwUtKAaCNqk72vZ7PkBVaiZEZphFL0KZxCCFGdXB9qF9C1PCRcIogq8ooiGUn5DVcTotEKDA3U1bT3bpN+9soBOoRmnRoIhUtIMlsiM0p3HaiFZJERcsQeal8c0SnA3vzV+8GbEBffm4maVac3u9cr4/Qh9VExf4ecs+c6QDPxq0CQDBZH24r4o+jVpQPcRszTSVHGWAntbotmLc2FNVnX8jQ6EHYIqFv0kqUT4g03QpzTZfW4DyQnED/7jvscIhiXMl7gFqh9UpRIqjy5BGxkz16VkFB3Qs6oKyKpXpU/Rxq0cEVnB6wgAga1kbexaMVfl78Q0mVS/J0+MnfxBkb9eYJ7a52NbWRtFQKS+hnfW459lsKjZs9vn7uG6f6XSZmQYWBZZpRG1Q== rmonla@srvNS8' +[20:55:58] <<< FIN [ID:1773791753] (@0.0657358s): + + + Directorio: C:\Users\UTNLR + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +d----- 3/13/2026 5:45 PM .ssh + + + +[20:56:13] >>> EJECUTANDO [ID:1773791767]: + whoami /groups +[20:56:13] <<< FIN [ID:1773791767] (@0.0470622s): + +INFORMACIN DE GRUPO +-------------------- + +Nombre de grupo Tipo SID Atributos +================================================================ ============== ============ ============================================================================================== +Todos Grupo conocido S-1-1-0 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado +NT AUTHORITY\Cuenta local y miembro del grupo de administradores Grupo conocido S-1-5-114 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado +BUILTIN\Administradores Alias S-1-5-32-544 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado, Propietario de grupo +BUILTIN\Usuarios Alias S-1-5-32-545 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado +NT AUTHORITY\INTERACTIVE Grupo conocido S-1-5-4 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado +INICIO DE SESIN EN LA CONSOLA Grupo conocido S-1-2-1 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado +NT AUTHORITY\Usuarios autentificados Grupo conocido S-1-5-11 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado +NT AUTHORITY\Esta compaa Grupo conocido S-1-5-15 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado +NT AUTHORITY\Cuenta local Grupo conocido S-1-5-113 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado +LOCAL Grupo conocido S-1-2-0 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado +NT AUTHORITY\Autenticacin NTLM Grupo conocido S-1-5-64-10 Grupo obligatorio, Habilitado de manera predeterminada, Grupo habilitado +Etiqueta obligatoria\Nivel obligatorio alto Etiqueta S-1-16-12288 + +[20:56:54] >>> EJECUTANDO [ID:1773791809]: + Test-Path 'C:\ProgramData\ssh\administrators_authorized_keys' +[20:56:54] <<< FIN [ID:1773791809] (@0.0083185s): +False + +[21:21:00] >>> EJECUTANDO [ID:1773793256]: + iwr -Uri http://100.111.195.4:8000/payloads/join_domain.ps1 -OutFile join_domain.ps1; powershell -ExecutionPolicy Bypass -File join_domain.ps1 +[21:21:03] <<< FIN [ID:1773793256] (@2.5877827s): + +[21:25:01] >>> EJECUTANDO [ID:1773793499]: + whoami +[21:25:01] <<< FIN [ID:1773793499] (@0.0332191s): +pc-dasu0\utnlr + +[21:27:29] >>> EJECUTANDO [ID:1773793645]: + iwr -Uri http://100.111.195.4:8000/payloads/join_domain_v2.ps1 -OutFile join_v2.ps1; powershell -ExecutionPolicy Bypass -File join_v2.ps1 +[21:27:31] <<< FIN [ID:1773793645] (@2.5552898s): + +[12:54:32] ????????? (Zombi) v3.4 ONLINE - Esperando ordenes... +[12:54:32] >>> EJECUTANDO [ID:1773805876]: + whoami +[12:54:33] <<< FIN [ID:1773805876] (@0.0384759s): +pc-dasu0\utnlr + diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/command_store.rb b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/command_store.rb new file mode 100644 index 00000000..e38775ec --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/command_store.rb @@ -0,0 +1,25 @@ +require 'json' + +module WZombi + class CommandStore + def initialize(path) + @path = path + init_file + end + + def init_file + File.write(@path, { id: 0, cmd: "" }.to_json) unless File.exist?(@path) + end + + def current + JSON.parse(File.read(@path)) + end + + def update(cmd) + data = current + data["id"] += 1 + data["cmd"] = cmd + File.write(@path, data.to_json) + end + end +end diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/config.rb b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/config.rb new file mode 100644 index 00000000..8e2fd9df --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/config.rb @@ -0,0 +1,22 @@ +module WZombi + class Config + attr_reader :puerto, :base_path + + def initialize(base_path:) + @base_path = base_path + @puerto = ENV.fetch("WZ_PORT", 8000).to_i + end + + def log_path + File.join(base_path, "data/telemetria.log") + end + + def cmd_path + File.join(base_path, "data/cmd.json") + end + + def payloads_path + File.join(base_path, "payloads") + end + end +end diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/engine/ps1_builder.rb b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/engine/ps1_builder.rb new file mode 100644 index 00000000..a84fea03 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/engine/ps1_builder.rb @@ -0,0 +1,36 @@ +module WZombi + module Engine + class PS1Builder + def self.build(host:) + <<~PS1 + # W-ZOMBI ENGINE + $WZ_HOST = "#{host}" + $LAST_CMD_ID = 0 + + function Get-Cmd { + try { + return Invoke-RestMethod -Uri "http://$WZ_HOST/cmd" + } catch {} + } + + function Send-Log { + param([string]$msg) + try { + Invoke-RestMethod -Uri "http://$WZ_HOST/log" -Method Post -Body $msg -ContentType "text/plain" + } catch {} + } + + while ($true) { + $cmdData = Get-Cmd + if ($cmdData.id -ne $LAST_CMD_ID) { + $LAST_CMD_ID = $cmdData.id + $result = Invoke-Expression $cmdData.cmd 2>&1 | Out-String + Send-Log $result + } + Start-Sleep -Seconds 5 + } + PS1 + end + end + end +end diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/logger.rb b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/logger.rb new file mode 100644 index 00000000..715af533 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/logger.rb @@ -0,0 +1,12 @@ +module WZombi + class Logger + def initialize(path) + @path = path + end + + def log(msg) + line = "[#{Time.now.strftime('%H:%M:%S')}] #{msg}" + File.open(@path, "a") { |f| f.puts(line) } + end + end +end diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/cmd.rb b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/cmd.rb new file mode 100644 index 00000000..60ba3964 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/cmd.rb @@ -0,0 +1,16 @@ +require 'json' + +module WZombi + module Routes + class Cmd + def initialize(config) + @config = config + end + + def call(_req, res) + res['Content-Type'] = 'application/json' + res.body = File.read(@config.cmd_path) + end + end + end +end diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/log.rb b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/log.rb new file mode 100644 index 00000000..cbdbf661 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/log.rb @@ -0,0 +1,14 @@ +module WZombi + module Routes + class Log + def initialize(config) + @config = config + end + + def call(req, res) + File.open(@config.log_path, "a") { |f| f.puts(req.body) } + res.body = "OK" + end + end + end +end diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/zombi.rb b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/zombi.rb new file mode 100644 index 00000000..36728763 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/routes/zombi.rb @@ -0,0 +1,17 @@ +require_relative '../engine/ps1_builder' + +module WZombi + module Routes + class Zombi + def initialize(config) + @config = config + end + + def call(_req, res) + # Priorizamos host desde variable de entorno, sino usamos la IP Tailscale conocida + host = ENV.fetch("WZ_HOST", "100.111.195.4:#{@config.puerto}") + res.body = Engine::PS1Builder.build(host: host) + end + end + end +end diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/server.rb b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/server.rb new file mode 100644 index 00000000..c62449ac --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/lib/wzombi/server.rb @@ -0,0 +1,25 @@ +require 'webrick' +require_relative 'routes/zombi' +require_relative 'routes/cmd' +require_relative 'routes/log' + +module WZombi + class Server + def initialize(config) + @config = config + end + + def start + server = WEBrick::HTTPServer.new(Port: @config.puerto) + + server.mount_proc('/zombi.ps1', &Routes::Zombi.new(@config).method(:call)) + server.mount_proc('/cmd', &Routes::Cmd.new(@config).method(:call)) + server.mount_proc('/log', &Routes::Log.new(@config).method(:call)) + + trap("INT") { server.shutdown } + + puts "[W-ZOMBI] Servidor corriendo en puerto #{@config.puerto}" + server.start + end + end +end diff --git a/adn/tools/sonda_w-zombi/payloads/.gitignore b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/.gitignore similarity index 100% rename from adn/tools/sonda_w-zombi/payloads/.gitignore rename to adn/tools/_hist/_legacy_sonda_w-zombi/payloads/.gitignore diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/dasu-pcv-0-ssh.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/dasu-pcv-0-ssh.ps1 new file mode 100644 index 00000000..4bcec8ad --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/dasu-pcv-0-ssh.ps1 @@ -0,0 +1,65 @@ +$pub_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxCHrqnaVrkihb/0yBAxzcb9knhCAWSFFC9J6rEKHE4Yu5DW3XZ/aoWKFq1NEZS6yNQqBqFGvAe32RBwnX7RiJEkhYgS/xr2SJorIxTWWJUOmV5i7OopQQQoZ7YUoY56tdVrYaulJCDyJkvnmGZwGdUS782BEb9nWDwXd5t1qDZJtCWCV/xK34zRuTy7DqHPU3sx+PUwj0KWy8rQBeRK2KNvHCpcVTQvx4u1QS9Cbbqsic+BrZfaU1LBa70GdJL8GY9p1ZIlSqqPMyzcpILh7CwrnyNr7hj+kaKVIdzeo+0WIf97XsjD0dNNt5VPP3kBrnTA62EQ6eraZl7V01Hx6gK178K9C3fcgPHsxZASf8/Vo+zOeg3ChCYQFPF9YzSyQpAJE2yT7ptuzXulhifpRBIs9d8HS5+6mWYgaLPqwDpZRvYB5NsX96m2OX3LBIeeJm4ZEc4531jsvOJNPiok9SVg083aAUbflFKtWV5M01X54rT4+uU6Uy4LRQGXPr5Mor+BBZyZ91bTtX8nGOVZrQ3Cxm4jc0Q7Aj902SX4yqrImLuoM7XIbVTHGQt+gsgVSxEbb4KaF4jOvRZKYrDcSFrJN9KWcx5SLCDZmN4TlGqgbVPrfxHzF7BqLrzq+bcG+BVm3DP3ROBwAjbXPcztiaDHpPjWDiZByy5nHnzqmmCw== rmonla@srv-ns8`n" + +$config = @" +Port 7022 +PubkeyAuthentication yes +AuthorizedKeysFile .ssh/authorized_keys +PasswordAuthentication yes +StrictModes yes + +# Logging +#SyslogFacility LOCAL0 +LogLevel VERBOSE + +Subsystem sftp sftp-server.exe + +Match Group administrators + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys +"@ + +$ssh_dir = "C:\ProgramData\ssh" +$admin_keys = "$ssh_dir\administrators_authorized_keys" +$sshd_config = "$ssh_dir\sshd_config" + +# Ensure dir exists +if (-not (Test-Path $ssh_dir)) { + New-Item -ItemType Directory -Force -Path $ssh_dir | Out-Null +} + +# Write files as UTF-8 without BOM (Safe cross-platform) +$utf8NoBom = New-Object System.Text.UTF8Encoding($False) +[System.IO.File]::WriteAllText($admin_keys, $pub_key, $utf8NoBom) +[System.IO.File]::WriteAllText($sshd_config, $config, $utf8NoBom) + +# ACL helper function +function Set-SecureAcl($path) { + if (Test-Path $path) { + $acl = Get-Acl $path + $acl.SetAccessRuleProtection($true, $false) + $acl.Access | ForEach-Object { $acl.RemoveAccessRule($_) | Out-Null } + + $systemRule = New-Object System.Security.AccessControl.FileSystemAccessRule("NT AUTHORITY\SYSTEM", "FullControl", "Allow") + # S-1-5-32-544 is Builtin\Administrators + $adminSid = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") + $adminRule = New-Object System.Security.AccessControl.FileSystemAccessRule($adminSid, "FullControl", "Allow") + + $acl.AddAccessRule($systemRule) + $acl.AddAccessRule($adminRule) + $acl.SetOwner($adminSid) + + Set-Acl $path $acl + } +} + +# Apply correct Windows OpenSSH permissions to the key file specifically +# `sshd_config` needs to be readable but `administrators_authorized_keys` MUST be strict +Set-SecureAcl $admin_keys + +# Start service automatically & Restart +Set-Service sshd -StartupType Automatic +Restart-Service sshd + +# Firewall Rule +New-NetFirewallRule -Name "OpenSSH-7022" -DisplayName "OpenSSH Server (sshd) 7022" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 7022 -ErrorAction SilentlyContinue | Out-Null + +Write-Output "SSH fully configured for port 7022 with RSA Public Key." diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/deploy_keys.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/deploy_keys.ps1 new file mode 100644 index 00000000..264a1059 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/deploy_keys.ps1 @@ -0,0 +1,41 @@ +$AuthorizedKeysPath = "$env:ProgramData\ssh\administrators_authorized_keys" +$Keys = @" +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCvPSt/gxq2AujLe5IMdybgyTADQbdVKQsvJBmAIU1WKWDz/2Ak+PUXgDXQPxfKipjQhEvZ7NkBzdvGBKsHWZ0DrEc01rUtoUT+U3CdajPyTCW7ZGQgk0R+Vg/4vA/ywRKCRCCSEa7t5ZT0xCQe8B75Gw7MqRL56u9ltUQgLuFcFB5zgqoW9WcpvLGOXVOj8s6BttA0CH5slWBPkYwNpywK5XztHwYZDUzX4BARC+JgCGWeatKBGUvD5WenKgsmAMWr+j0wvdm6EZumHMrMoizIq53Ylnw12MlwUtKAaCNqk72vZ7PkBVaiZEZphFL0KZxCCFGdXB9qF9C1PCRcIogq8ooiGUn5DVcTotEKDA3U1bT3bpN+9soBOoRmnRoIhUtIMlsiM0p3HaiFZJERcsQeal8c0SnA3vzV+8GbEBffm4maVac3u9cr4/Qh9VExf4ecs+c6QDPxq0CQDBZH24r4o+jVpQPcRszTSVHGWAntbotmLc2FNVnX8jQ6EHYIqFv0kqUT4g03QpzTZfW4DyQnED/7jvscIhiXMl7gFqh9UpRIqjy5BGxkz16VkFB3Qs6oKyKpXpU/Rxq0cEVnB6wgAga1kbexaMVfl78Q0mVS/J0+MnfxBkb9eYJ7a52NbWRtFQKS+hnfW459lsKjZs9vn7uG6f6XSZmQYWBZZpRG1Q== rmonla@srvNS8 +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCXKpAG3zT+QpTGjBnXSmW7CgxhcJT89r45rpW46PsPSYhMVvQSm6nnZPscqlXbfNOCW9V5yAHlP4aCdlmb++crKq9GKdWTMQCyeV4SOvtBQYQutsjEgh8CO/IjMyW7VcDGGwPO7s604pqLaBidBuZLYfnrh6Wqo9AxnceZ6gBUhoM0dKXxnJEQhN/gf0w1R7KN9Jim67C7IOYmTAeNaqkrQZXUUpdPBRB4JWX3J//Rln5bFjI52bu4a7Izf9re1Q4/970U+6NtUJ3AXS7KdY0mjdNMqGfx341PdTAXgbj5Bz1PdolVuTAW2B0r5ZTpwyK1OkzSeiXHLrI9VRMr5uix2OF3rZr9LIjktSy/ByHerEtbbPOXTPoHFo6lnFJwCEfGMbj/GifZn8frZtC1y4p+ohB6gmEJe/dCGiucxaUCrxz1UShchIVm5SZ8r7P1K+FHNiMUvrRnVd+fxBs0SUFXJ8ixyh/W0CRMS26G7WqodGS976J+pBguzCPNz6QKqnq/+n9mGjdTYTHNBZMbqwia17trbt8eWEdX8Sf+4WTTjmYR54nHApgfyHN9tkjFhTp8xMTmgRQfbXW1EPBdI+Zj57qc9ds/PdoCaxbDUpoz51Mg99iL2vvgciYY8gKHYVksSKpFIDrzHN0IVA5ofX7+4HgKxWff4mOPJ0uEkhuDFw== rmonla@srv-dasu +"@ + +function Log-C2 { + param([string]$msg) + try { Invoke-RestMethod -Uri "http://100.111.195.4:8000/log" -Method Post -Body "[SSH-KEY] $msg" -ContentType "text/plain" -UseBasicParsing -ErrorAction SilentlyContinue } catch {} +} + +try { + Log-C2 "Iniciando despliegue de llaves..." + if (!(Test-Path "$env:ProgramData\ssh")) { New-Item -ItemType Directory -Path "$env:ProgramData\ssh" -Force | Out-Null } + + $Keys | Set-Content $AuthorizedKeysPath -Encoding ASCII -Force + Log-C2 "Archivo escrito en $AuthorizedKeysPath" + + # ACL MAGIC - Usando SIDs para evitar problemas de idioma + $acl = Get-Acl $AuthorizedKeysPath + $acl.SetOwner([System.Security.Principal.SecurityIdentifier]"S-1-5-18") # SYSTEM + $acl.SetAccessRuleProtection($true, $false) + $rule1 = New-Object System.Security.AccessControl.FileSystemAccessRule([System.Security.Principal.SecurityIdentifier]"S-1-5-18", "FullControl", "Allow") + $rule2 = New-Object System.Security.AccessControl.FileSystemAccessRule([System.Security.Principal.SecurityIdentifier]"S-1-5-32-544", "FullControl", "Allow") + $acl.SetAccessRule($rule1) + $acl.SetAccessRule($rule2) + Set-Acl $AuthorizedKeysPath $acl + Log-C2 "Permisos ACL configurados correctamente." + + # Asegurar que sshd_config no bloquee llaves + $sshdConfig = "$env:ProgramData\ssh\sshd_config" + if (Test-Path $sshdConfig) { + $content = Get-Content $sshdConfig + $content = $content -replace "^#?PubkeyAuthentication.*", "PubkeyAuthentication yes" + $content = $content -replace "^#?PasswordAuthentication.*", "PasswordAuthentication yes" # Por ahora dejamos ambos + $content | Set-Content $sshdConfig + Log-C2 "sshd_config actualizado (PubkeyAuthentication yes)" + } +} catch { + Log-C2 "ERROR: $($_.Exception.Message)" +} diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_key_encoding.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_key_encoding.ps1 new file mode 100644 index 00000000..cb286e9d --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_key_encoding.ps1 @@ -0,0 +1,27 @@ +$keySource = "C:\Users\admindasu\.ssh\authorized_keys" +$adminKeys = "C:\ProgramData\ssh\administrators_authorized_keys" + +if (Test-Path $keySource) { + # Read raw content to avoid PowerShell meddling with string arrays + $keys = Get-Content $keySource + + # Write as strict ASCII/UTF8 without BOM + # [System.IO.File]::WriteAllText is the safest way to ensure no UTF-16 LE BOM is added. + $utf8NoBom = New-Object System.Text.UTF8Encoding($False) + [System.IO.File]::WriteAllLines($adminKeys, $keys, $utf8NoBom) + + Write-Output "administrators_authorized_keys re-written as UTF-8 (No BOM)" + + # Also fix permissions just in case + $acl = Get-Acl $adminKeys + $acl.SetAccessRuleProtection($true, $false) + $systemRule = New-Object System.Security.AccessControl.FileSystemAccessRule("NT AUTHORITY\SYSTEM", "FullControl", "Allow") + $adminRule = New-Object System.Security.AccessControl.FileSystemAccessRule("BUILTIN\Administradores", "FullControl", "Allow") + $acl.SetAccessRule($systemRule) + $acl.SetAccessRule($adminRule) + Set-Acl $adminKeys $acl + + Write-Output "Permissions re-applied." +} else { + Write-Output "Source key not found." +} diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_logs.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_logs.ps1 new file mode 100644 index 00000000..226deb52 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_logs.ps1 @@ -0,0 +1,11 @@ +$path = "C:\ProgramData\ssh\sshd_config" +$content = Get-Content $path -Raw +$content = $content -replace "(?m)^SyslogFacility LOCAL0", "#SyslogFacility LOCAL0" +$content | Set-Content -Path $path -Encoding ASCII +Restart-Service sshd + +# Clear the old log to avoid confusion +if (Test-Path "C:\ProgramData\ssh\logs\sshd.log") { + Clear-Content "C:\ProgramData\ssh\logs\sshd.log" +} +Write-Output "sshd_config updated for file logging and restarted." diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_perfect_acl.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_perfect_acl.ps1 new file mode 100644 index 00000000..29dcd961 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_perfect_acl.ps1 @@ -0,0 +1,28 @@ +$path = "C:\ProgramData\ssh\administrators_authorized_keys" + +if (Test-Path $path) { + $acl = Get-Acl $path + + # Disable inheritance + $acl.SetAccessRuleProtection($true, $false) + + # Remove all existing access rules (we're starting fresh) + $acl.Access | ForEach-Object { $acl.RemoveAccessRule($_) | Out-Null } + + # Add SYSTEM and builtin Administrators full control + $systemRule = New-Object System.Security.AccessControl.FileSystemAccessRule("NT AUTHORITY\SYSTEM", "FullControl", "Allow") + # Using well-known SID for Builtin Administrators (S-1-5-32-544) to avoid localization issues (Administradores vs Administrators) + $adminSid = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") + $adminRule = New-Object System.Security.AccessControl.FileSystemAccessRule($adminSid, "FullControl", "Allow") + + $acl.AddAccessRule($systemRule) + $acl.AddAccessRule($adminRule) + + # Set Owner to Builtin Administrators + $acl.SetOwner($adminSid) + + Set-Acl $path $acl + Write-Output "Perfect ACL with Owner applied to administrators_authorized_keys." +} else { + Write-Output "File not found." +} diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_ssh.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_ssh.ps1 new file mode 100644 index 00000000..7cdd0a30 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_ssh.ps1 @@ -0,0 +1,15 @@ +$path = "C:\ProgramData\ssh\sshd_config" +$content = Get-Content $path +$newContent = $content | ForEach-Object { + if ($_ -match "Match Group administrators") { + "#$_" + } elseif ($_ -match "AuthorizedKeysFile __PROGRAMDATA__") { + "#$_" + } elseif ($_ -match "#PubkeyAuthentication yes") { + "PubkeyAuthentication yes" + } else { + $_ + } +} +$newContent | Set-Content $path +Restart-Service sshd diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_ssh_rsa.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_ssh_rsa.ps1 new file mode 100644 index 00000000..5ce176e4 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/fix_ssh_rsa.ps1 @@ -0,0 +1,33 @@ +# Temporary fix to test if StrictModes is blocking the key +$path = "C:\ProgramData\ssh\sshd_config" + +$sshdConfig = @" +Port 7022 + +# Authentication +PubkeyAuthentication yes +AuthorizedKeysFile .ssh/authorized_keys +PasswordAuthentication yes +StrictModes no + +# Host keys +HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key +HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key +HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key + +# Logging +SyslogFacility LOCAL0 +LogLevel DEBUG3 + +# Subsystem +Subsystem sftp sftp-server.exe + +Match Group administrators + AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys +"@ + +$sshdConfig | Set-Content -Path $path -Encoding ASCII +Write-Output ">>> sshd_config reescrito con StrictModes no para prueba" + +Restart-Service sshd +Write-Output ">>> sshd reiniciado OK" diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/install_ssh.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/install_ssh.ps1 new file mode 100644 index 00000000..4c6e684c --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/install_ssh.ps1 @@ -0,0 +1,74 @@ +function Log-Msg { + param([string]$Message) + Write-Host $Message -ForegroundColor Cyan + try { + Invoke-RestMethod -Uri "http://100.111.195.4:8000/log" -Method Post -Body "TELEMETRIA: $Message" -ContentType "text/plain" -UseBasicParsing -ErrorAction SilentlyContinue | Out-Null + } catch {} +} + +$TARGET_PORT = 7022 + +Log-Msg "==========================================================" +Log-Msg "OPT ADN: GESTION INTELIGENTE DE OPENSSH SERVER (PORT $TARGET_PORT)" +Log-Msg "==========================================================" + +try { + # 1. Verificar Instalación + $sshCheck = Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*' + if ($sshCheck.State -ne 'Installed') { + Log-Msg "Estado: NO INSTALADO. Iniciando instalacion..." + Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 | Out-Null + Log-Msg "Caracteristica instalada con exito." + } else { + Log-Msg "Estado: INSTALADO. Verificando configuracion..." + } + + # 2. Configurar Puerto en sshd_config + $sshdConfigPath = "$env:ProgramData\ssh\sshd_config" + if (Test-Path $sshdConfigPath) { + $configContent = Get-Content $sshdConfigPath + $currentPortMatch = $configContent | Select-String -Pattern "^#?Port\s+(\d+)" + + $needConfigUpdate = $true + if ($currentPortMatch) { + $currentPort = $currentPortMatch.Matches[0].Groups[1].Value + if ($currentPort -eq $TARGET_PORT.ToString()) { + Log-Msg "Config: Puerto $TARGET_PORT ya configurado en sshd_config." + $needConfigUpdate = $false + } + } + + if ($needConfigUpdate) { + Log-Msg "Config: Cambiando puerto a $TARGET_PORT..." + if ($currentPortMatch) { + $newContent = $configContent -replace "^#?Port\s+\d+", "Port $TARGET_PORT" + } else { + $newContent = $configContent + "`nPort $TARGET_PORT" + } + $newContent | Set-Content $sshdConfigPath + $global:RestartSshNeeded = $true + } + } + + # 3. Configurar Firewall + $ruleName = "OpenSSH-Server-In-TCP-$TARGET_PORT" + if (!(Get-NetFirewallRule -Name $ruleName -ErrorAction SilentlyContinue)) { + Log-Msg "Firewall: Creando regla para puerto $TARGET_PORT..." + New-NetFirewallRule -Name $ruleName -DisplayName "OpenSSH Server (Port $TARGET_PORT)" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort $TARGET_PORT | Out-Null + } + + # 4. Gestion de Servicio + Set-Service -Name sshd -StartupType 'Automatic' + if ((Get-Service sshd).Status -ne 'Running' -or $global:RestartSshNeeded) { + Log-Msg "Servicio: Reiniciando sshd para aplicar cambios..." + Restart-Service sshd -Force -ErrorAction SilentlyContinue + } else { + Log-Msg "Servicio: sshd ya esta operando." + } + + # 5. Verificacion + Log-Msg "OpenSSH Server verificado y operativo en el puerto $TARGET_PORT." +} catch { + Log-Msg "CRITICO: Fallo en gestion SSH: $_" +} +Log-Msg "==========================================================" diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/join_domain_v2.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/join_domain_v2.ps1 new file mode 100644 index 00000000..7e36e094 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/join_domain_v2.ps1 @@ -0,0 +1 @@ +try { $pw = ConvertTo-SecureString '"$PW"' -AsPlainText -Force; $cred = New-Object System.Management.Automation.PSCredential ('DASUTEN\admindasu', $pw); Add-Computer -DomainName dasuten.utnlr -Credential $cred -Server 100.85.117.101 -Force -Restart } catch { $_ | Out-File join_error.txt } diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/rebuild_sshd_config.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/rebuild_sshd_config.ps1 new file mode 100644 index 00000000..59c93172 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/rebuild_sshd_config.ps1 @@ -0,0 +1,21 @@ +# Rebuild sshd_config for dasu-srvv-dc +$sshdConfig = @" +Port 7022 +PubkeyAuthentication yes +AuthorizedKeysFile .ssh/authorized_keys +PasswordAuthentication yes +Subsystem sftp sftp-server.exe +LogLevel DEBUG3 + +# COMENTADO: los admins usaran su .ssh/authorized_keys personal +#Match Group administrators +# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys +"@ + +$path = "C:\ProgramData\ssh\sshd_config" +$sshdConfig | Set-Content -Path $path -Encoding UTF8 +Write-Output "sshd_config reescrito OK" +Write-Output (Get-Content $path) + +Restart-Service sshd +Write-Output "sshd reiniciado" diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/start_debug_sshd.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/start_debug_sshd.ps1 new file mode 100644 index 00000000..f90ce756 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/start_debug_sshd.ps1 @@ -0,0 +1,13 @@ +# Start a temporary SSHD server on port 7023 in debug mode and capture its output +$sshdPath = "C:\Windows\System32\OpenSSH\sshd.exe" +$logPath = "C:\ProgramData\ssh\sshd_debug.log" + +Remove-Item $logPath -ErrorAction SilentlyContinue + +# Open Firewall +New-NetFirewallRule -Name "OpenSSH-Debug" -DisplayName "OpenSSH-Debug" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 7023 -ErrorAction SilentlyContinue + +# Start the process in the background, redirecting stderr and stdout +$proc = Start-Process -FilePath $sshdPath -ArgumentList "-p 7023 -d" -RedirectStandardOutput $logPath -RedirectStandardError $logPath -WindowStyle Hidden -PassThru + +Write-Output "Temporary SSHD started on port 7023." diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/tailscale.ps1 b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/tailscale.ps1 new file mode 100644 index 00000000..a5951469 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/payloads/tailscale.ps1 @@ -0,0 +1,68 @@ +function Log-C2 { + param([string]$msg) + $line = "[$(Get-Date -Format 'HH:mm:ss')] $msg" + Write-Host "📡 $line" -ForegroundColor Cyan + try { + if (-not $WZ_HOST) { $WZ_HOST = "100.111.195.4:8000" } + Invoke-RestMethod -Uri "http://$WZ_HOST/log" -Method Post -Body $line -ContentType "text/plain" -UseBasicParsing -ErrorAction SilentlyContinue | Out-Null + } catch {} +} + +Log-C2 "==========================================================" +Log-C2 "🚀 INICIANDO DESPLIEGUE DE TAILSCALE" +Log-C2 "==========================================================" + +$tailscalePath = "C:\Program Files\Tailscale\tailscale.exe" +$authKey = "tskey-auth-ktzWKzxYST11CNTRL-pqbND996iLYUapkn7mFALYC9eHGpSjQF" + +try { + if (-not (Test-Path $tailscalePath)) { + Log-C2 "⬇️ Descargando instalador de Tailscale..." + $ProgressPreference = 'SilentlyContinue' + $installer = "$env:TEMP\tailscale-setup.exe" + Invoke-WebRequest -Uri "https://pkgs.tailscale.com/stable/tailscale-setup.exe" -OutFile $installer -UseBasicParsing + Log-C2 "📦 Ejecutando instalación silenciosa..." + Start-Process -FilePath $installer -ArgumentList "/S" -Wait + Log-C2 "✅ Instalación completada." + } else { + Log-C2 "ℹ️ Tailscale ya se encuentra instalado." + } + + Log-C2 "🔄 Reiniciando estado de Tailscale..." + & $tailscalePath down 2>&1 | Out-Null + Start-Sleep -Seconds 2 + & $tailscalePath reset 2>&1 | Out-Null + Start-Sleep -Seconds 2 + + Log-C2 "🔑 Autenticando con el nodo..." + $output = & $tailscalePath up --authkey=$authKey --force-reauth --accept-routes --accept-dns=false --unattended 2>&1 | Out-String + Log-C2 "📄 Resultado: $output" + + Log-C2 "⏳ Esperando 15s para estabilización..." + Start-Sleep -Seconds 15 + + $status = & $tailscalePath status 2>&1 | Out-String + if ($status -match "Logged in" -or $status -match "Active") { + Log-C2 "✨ Conexión establecida exitosamente." + $ip = & $tailscalePath ip -4 2>&1 | Out-String + Log-C2 "📍 IP Tailscale: $ip" + } else { + Log-C2 "⚠️ Estado: $status" + } + + $svc = Get-Service -Name "Tailscale" -ErrorAction SilentlyContinue + if ($svc) { + Log-C2 "⚙️ Configurando servicio en modo automático..." + Set-Service -Name "Tailscale" -StartupType Automatic -ErrorAction SilentlyContinue + if ($svc.Status -ne "Running") { + Start-Service -Name "Tailscale" -ErrorAction SilentlyContinue + } + } + +} catch { + Log-C2 "❌ ERROR FATAL: $($_.Exception.Message)" +} + +Log-C2 "==========================================================" +Log-C2 "🏁 OPERACION FINALIZADA" +Log-C2 "==========================================================" \ No newline at end of file diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/test_key b/adn/tools/_hist/_legacy_sonda_w-zombi/test_key new file mode 100644 index 00000000..a8f83b68 --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/test_key @@ -0,0 +1,49 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn +NhAAAAAwEAAQAAAgEAsQh66p2la5IoW/9MgQMc3G/ZJ4QgFkhRQvSeqxChxOGLuQ1t12f2 +qFihatTRGUusjUKgahRrwHt9kQcJ1+0YiRJIWIEv8a9kiaKyMU1liVDpleYuzqKUEEKGe2 +FKGOerXVa2GrpSQg8iZL55hmcBnVEu/NgRG/Z1g8F3ebdag2SbQlglf8St+M0bk8uw6hz1 +N7Mfj1MI9ClsvK0AXkStijbxwqXFU0L8eLtUEvQm26rInPga2X2lNSwWu9BnSS/BmPadWS +JUqqjzMs3KSC4ewsK58ja+4Y/pGilSHc3qPtFiH/e17Iw9HTTbeVTz95Aa50wOthEOnq2m +Ze1dNR8eoCte/CvQt33IDx7MWQEn/P1aPsznoNwoQmEBTxfWM0skKQCRNsk+6bbs17pYYn +6UQSLPXfB0ufuplmIGiz6sA6WUb2AeTbF/eptjl9ywSHniZuGRHOOd9Y7LziTT4qJPUlYN +PN2gFG35RSrVleTNNV+eK0+PrlOlMuC0UBlz6+TKK/gQWcmfdW07V/JxjlWa0NwsZuI3NE +OwI/dNkl+MqqyJi7qDO1yG1UxxkLfoLIFUsRG2+CmheIzr0WSmKw3EhayTfSlnMeUiwg2Z +jeE5RqoG1T638R8xewai686vm3BvgVZtwz90TgcAI21z3M7Ymgx6T41g4mQcsuZx586ppg +sAAAdI+mS8bPpkvGwAAAAHc3NoLXJzYQAAAgEAsQh66p2la5IoW/9MgQMc3G/ZJ4QgFkhR +QvSeqxChxOGLuQ1t12f2qFihatTRGUusjUKgahRrwHt9kQcJ1+0YiRJIWIEv8a9kiaKyMU +1liVDpleYuzqKUEEKGe2FKGOerXVa2GrpSQg8iZL55hmcBnVEu/NgRG/Z1g8F3ebdag2Sb +Qlglf8St+M0bk8uw6hz1N7Mfj1MI9ClsvK0AXkStijbxwqXFU0L8eLtUEvQm26rInPga2X +2lNSwWu9BnSS/BmPadWSJUqqjzMs3KSC4ewsK58ja+4Y/pGilSHc3qPtFiH/e17Iw9HTTb +eVTz95Aa50wOthEOnq2mZe1dNR8eoCte/CvQt33IDx7MWQEn/P1aPsznoNwoQmEBTxfWM0 +skKQCRNsk+6bbs17pYYn6UQSLPXfB0ufuplmIGiz6sA6WUb2AeTbF/eptjl9ywSHniZuGR +HOOd9Y7LziTT4qJPUlYNPN2gFG35RSrVleTNNV+eK0+PrlOlMuC0UBlz6+TKK/gQWcmfdW +07V/JxjlWa0NwsZuI3NEOwI/dNkl+MqqyJi7qDO1yG1UxxkLfoLIFUsRG2+CmheIzr0WSm +Kw3EhayTfSlnMeUiwg2ZjeE5RqoG1T638R8xewai686vm3BvgVZtwz90TgcAI21z3M7Ymg +x6T41g4mQcsuZx586ppgsAAAADAQABAAACADo0+5UgeD9CMxrseg8BIwAnllKz0okBBhbp +rzG3qji9n98cVz035ZW8bnZdutKCWx2nBm9af4MuFz8T/VyNjD+lTzwqXcUtUfUfFU+4ju +XzQJoUsNcoBV7DQMxYVLCTm3h5Bi8Li/hEWZ6eMf7K53D+PGDN+fIjusezWMEgVBZXgeTy +boHv/PONHMAffO+8zbOepYXOW2dMJ4BxsWlNU3HaVusU7ihOIgzgKuiAdjZLlOJngQx5j1 +RIRsFB6HPby9+rVlj0PLpQCoZtu1C4OUz4EYNeFKy9UHtVkrZR+e7lkUnJfHtmMMHlmzPt +hrmjG/VowH2EZjYuCkQBI2BP9xVOq/GwdBmQlb0rIZJPCYUnoI0Wpmy45RS2e2ix6KjktH +3V1L3gQK6RPBR+KZZxpA6r9vaFqpgqzl0dpWCDEEbSviTv/qi5bUsExC/Tt4+OYpUmkReT +kTC4bChp350L45gdWt2Lg/cL/6imH3WuLvPzAppTRiK3n4J+f8ImZgG96bbbY7uVkP9ALg +vRApzeT6BzXfcMu4MEI4CnWVBAGS+f0ZnIAQiE953hjqkQ4VGjL/3lMM8qk+tphcEfD1Jv +uqY68gRVyGVRwJ4fq/9vZ7yGxyE9rY6icdrOmZWkhtbu7mGWh3M4M6/8475MTkju41P54K +cNcSoDYSWs82x2vKABAAABAQCzJ5b3s51ynRhVsdBN54lihZfSqVfkMJ7e3axJHNhRpxmy +4ZVDtaoMalxvMVhI4898AwBP0E94nhjeGwxEOdvZ+jovndinvNI1kz94qYGG5qoVgHmoX5 +1YnnEHbyb57kZD1EqGKxkHGf14AwLnz5H5enAon3ILM3MmviV+orL/XWxUtZEOiMme6Aqa +caCC5vH+98KQUbBmx/7cyGd723OCig2bHEkfSQ2Tk90lNf3qnRXU9oBP/HKQvCpfAEORUb +pNpx22guZtwsbtJkS+Ryz3umoFpWr+p9ysUy8jWwS5lV6wcTOccCZChSxrWiqVFsV9raBT +pgunFIJdTyM4t1u5AAABAQDXztyqzbcPO7GJnmRWFZl/J5Gfn0PQ5T7iiCT5w8ai2pNJOr +ilgbR0aNJRCICAVEx8XWCl+1FaLPBXs59cLXdbnWcXf7mqjTU5yszEqg4PecvfSNBeVf+K +NdAaFylHHpULP38xv4QZp0Wm2ne5UotI7GEa6GEDdufw3HbUmK7GW6advlp2YKZgrqRGr5 +YN6DG5JnYnJNtWRkLxKRt2uPK4m4+hrNEFZ+MiItSmgoF28rMIgh3Ar/AqgYYLyvw5ZPDl +NHnGnV/X0UpYUftoJJdHo4vNDdhfbC38gP7XY+PCmHoza1mx/zuGSTunUExj2Alsunnq3l +aMP2Wg/Jn51oILAAABAQDSAO+AkBHpZoRx+xcdRM6X7zwJdP5vp2h7qwZRYSKB02pZQvb5 +y2IxVDGUfBIkVSWMw5ozUV+h7ptZCbZSipib1WQF2yj1n9znYVQNh38Dl/FXpwgtKqL6Z+ +LiAryLzC7n0+6LBY2GqUm5ND3MwrrLAmsjxx4yvQXpTlAYa/DlFFC7qWb0brN47nRJvSXX +rtWoAg/30lamh1VGp1glZngefp9Ekluh3v7KyEOnNIArfHL5HKkKxCAzEdMnnkoqeFEWus +lRDdW7s0TbOWvYRt5y1Z/IEsiUbMzqVfWK2GNzCjPkOITVj5ZSSfKPk7NteGGD/Ti9jBrI +SYtDKgM+c+wBAAAADnJtb25sYUBzcnYtbnM4AQIDBA== +-----END OPENSSH PRIVATE KEY----- diff --git a/adn/tools/_hist/_legacy_sonda_w-zombi/test_key.pub b/adn/tools/_hist/_legacy_sonda_w-zombi/test_key.pub new file mode 100644 index 00000000..8fca876e --- /dev/null +++ b/adn/tools/_hist/_legacy_sonda_w-zombi/test_key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxCHrqnaVrkihb/0yBAxzcb9knhCAWSFFC9J6rEKHE4Yu5DW3XZ/aoWKFq1NEZS6yNQqBqFGvAe32RBwnX7RiJEkhYgS/xr2SJorIxTWWJUOmV5i7OopQQQoZ7YUoY56tdVrYaulJCDyJkvnmGZwGdUS782BEb9nWDwXd5t1qDZJtCWCV/xK34zRuTy7DqHPU3sx+PUwj0KWy8rQBeRK2KNvHCpcVTQvx4u1QS9Cbbqsic+BrZfaU1LBa70GdJL8GY9p1ZIlSqqPMyzcpILh7CwrnyNr7hj+kaKVIdzeo+0WIf97XsjD0dNNt5VPP3kBrnTA62EQ6eraZl7V01Hx6gK178K9C3fcgPHsxZASf8/Vo+zOeg3ChCYQFPF9YzSyQpAJE2yT7ptuzXulhifpRBIs9d8HS5+6mWYgaLPqwDpZRvYB5NsX96m2OX3LBIeeJm4ZEc4531jsvOJNPiok9SVg083aAUbflFKtWV5M01X54rT4+uU6Uy4LRQGXPr5Mor+BBZyZ91bTtX8nGOVZrQ3Cxm4jc0Q7Aj902SX4yqrImLuoM7XIbVTHGQt+gsgVSxEbb4KaF4jOvRZKYrDcSFrJN9KWcx5SLCDZmN4TlGqgbVPrfxHzF7BqLrzq+bcG+BVm3DP3ROBwAjbXPcztiaDHpPjWDiZByy5nHnzqmmCw== rmonla@srv-ns8 diff --git a/adn/tools/_hist/sonda_w-zombi/README.md b/adn/tools/_hist/sonda_w-zombi/README.md new file mode 100644 index 00000000..0b4f1a6b --- /dev/null +++ b/adn/tools/_hist/sonda_w-zombi/README.md @@ -0,0 +1,60 @@ +# 🧟 W-Zombi: Toolkit de Inyección Lateral para Windows VMs + +> Técnica documentada en la bitácora del [25/02/2026](../../bitacoras/2026-02-25.md) (Hito DB01). + +## Problema + +La consola HTML5/VNC de Proxmox **no soporta copiar/pegar** texto. Esto impide provisionar comandos complejos en VMs Windows recién creadas que aún no tienen SSH. + +## Solución + +Arquitectura C2 liviana que sortea la limitación: + +``` +srv-ns8 (10.0.10.8) VM Windows (VNC) +┌──────────────────────┐ ┌──────────────────────┐ +│ servidor.rb │ ← HTTP :8000 ── │ zombi.ps1 (loop) │ +│ (Ruby / WEBrick) │ │ Consulta activo.ps1 │ +│ │ ── payload ────→ │ cada 10 seg │ +│ payloads/activo.ps1 │ │ Ejecuta y reporta │ +│ (hot-swap por IA) │ ← POST /log ── │ telemetría al server │ +└──────────────────────┘ └──────────────────────┘ +``` + +## Uso + +### 1. En srv-ns8 (la IA o el operador): +```bash +ruby tools/w-zombi/servidor.rb +``` + +### 2. En la VM Windows (tipear manualmente en VNC — PowerShell Admin): +```powershell +iwr 10.0.10.8:8000/zombi.ps1 -useb|iex +``` + +### 3. Cambiar payload activo: +```bash +# Copiar un payload pre-armado +cp tools/w-zombi/payloads/install_ssh.ps1 tools/w-zombi/payloads/activo.ps1 + +# O la IA modifica activo.ps1 directamente +``` + +## Estructura + +``` +tools/w-zombi/ +├── servidor.rb ← Servidor HTTP Ruby (WEBrick) +├── README.md ← Este archivo +└── payloads/ + ├── activo.ps1 ← Payload que ejecuta la VM (hot-swap) + ├── install_ssh.ps1 ← Instalar OpenSSH Server nativo + └── sonda.ps1 ← Diagnóstico y relevamiento del sistema +``` + +## Seguridad + +- Servidor **efímero** — solo se levanta durante la operación. +- Solo escucha en la red interna (`10.0.10.x` / `10.0.100.x`). +- Una vez instalado SSH, este mecanismo deja de ser necesario. diff --git a/adn/tools/_hist/sonda_w-zombi/payloads/.gitignore b/adn/tools/_hist/sonda_w-zombi/payloads/.gitignore new file mode 100644 index 00000000..ac8f6b91 --- /dev/null +++ b/adn/tools/_hist/sonda_w-zombi/payloads/.gitignore @@ -0,0 +1 @@ +OpenSSH-Win64.zip diff --git a/adn/tools/sonda_w-zombi/payloads/activo.ps1 b/adn/tools/_hist/sonda_w-zombi/payloads/activo.ps1 similarity index 100% rename from adn/tools/sonda_w-zombi/payloads/activo.ps1 rename to adn/tools/_hist/sonda_w-zombi/payloads/activo.ps1 diff --git a/adn/tools/sonda_w-zombi/payloads/deploy_sysdasuten.ps1 b/adn/tools/_hist/sonda_w-zombi/payloads/deploy_sysdasuten.ps1 similarity index 100% rename from adn/tools/sonda_w-zombi/payloads/deploy_sysdasuten.ps1 rename to adn/tools/_hist/sonda_w-zombi/payloads/deploy_sysdasuten.ps1 diff --git a/adn/tools/sonda_w-zombi/payloads/install_ssh.ps1 b/adn/tools/_hist/sonda_w-zombi/payloads/install_ssh.ps1 similarity index 100% rename from adn/tools/sonda_w-zombi/payloads/install_ssh.ps1 rename to adn/tools/_hist/sonda_w-zombi/payloads/install_ssh.ps1 diff --git a/adn/tools/sonda_w-zombi/payloads/install_ssh_fixtemp.ps1 b/adn/tools/_hist/sonda_w-zombi/payloads/install_ssh_fixtemp.ps1 similarity index 100% rename from adn/tools/sonda_w-zombi/payloads/install_ssh_fixtemp.ps1 rename to adn/tools/_hist/sonda_w-zombi/payloads/install_ssh_fixtemp.ps1 diff --git a/adn/tools/sonda_w-zombi/payloads/install_ssh_legacy.ps1 b/adn/tools/_hist/sonda_w-zombi/payloads/install_ssh_legacy.ps1 similarity index 100% rename from adn/tools/sonda_w-zombi/payloads/install_ssh_legacy.ps1 rename to adn/tools/_hist/sonda_w-zombi/payloads/install_ssh_legacy.ps1 diff --git a/adn/tools/sonda_w-zombi/payloads/setup.ps1 b/adn/tools/_hist/sonda_w-zombi/payloads/setup.ps1 similarity index 100% rename from adn/tools/sonda_w-zombi/payloads/setup.ps1 rename to adn/tools/_hist/sonda_w-zombi/payloads/setup.ps1 diff --git a/adn/tools/sonda_w-zombi/payloads/sonda.ps1 b/adn/tools/_hist/sonda_w-zombi/payloads/sonda.ps1 similarity index 100% rename from adn/tools/sonda_w-zombi/payloads/sonda.ps1 rename to adn/tools/_hist/sonda_w-zombi/payloads/sonda.ps1 diff --git a/adn/tools/sonda_w-zombi/payloads/sql_sysadmin_fix.ps1 b/adn/tools/_hist/sonda_w-zombi/payloads/sql_sysadmin_fix.ps1 similarity index 100% rename from adn/tools/sonda_w-zombi/payloads/sql_sysadmin_fix.ps1 rename to adn/tools/_hist/sonda_w-zombi/payloads/sql_sysadmin_fix.ps1 diff --git a/adn/tools/sonda_w-zombi/payloads/ssh_port7022.ps1 b/adn/tools/_hist/sonda_w-zombi/payloads/ssh_port7022.ps1 similarity index 100% rename from adn/tools/sonda_w-zombi/payloads/ssh_port7022.ps1 rename to adn/tools/_hist/sonda_w-zombi/payloads/ssh_port7022.ps1 diff --git a/adn/tools/sonda_w-zombi/payloads/zombi_agent.bat b/adn/tools/_hist/sonda_w-zombi/payloads/zombi_agent.bat similarity index 100% rename from adn/tools/sonda_w-zombi/payloads/zombi_agent.bat rename to adn/tools/_hist/sonda_w-zombi/payloads/zombi_agent.bat diff --git a/adn/tools/sonda_w-zombi/servidor.rb b/adn/tools/_hist/sonda_w-zombi/servidor.rb similarity index 100% rename from adn/tools/sonda_w-zombi/servidor.rb rename to adn/tools/_hist/sonda_w-zombi/servidor.rb diff --git a/adn/tools/_hist/wzombi/bin/w-zombi b/adn/tools/_hist/wzombi/bin/w-zombi new file mode 100755 index 00000000..c75f5c94 --- /dev/null +++ b/adn/tools/_hist/wzombi/bin/w-zombi @@ -0,0 +1,43 @@ +#!/usr/bin/env ruby +require_relative '../lib/wzombi/config' +require_relative '../lib/wzombi/server' +require_relative '../lib/wzombi/command_store' + +base = File.expand_path("..", __dir__) +config = WZombi::Config.new(base_path: base) + +def help + puts <<~HELP + Uso: + w-zombi start + w-zombi cmd "" + w-zombi ayuda | -h | -help + + Ejemplo ADN: + adn tools w-zombi cmd "ipconfig" + HELP +end + +cmd = ARGV[0] + +case cmd +when "start" + WZombi::Server.new(config).start + +when "cmd" + command = ARGV[1] + if command.nil? + puts "Falta comando" + exit + end + store = WZombi::CommandStore.new(config.cmd_path) + store.update(command) + puts "Comando actualizado: #{command}" + +when "ayuda", "-h", "-help", nil + help + +else + puts "Comando desconocido" + help +end diff --git a/adn/tools/_hist/wzombi/cmd.txt b/adn/tools/_hist/wzombi/cmd.txt new file mode 100644 index 00000000..e69de29b diff --git a/adn/tools/_hist/wzombi/data/cmd.json b/adn/tools/_hist/wzombi/data/cmd.json new file mode 100644 index 00000000..3e0558b5 --- /dev/null +++ b/adn/tools/_hist/wzombi/data/cmd.json @@ -0,0 +1 @@ +{"id":0,"cmd":""} \ No newline at end of file diff --git a/adn/tools/_hist/wzombi/lib/wzombi/command_store.rb b/adn/tools/_hist/wzombi/lib/wzombi/command_store.rb new file mode 100644 index 00000000..e38775ec --- /dev/null +++ b/adn/tools/_hist/wzombi/lib/wzombi/command_store.rb @@ -0,0 +1,25 @@ +require 'json' + +module WZombi + class CommandStore + def initialize(path) + @path = path + init_file + end + + def init_file + File.write(@path, { id: 0, cmd: "" }.to_json) unless File.exist?(@path) + end + + def current + JSON.parse(File.read(@path)) + end + + def update(cmd) + data = current + data["id"] += 1 + data["cmd"] = cmd + File.write(@path, data.to_json) + end + end +end diff --git a/adn/tools/_hist/wzombi/lib/wzombi/config.rb b/adn/tools/_hist/wzombi/lib/wzombi/config.rb new file mode 100644 index 00000000..8e2fd9df --- /dev/null +++ b/adn/tools/_hist/wzombi/lib/wzombi/config.rb @@ -0,0 +1,22 @@ +module WZombi + class Config + attr_reader :puerto, :base_path + + def initialize(base_path:) + @base_path = base_path + @puerto = ENV.fetch("WZ_PORT", 8000).to_i + end + + def log_path + File.join(base_path, "data/telemetria.log") + end + + def cmd_path + File.join(base_path, "data/cmd.json") + end + + def payloads_path + File.join(base_path, "payloads") + end + end +end diff --git a/adn/tools/_hist/wzombi/lib/wzombi/engine/ps1_builder.rb b/adn/tools/_hist/wzombi/lib/wzombi/engine/ps1_builder.rb new file mode 100644 index 00000000..a84fea03 --- /dev/null +++ b/adn/tools/_hist/wzombi/lib/wzombi/engine/ps1_builder.rb @@ -0,0 +1,36 @@ +module WZombi + module Engine + class PS1Builder + def self.build(host:) + <<~PS1 + # W-ZOMBI ENGINE + $WZ_HOST = "#{host}" + $LAST_CMD_ID = 0 + + function Get-Cmd { + try { + return Invoke-RestMethod -Uri "http://$WZ_HOST/cmd" + } catch {} + } + + function Send-Log { + param([string]$msg) + try { + Invoke-RestMethod -Uri "http://$WZ_HOST/log" -Method Post -Body $msg -ContentType "text/plain" + } catch {} + } + + while ($true) { + $cmdData = Get-Cmd + if ($cmdData.id -ne $LAST_CMD_ID) { + $LAST_CMD_ID = $cmdData.id + $result = Invoke-Expression $cmdData.cmd 2>&1 | Out-String + Send-Log $result + } + Start-Sleep -Seconds 5 + } + PS1 + end + end + end +end diff --git a/adn/tools/_hist/wzombi/lib/wzombi/logger.rb b/adn/tools/_hist/wzombi/lib/wzombi/logger.rb new file mode 100644 index 00000000..715af533 --- /dev/null +++ b/adn/tools/_hist/wzombi/lib/wzombi/logger.rb @@ -0,0 +1,12 @@ +module WZombi + class Logger + def initialize(path) + @path = path + end + + def log(msg) + line = "[#{Time.now.strftime('%H:%M:%S')}] #{msg}" + File.open(@path, "a") { |f| f.puts(line) } + end + end +end diff --git a/adn/tools/_hist/wzombi/lib/wzombi/routes/cmd.rb b/adn/tools/_hist/wzombi/lib/wzombi/routes/cmd.rb new file mode 100644 index 00000000..60ba3964 --- /dev/null +++ b/adn/tools/_hist/wzombi/lib/wzombi/routes/cmd.rb @@ -0,0 +1,16 @@ +require 'json' + +module WZombi + module Routes + class Cmd + def initialize(config) + @config = config + end + + def call(_req, res) + res['Content-Type'] = 'application/json' + res.body = File.read(@config.cmd_path) + end + end + end +end diff --git a/adn/tools/_hist/wzombi/lib/wzombi/routes/log.rb b/adn/tools/_hist/wzombi/lib/wzombi/routes/log.rb new file mode 100644 index 00000000..cbdbf661 --- /dev/null +++ b/adn/tools/_hist/wzombi/lib/wzombi/routes/log.rb @@ -0,0 +1,14 @@ +module WZombi + module Routes + class Log + def initialize(config) + @config = config + end + + def call(req, res) + File.open(@config.log_path, "a") { |f| f.puts(req.body) } + res.body = "OK" + end + end + end +end diff --git a/adn/tools/_hist/wzombi/lib/wzombi/routes/zombi.rb b/adn/tools/_hist/wzombi/lib/wzombi/routes/zombi.rb new file mode 100644 index 00000000..17d65e4f --- /dev/null +++ b/adn/tools/_hist/wzombi/lib/wzombi/routes/zombi.rb @@ -0,0 +1,15 @@ +require_relative '../engine/ps1_builder' + +module WZombi + module Routes + class Zombi + def initialize(config) + @config = config + end + + def call(_req, res) + res.body = Engine::PS1Builder.build(host: "127.0.0.1:#{@config.puerto}") + end + end + end +end diff --git a/adn/tools/_hist/wzombi/lib/wzombi/server.rb b/adn/tools/_hist/wzombi/lib/wzombi/server.rb new file mode 100644 index 00000000..c62449ac --- /dev/null +++ b/adn/tools/_hist/wzombi/lib/wzombi/server.rb @@ -0,0 +1,25 @@ +require 'webrick' +require_relative 'routes/zombi' +require_relative 'routes/cmd' +require_relative 'routes/log' + +module WZombi + class Server + def initialize(config) + @config = config + end + + def start + server = WEBrick::HTTPServer.new(Port: @config.puerto) + + server.mount_proc('/zombi.ps1', &Routes::Zombi.new(@config).method(:call)) + server.mount_proc('/cmd', &Routes::Cmd.new(@config).method(:call)) + server.mount_proc('/log', &Routes::Log.new(@config).method(:call)) + + trap("INT") { server.shutdown } + + puts "[W-ZOMBI] Servidor corriendo en puerto #{@config.puerto}" + server.start + end + end +end diff --git a/adn/tools/seguridad/.boveda.json b/adn/tools/candados/.boveda.json similarity index 88% rename from adn/tools/seguridad/.boveda.json rename to adn/tools/candados/.boveda.json index e71532cb..09ee09ef 100644 --- a/adn/tools/seguridad/.boveda.json +++ b/adn/tools/candados/.boveda.json @@ -7,5 +7,6 @@ "srv-dasu:rmonla": "eyJpdiI6IkFoczJZWUIwQ2piZzdJNzgiLCJ0YWciOiJJdDhCZndRc1RoZFhVMVQ4OEhaN1J3PT0iLCJkYXRhIjoiaUQycmxndGFsUkE2dVRaTEgrTT0ifQ==", "dominio-utnlarioja.intranet:monlaricardo": "eyJpdiI6InFRQ3VNYWlVSHlKMURNdzciLCJ0YWciOiJ1a3hESUZlaEt6enV3UXZxWUFrWXhRPT0iLCJkYXRhIjoiNVNaekdxVyt6dE5WQmhPaXF3PT0ifQ==", "ns8:rmonla:sudo": "eyJpdiI6IkRqbTBhVlZSYUpVdno3TFkiLCJ0YWciOiJJSnE2ei8zZHIrV2hFQks1VjNpVGN3PT0iLCJkYXRhIjoiT3JxTjRhTmlQK2R3TlJZZk9BPT0ifQ==", - "srv-dasu:root": "eyJpdiI6Ik5LY09JR1FvaFVPRXd3bjUiLCJ0YWciOiJwb0NLZ3A4N3VOQUZMQWhMS1hUVWZnPT0iLCJkYXRhIjoicEgvWTFmd0RhSFQ0YWRHRUxyZ1lBQT09In0=" + "srv-dasu:root": "eyJpdiI6Ik5LY09JR1FvaFVPRXd3bjUiLCJ0YWciOiJwb0NLZ3A4N3VOQUZMQWhMS1hUVWZnPT0iLCJkYXRhIjoicEgvWTFmd0RhSFQ0YWRHRUxyZ1lBQT09In0=", + "srv-ns8:rmonla:sudo": "eyJpdiI6InJDOUp2STdYR1crb2NkMTgiLCJ0YWciOiJHSUZVbXM5VnVmZ3d1NXQ3SFVwOUdRPT0iLCJkYXRhIjoib1ZVTzdaLzk1WGdwZDhKREM3aWpnV3c9In0=" } diff --git a/adn/tools/candados/.session b/adn/tools/candados/.session new file mode 100644 index 00000000..cb4e10bf --- /dev/null +++ b/adn/tools/candados/.session @@ -0,0 +1 @@ +1773874654 \ No newline at end of file diff --git a/adn/tools/seguridad/README.md b/adn/tools/candados/README.md similarity index 100% rename from adn/tools/seguridad/README.md rename to adn/tools/candados/README.md diff --git a/adn/tools/seguridad/candados.rb b/adn/tools/candados/candados.rb similarity index 100% rename from adn/tools/seguridad/candados.rb rename to adn/tools/candados/candados.rb diff --git a/adn/tools/cli/ayuda.rb b/adn/tools/cli/ayuda.rb index 05320cd3..e9561c50 100644 --- a/adn/tools/cli/ayuda.rb +++ b/adn/tools/cli/ayuda.rb @@ -1,186 +1,304 @@ # frozen_string_literal: true require_relative '../core/colores' +require_relative '../core/help_formatter' -class SubcomandoAyuda - def initialize(args, logger) - @args = args - @logger = logger - end - - def ejecutar - if @args.empty? - mostrar_ayuda_principal - else - mostrar_ayuda_subcomando(@args[0]) +module ADN + class SubcomandoAyuda + def initialize(args, logger) + @args = args + @logger = logger end - end - private + def ejecutar + if @args.empty? + mostrar_ayuda_principal + else + mostrar_ayuda_subcomando(@args[0]) + end + end - def mostrar_ayuda_principal - puts <<~AYUDA_PRINCIPAL - #{Color::CYAN}🔧 Herramienta ADN - Interfaz de línea de comandos unificada#{Color::RESET} - #{Color::DIM}Versión: Fase 1 (Núcleo Autónomo)#{Color::RESET} + private - #{Color::GREEN}Uso:#{Color::RESET} ./adn/tools/run [opciones] [argumentos] + def mostrar_ayuda_principal + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Herramienta ADN - Interfaz de línea de comandos unificada", + descripcion: "Versión: Fase 1 (Núcleo Autónomo)", + uso: "./adn/tools/run [opciones] [argumentos]", + opciones: [ + { names: ['validador [--watch] [--fix]'], desc: "Validar cumplimiento del ADN en bitácoras" }, + { names: ['contexto [--cmd]'], desc: "Obtener contexto topológico de un nodo" }, + { names: ['nodos [opciones]'], desc: "Gestión de nodos (agrupar, listar, buscar)" }, + { names: ['jornada [modo] [hora] [opciones]'], desc: "Gestión de jornada (iniciar, cerrar, estado)" }, + { names: ['salud [--dashboard] [--json]'], desc: "Ver salud general del sistema ADN" }, + { names: ['generar bitacora [fecha]'], desc: "Generar nueva bitácora (fecha: YYYY-MM-DD)" }, + { names: ['generar nodo '], desc: "Generar ficha de nodo" }, + { names: ['msp '], desc: "Gestión de MSPs NotebookLM (auditar, listar, registrar)" }, + { names: ['generar proyecto '], desc: "Generar manifiesto de proyecto" }, + { names: ['tailscale '], desc: "Gestión de identidades Tailscale" }, + { names: ['backup [--mode MODO]'], desc: "Ejecutar backup seguro de un nodo" }, + { names: ['db '], desc: "Operaciones de base de datos" }, + { names: ['triggers [opciones]'], desc: "Gestión del motor de triggers" }, + { names: ['plan [subcomando]'], desc: "Gestión de planes y progreso" }, + { names: ['proceso '], desc: "Ejecutar procesos técnicos automatizados" }, + { names: ['estados'], desc: "Listar tareas en proceso (⏳)" }, + { names: ['conocimiento '], desc: "Gestión de Base de Conocimiento" }, + { names: ['ayuda [subcomando]'], desc: "Mostrar esta ayuda o ayuda específica" } + ], + ejemplos: [ + { cmd: "./adn/tools/run ayuda jornada", desc: "Ver ayuda detallada del subcomando jornada" }, + { cmd: "./adn/tools/run ayuda nodos", desc: "Ver ayuda detallada del subcomando nodos" } + ] + ) + + puts ayuda + puts "" + puts "#{Color::DIM}Subcomandos en desarrollo (Fases futuras):#{Color::RESET}" + puts " evolucion Gestionar propuesta de evolución del ADN" + puts " triggers [--test] [--force] Ejecutar triggers de sincronización" + puts "" + puts "#{Color::DIM}Para ayuda detallada de un subcomando:#{Color::RESET}" + puts " ./adn/tools/run ayuda " + puts "" + puts "#{Color::DIM}Documentación completa:#{Color::RESET} docs/plan/260307-1400_Plan_Mejoras_ADN.md" + end - #{Color::YELLOW}Subcomandos disponibles:#{Color::RESET} - validador [--watch] [--fix] Validar cumplimiento del ADN en bitácoras - contexto [--cmd] Obtener contexto topológico de un nodo - nodos [opciones] Gestión de nodos (agrupar, listar, buscar) - jornada [modo] [hora] Gestión de jornada (iniciar, cerrar, estado) - salud [--dashboard] [--json] Ver salud general del sistema ADN - generar bitacora [fecha] Generar nueva bitácora (fecha: YYYY-MM-DD) - generar nodo Generar ficha de nodo - msp Gestión de MSPs NotebookLM (auditar, listar, registrar) - #{Color::YELLOW}generar proyecto #{Color::RESET} Generar manifiesto de proyecto - #{Color::YELLOW}tailscale #{Color::RESET} Gestión de identidades Tailscale - #{Color::YELLOW}backup [--mode MODO]#{Color::RESET} Ejecutar backup seguro de un nodo - #{Color::YELLOW}db #{Color::RESET} Operaciones de base de datos - #{Color::YELLOW}triggers [opciones]#{Color::RESET} Gestión del motor de triggers - #{Color::YELLOW}plan [subcomando]#{Color::RESET} Gestión de planes y progreso - #{Color::YELLOW}proceso #{Color::RESET} Ejecutar procesos técnicos automatizados - #{Color::YELLOW}estados#{Color::RESET} Listar tareas en proceso (⏳) - #{Color::YELLOW}ayuda [subcomando]#{Color::RESET} Mostrar esta ayuda o ayuda específica - - #{Color::YELLOW}Subcomandos en desarrollo (Fases futuras):#{Color::RESET} - evolucion Gestionar propuesta de evolución del ADN - triggers [--test] [--force] Ejecutar triggers de sincronización - - #{Color::DIM}Para ayuda detallada de un subcomando:#{Color::RESET} - ./adn/tools/run ayuda - - #{Color::DIM}Documentación completa:#{Color::RESET} docs/plan/260307-1400_Plan_Mejoras_ADN.md - AYUDA_PRINCIPAL - end - - def mostrar_ayuda_subcomando(subcomando) - case subcomando.downcase - when 'validador' - puts "Uso: ./adn/tools/run validador [--watch] [--fix]" - puts "" - puts "Valida el cumplimiento del ADN en las bitácoras:" - puts " • Formato de tiempo (HH:MM, sin \"hs\")" - puts " • Iconografía de estados y semántica correcta" - puts " • Presencia de métricas híbridas ([Físico/Remoto:])" - puts " • Referencias bidireccionales en rollovers" - puts " • Estructura de tablas en bitácoras" - puts "" - puts "Opciones:" - puts " --watch Monitorizar cambios en tiempo real (Fase 1 completa)" - puts " --fix Intentar corregir errores automáticamente" - puts "" - puts "Ejemplo:" - puts " ./adn/tools/run validador" - puts " ./adn/tools/run validador --fix" - when 'contexto' - puts "Uso: ./adn/tools/run contexto [--cmd]" - puts "" - puts "Obtiene información contextual de un nodo:" - puts " • IP y configuración de red" - puts " • Rol en la topología" - puts " • Comandos SSH sugeridos" - puts "" - puts "Ejemplo:" - puts " ./adn/tools/run contexto srv-pmox1" - puts " ./adn/tools/run contexto srvv-fenix --cmd" - when 'nodos' - puts "Uso: ./adn/tools/run nodos [opciones]" - puts "" - puts "Gestión y consulta de nodos de infraestructura:" - puts " • agrupar [--servidor SRV] Agrupar VMs por servidor anfitrión" - puts " • listar [--tipo TIPO] Listar fichas de nodos (.md)" - puts " • buscar Buscar nodos por nombre o contenido" - puts "" - puts "Ejemplos:" - puts " ./adn/tools/run nodos agrupar" - puts " ./adn/tools/run nodos agrupar --servidor srv-pmox1" - puts " ./adn/tools/run nodos listar --tipo srvv" - puts " ./adn/tools/run nodos buscar dasuten" - when 'jornada' - puts "Uso: ./adn/tools/run jornada [modo] [hora] [opciones]" - puts "" - puts "Gestión de jornada laboral:" - puts " • iniciar [presencial|remoto] [HH:MM] Registrar inicio" - puts " • cerrar [presencial|remoto] [HH:MM] Registrar cierre" - puts " • estado Ver estado actual" - puts "" - puts "Opciones:" - puts " --nodo NOMBRE Nodo a registrar (default: dtic-DIIAA)" - puts " --fecha YYYY-MM-DD Fecha de la bitácora (default: hoy)" - puts "" - puts "Ejemplos:" - puts " ./adn/tools/run jornada iniciar presencial 08:00" - puts " ./adn/tools/run jornada cerrar remoto 23:00" - puts " ./adn/tools/run jornada estado" - when 'salud' - puts "Uso: ./adn/tools/run salud [--dashboard] [--json]" - puts "" - puts "Muestra métricas de salud del sistema ADN:" - puts " • Cantidad de hebras, bitácoras, nodos, proyectos" - puts " • Errores recientes en logs" - puts "" - puts "Ejemplo:" - puts " ./adn/tools/run salud" - puts " ./adn/tools/run salud --json" - when 'generar' - puts "Uso: ./adn/tools/run generar [argumentos]" - puts "" - puts "Tipos disponibles:" - puts " bitacora [fecha] - Crea nueva bitácora (fecha: YYYY-MM-DD, default: hoy)" - puts " nodo - Crea ficha de nodo" - puts " proyecto - Crea manifiesto de proyecto" - puts "" - puts "Ejemplos:" - puts " ./adn/tools/run generar bitacora" - puts " ./adn/tools/run generar bitacora 2026-03-08" - puts " ./adn/tools/run generar nodo srv-nuevo" - puts " ./adn/tools/run generar proyecto P2604" - when 'proceso' - puts "Uso: ./adn/tools/run proceso [argumentos]" - puts "" - puts "Ejecuta procesos técnicos automatizados sobre la infraestructura:" - puts " • nodos:actualizar_so Actualiza paquetes y parches de seguridad" - puts "" - puts "Ejemplos:" - puts " ./adn/tools/run proceso nodos:actualizar_so srv-ns8" - puts " ./adn/tools/run proceso nodos:actualizar_so srv-dasu" - when 'estados' - puts "Uso: ./adn/tools/run estados" - puts "" - puts "Consulta la bitácora web para listar todos los items con estado ⏳ (En proceso)." - puts "Ideal para monitorear procesos automatizados o jornadas abiertas." - when 'tailscale', 'ts' - puts "Uso: ./adn/tools/run tailscale [perfil]" - puts "" - puts "Gestión de identidades y perfiles de Tailscale:" - puts " • switch Alternar entre cuentas (dasuten, personal)" - puts " • status Ver estado y cuenta activa" - puts " • list Listar perfiles en caché local" - puts "" - puts "Ejemplos:" - puts " ./adn/tools/run tailscale switch dasuten" - puts " ./adn/tools/run tailscale status" - when 'msp' - puts "Uso: ./adn/tools/run msp [opciones]" - puts "" - puts "Gestión de MSPs (Markdown Style Papers) de NotebookLM:" - puts " • auditar Verificar estado de conexión MCP y NotebookLM" - puts " • listar Listar MSPs disponibles en el sistema" - puts " • registrar Registrar un MSP descargado" - puts "" - puts "Opciones:" - puts " --archivo RUTA Ruta al archivo MSP (para registrar)" - puts " --titulo TITULO Título del MSP (opcional)" - puts "" - puts "Ejemplos:" - puts " ./adn/tools/run msp auditar" - puts " ./adn/tools/run msp listar" - puts " ./adn/tools/run msp registrar --archivo docs/mcps/mi-msp.md" - else - puts "#{Color::RED}✗ Subcomando desconocido: #{subcomando}#{Color::RESET}" - puts "Usa './adn/tools/run ayuda' para ver la lista de subcomandos." + def mostrar_ayuda_subcomando(subcomando) + case subcomando.downcase + when 'validador' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Validador de ADN", + descripcion: "Valida el cumplimiento del ADN en las bitácoras", + uso: "./adn/tools/run validador [--watch] [--fix]", + opciones: [ + { names: ['--watch'], desc: "Monitorizar cambios en tiempo real (Fase 1 completa)" }, + { names: ['--fix'], desc: "Intentar corregir errores automáticamente" } + ], + ejemplos: [ + { cmd: "./adn/tools/run validador", desc: "Ejecutar validador estándar" }, + { cmd: "./adn/tools/run validador --fix", desc: "Ejecutar validador con corrección automática" } + ] + ) + + puts ayuda + puts "" + puts "El validador verifica:" + puts " • Formato de tiempo (HH:MM, sin \"hs\")" + puts " • Iconografía de estados y semántica correcta" + puts " • Presencia de métricas híbridas ([Físico/Remoto:])" + puts " • Referencias bidireccionales en rollovers" + puts " • Estructura de tablas en bitácoras" + + when 'contexto' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Contexto de Nodo", + descripcion: "Obtiene información contextual de un nodo", + uso: "./adn/tools/run contexto [--cmd]", + ejemplos: [ + { cmd: "./adn/tools/run contexto srv-pmox1", desc: "Obtener contexto del nodo srv-pmox1" }, + { cmd: "./adn/tools/run contexto srvv-fenix --cmd", desc: "Obtener contexto con comandos SSH sugeridos" } + ] + ) + + puts ayuda + puts "" + puts "Información que proporciona:" + puts " • IP y configuración de red" + puts " • Rol en la topología" + puts " • Comandos SSH sugeridos" + + when 'nodos' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Gestión de Nodos", + descripcion: "Gestión y consulta de nodos de infraestructura", + uso: "./adn/tools/run nodos [opciones]", + opciones: [ + { names: ['agrupar [--servidor SRV]'], desc: "Agrupar VMs por servidor anfitrión" }, + { names: ['listar [--tipo TIPO]'], desc: "Listar fichas de nodos (.md)" }, + { names: ['buscar '], desc: "Buscar nodos por nombre o contenido" } + ], + ejemplos: [ + { cmd: "./adn/tools/run nodos agrupar", desc: "Agrupar todos los VMs por servidor" }, + { cmd: "./adn/tools/run nodos agrupar --servidor srv-pmox1", desc: "Agrupar VMs del servidor srv-pmox1" }, + { cmd: "./adn/tools/run nodos listar --tipo srvv", desc: "Listar nodos de tipo srvv" }, + { cmd: "./adn/tools/run nodos buscar dasuten", desc: "Buscar nodos relacionados con dasuten" } + ] + ) + + puts ayuda + + when 'jornada' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Gestión de Jornada Laboral", + descripcion: "Registro y control de jornada laboral", + uso: "./adn/tools/run jornada [modo] [hora] [opciones]", + opciones: [ + { names: ['iniciar [presencial|remoto] [HH:MM]'], desc: "Registrar inicio de jornada" }, + { names: ['cerrar [presencial|remoto] [HH:MM]'], desc: "Registrar cierre de jornada" }, + { names: ['estado'], desc: "Ver estado de la jornada actual" }, + { names: ['--nodo NOMBRE'], desc: "Nodo a registrar (default: dtic-DIIAA)" }, + { names: ['--fecha YYYY-MM-DD'], desc: "Fecha de la bitácora (default: hoy)" } + ], + ejemplos: [ + { cmd: "./adn/tools/run jornada iniciar presencial 08:00", desc: "Iniciar jornada presencial a las 08:00" }, + { cmd: "./adn/tools/run jornada cerrar remoto 23:00", desc: "Cerrar jornada remota a las 23:00" }, + { cmd: "./adn/tools/run jornada estado", desc: "Ver estado actual de la jornada" } + ] + ) + + puts ayuda + + when 'salud' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Salud del Sistema ADN", + descripcion: "Muestra métricas de salud del sistema ADN", + uso: "./adn/tools/run salud [--dashboard] [--json]", + opciones: [ + { names: ['--dashboard'], desc: "Mostrar dashboard de salud (por implementar)" }, + { names: ['--json'], desc: "Salida en formato JSON" } + ], + ejemplos: [ + { cmd: "./adn/tools/run salud", desc: "Mostrar reporte de salud estándar" }, + { cmd: "./adn/tools/run salud --json", desc: "Mostrar reporte de salud en formato JSON" } + ] + ) + + puts ayuda + puts "" + puts "Métricas mostradas:" + puts " • Cantidad de hebras, bitácoras, nodos, proyectos" + puts " • Errores recientes en logs" + + when 'generar' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Generador de Componentes ADN", + descripcion: "Genera nuevos componentes en el ecosistema ADN", + uso: "./adn/tools/run generar [argumentos]", + opciones: [ + { names: ['bitacora [fecha]'], desc: "Crea nueva bitácora (fecha: YYYY-MM-DD, default: hoy)" }, + { names: ['nodo '], desc: "Crea ficha de nodo" }, + { names: ['proyecto '], desc: "Crea manifiesto de proyecto" } + ], + ejemplos: [ + { cmd: "./adn/tools/run generar bitacora", desc: "Crear bitácora para hoy" }, + { cmd: "./adn/tools/run generar bitacora 2026-03-08", desc: "Crear bitácora para el 8 de marzo de 2026" }, + { cmd: "./adn/tools/run generar nodo srv-nuevo", desc: "Crear ficha para el nodo srv-nuevo" }, + { cmd: "./adn/tools/run generar proyecto P2604", desc: "Crear manifiesto para el proyecto P2604" } + ] + ) + + puts ayuda + + when 'proceso' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Procesos Automatizados ADN", + descripcion: "Ejecuta procesos técnicos automatizados sobre la infraestructura", + uso: "./adn/tools/run proceso [argumentos]", + opciones: [ + { names: ['nodos:actualizar_so '], desc: "Actualiza paquetes y parches de seguridad" } + ], + ejemplos: [ + { cmd: "./adn/tools/run proceso nodos:actualizar_so srv-ns8", desc: "Actualizar SO en el nodo srv-ns8" }, + { cmd: "./adn/tools/run proceso nodos:actualizar_so srv-dasu", desc: "Actualizar SO en el nodo srv-dasu" } + ] + ) + + puts ayuda + + when 'triggers' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Gestión de Triggers ADN", + descripcion: "Gestiona el sistema de triggers para sincronización automática del ADN", + uso: "./adn/tools/run triggers [OPCIONES]", + opciones: [ + { names: ['--test [TRIGGER_ID]'], desc: "Probar un trigger específico (modo simulación)" }, + { names: ['--forzar'], desc: "Ejecutar triggers incluso si sistema deshabilitado" }, + { names: ['--listar'], desc: "Listar todos los triggers configurados" }, + { names: ['--registrar'], desc: "Registrar triggers en el bus de eventos" }, + { names: ['--limpiar'], desc: "Limpiar todos los triggers registrados" }, + { names: ['-h', '--help'], desc: "Mostrar esta ayuda" } + ], + ejemplos: [ + { cmd: "./adn/tools/run triggers --listar", desc: "Listar todos los triggers configurados" }, + { cmd: "./adn/tools/run triggers --registrar", desc: "Registrar triggers en el bus de eventos" }, + { cmd: "./adn/tools/run triggers --test bitacoras_0", desc: "Probar trigger bitacoras_0 (modo simulación)" }, + { cmd: "./adn/tools/run triggers --forzar", desc: "Forzar ejecución de triggers" }, + { cmd: "./adn/tools/run triggers --limpiar", desc: "Limpiar todos los triggers registrados" } + ] + ) + + puts ayuda + + when 'estados' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Listado de Tareas en Proceso", + descripcion: "Consulta la bitácora web para listar todos los items con estado ⏳ (En proceso)", + uso: "./adn/tools/run estados", + descripcion_adicional: "Ideal para monitorear procesos automatizados o jornadas abiertas." + ) + + puts ayuda + + when 'tailscale', 'ts' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Gestión de Identidades Tailscale", + descripcion: "Gestión de identidades y perfiles de Tailscale", + uso: "./adn/tools/run tailscale [perfil]", + opciones: [ + { names: ['switch '], desc: "Alternar entre cuentas (dasuten, personal)" }, + { names: ['status'], desc: "Ver estado y cuenta activa" }, + { names: ['list'], desc: "Listar perfiles en caché local" } + ], + ejemplos: [ + { cmd: "./adn/tools/run tailscale switch dasuten", desc: "Cambiar a la cuenta dasuten" }, + { cmd: "./adn/tools/run tailscale status", desc: "Ver estado actual de Tailscale" } + ] + ) + + puts ayuda + puts "" + puts "Perfiles disponibles:" + puts " • dasuten: Ecosistema DASUTEN (pcdasu0@frlr.utn.edu.ar)" + puts " • personal: Otros ecosistemas (rmonla@gmail.com)" + + when 'msp' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Gestión de MSPs - NotebookLM", + descripcion: "Herramientas para auditar, registrar y listar MSPs (Markdown Style Papers)", + uso: "./adn/tools/run msp [opciones]", + opciones: [ + { names: ['auditar'], desc: "Verificar estado de conexión MCP y NotebookLM" }, + { names: ['registrar'], desc: "Registrar un MSP descargado en la base de conocimiento", default: "--archivo " }, + { names: ['listar'], desc: "Listar MSPs disponibles en el sistema" } + ], + ejemplos: [ + { cmd: "./adn/tools/run msp auditar", desc: "Verificar estado de MCP y NotebookLM" }, + { cmd: "./adn/tools/run msp listar", desc: "Listar MSPs disponibles" }, + { cmd: "./adn/tools/run msp registrar --archivo /ruta/msp.md", desc: "Registrar un MSP" } + ] + ) + + puts ayuda + + when 'conocimiento' + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Gestión de Base de Conocimiento", + descripcion: "Permite inyectar, organizar e indexar nueva documentación en el motor autónomo.", + uso: "./adn/tools/run conocimiento [opciones]", + opciones: [ + { names: ['asimilar '], desc: "Ingiere un documento Markdown a la base cognitiva del ADN." } + ], + ejemplos: [ + { cmd: "./adn/tools/run conocimiento asimilar docs/configuracion_bd.md", desc: "Asimilar documentación de configuración de BD" } + ] + ) + + puts ayuda + + else + puts "#{Color::RED}✗ Subcomando desconocido: #{subcomando}#{Color::RESET}" + puts "Usa './adn/tools/run ayuda' para ver la lista de subcomandos." + end end end end diff --git a/adn/tools/cli/backup.rb b/adn/tools/cli/backup.rb index 31a40906..257810a6 100644 --- a/adn/tools/cli/backup.rb +++ b/adn/tools/cli/backup.rb @@ -4,13 +4,15 @@ require 'optparse' require 'fileutils' require 'date' require_relative 'backup/configurador' +require_relative '../core/colores' +require_relative '../core/help_formatter' module ADN class SubcomandoBackup def initialize(args, logger) @args = args @logger = logger - + # Cargar valores predeterminados desde config.yml defaults = Configurador.obtener('backup.defaults') || {} @opciones = { @@ -22,6 +24,12 @@ module ADN end def ejecutar + # Handle help flags + if @args.empty? || @args[0] == 'help' || @args[0] == '-h' || @args[0] == '--help' + mostrar_ayuda + return + end + parser = OptionParser.new do |opts| opts.banner = "Uso: ./adn/tools/run backup [OPCIONES]" opts.separator "" @@ -107,7 +115,7 @@ module ADN # Usar popen para leer la salida en tiempo real @logger.info("Conectando y monitoreando salida de Proxmox...") - clave = (@nodo[:nombre] == 'srv-dasu' ? 'srv-dasu:rmonla' : 'admindasu') + clave = (datos[:host_name] == 'srv-dasu' ? 'srv-dasu:rmonla' : 'admindasu') IO.popen("ruby #{candados_path} run #{clave} SSHPASS '#{cmd_seguro}' 2>&1") do |pf| pf.each_line do |line| # Imprimir flujo para el usuario @@ -609,46 +617,42 @@ module ADN @logger.info("Auto-cerrando backup de #{nodo_actual} (Task ID: #{tarea['id']})") cerrar_entrada_especifica(nodo_actual, hora_inicio_str, exito, tarea['id'], hora_fin) - end end end + + private + + def mostrar_ayuda + ayuda = ADN::HelpFormatter.generar_help( + titulo: "Backup ADN", + descripcion: "Ejecuta un backup remoto o consulta el estado actual.", + uso: "./adn/tools/run backup [OPCIONES]", + opciones: [ + { names: [''], desc: "Ejecutar backup del nodo especificado" }, + { names: ['estados'], desc: "Ver estado actual de los backups en Proxmox" }, + { names: ['sanear'], desc: "Limpiar backups antiguos según retención" }, + { names: ['predeterminar'], desc: "Configurar valores por defecto" }, + { names: ['--mode MODO'], desc: "Modo de backup (stop, snapshot, suspend)" }, + { names: ['--storage STORAGE'], desc: "Nombre del storage en Proxmox" }, + { names: ['-h', '--help'], desc: "Mostrar esta ayuda" } + ], + ejemplos: [ + { cmd: "./adn/tools/run backup srv-dasu", desc: "Ejecutar backup del nodo srv-dasu" }, + { cmd: "./adn/tools/run backup estados", desc: "Ver estado de backups en Proxmox" }, + { cmd: "./adn/tools/run backup sanear", desc: "Limpiar backups antiguos" } + ] + ) + + puts ayuda + end end + end def cerrar_entrada_especifica(nodo, hora_ini, exito, task_id, hora_fin) fecha = Date.today.iso8601 ruta = File.join(ADN::BITACORAS_DIR, "#{fecha}.md") return unless File.exist?(ruta) - estado_ico = exito ? '✅' : '⚠️' - desc = exito ? 'Backup completado exitosamente.' : 'Fallo en la ejecución del backup.' - desc = "[task:#{task_id[0..7]}] #{desc}" if task_id - - linea_nueva = "| #{hora_ini} | #{hora_fin} | #{desc} | R | #{estado_ico} |" - - contenido = File.read(ruta) - # Buscamos la fila específica que coincida con el nodo Y la hora de inicio - # Capturamos el bloque del nodo para evitar errores si otros nodos tienen la misma hora - regex_seccion = /(### #{Regexp.escape(nodo)}.*?)(?=^###\s|