[P2602][F1] OpenSSH on fenix+maurik, win_domain vault key, SSH matrix updated

This commit is contained in:
Ricardo Monla
2026-02-28 11:30:36 -03:00
parent a48b8bf570
commit 55aac835b4
4 changed files with 46 additions and 4 deletions
+40 -1
View File
@@ -1 +1,40 @@
Write-Host "W-Zombi: Operacion completada. Sin payload activo." -ForegroundColor Green
function Log-Msg {
param([string]$Message)
Write-Host $Message -ForegroundColor Cyan
try {
Invoke-RestMethod -Uri "http://10.0.10.8:8000/log" -Method Post -Body @{msg=$Message} -UseBasicParsing -ErrorAction SilentlyContinue | Out-Null
} catch {}
}
Log-Msg "=========================================================="
Log-Msg "INSTALANDO Y HABILITANDO OPENSSH SERVER NATIVO"
Log-Msg "=========================================================="
try {
$sshCheck = Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*'
if ($sshCheck.State -ne 'Installed') {
Log-Msg "Instalando caracteristica OpenSSH.Server (esto puede tomar un minuto)..."
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 | Out-Null
} else {
Log-Msg "OpenSSH.Server ya se encuentra instalado."
}
Log-Msg "Configurando servicio sshd en Inicio Automatico..."
Set-Service -Name sshd -StartupType 'Automatic'
Start-Service sshd -ErrorAction SilentlyContinue
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue)) {
Log-Msg "Abriendo puerto TCP 22 en el Firewall local..."
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 | Out-Null
}
$ip = (Get-NetIPAddress -AddressFamily IPv4 | Where-Object InterfaceAlias -notmatch 'Loopback').IPAddress
Log-Msg "OpenSSH Server instalado y corriendo en el puerto 22."
Log-Msg "Conectar via: ssh Administrador@$($ip[0])"
} catch {
Log-Msg "Fallo al instalar SSH: $_"
}
Log-Msg "=========================================================="
Log-Msg "OPERACION COMPLETADA. Ahora SSH esta disponible."
Log-Msg "=========================================================="
exit