🧟 W-Zombi v2.1: Fix ruta /cmd + JSON parsing robusto
Bugs corregidos: - /cmd no existía en server (solo /cmd.json) — agregada ruta explícita - PS1 client pedía /cmd sin Content-Type JSON — cambiado a /cmd.json - JSON fallback: ConvertFrom-Json si Invoke-RestMethod no parsea - Send-Log con UTF-8 encoding explícito - Validación extra: chequea $cmdData.id y $cmdData.cmd antes de ejecutar - Log bilateral: registra comando enviado Y resultado recibido - ZOMBI CONECTADO log al iniciar
This commit is contained in:
@@ -2,6 +2,8 @@ require 'webrick'
|
||||
require_relative 'routes/zombi'
|
||||
require_relative 'routes/cmd'
|
||||
require_relative 'routes/log'
|
||||
require_relative 'routes/ps1'
|
||||
require_relative 'routes/exec'
|
||||
|
||||
module WZombi
|
||||
class Server
|
||||
@@ -13,8 +15,11 @@ module WZombi
|
||||
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))
|
||||
server.mount_proc('/cmd.json', &Routes::Cmd.new(@config).method(:call))
|
||||
server.mount_proc('/cmd', &Routes::Cmd.new(@config).method(:call))
|
||||
server.mount_proc('/log', &Routes::Log.new(@config).method(:call))
|
||||
server.mount_proc('/ps1', &Routes::Ps1.new(@config).method(:call))
|
||||
server.mount_proc('/exec.ps1', &Routes::Exec.new(@config).method(:call))
|
||||
|
||||
trap("INT") { server.shutdown }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user