From 433d4b50011e788342597767d519402cc965bff3 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Tue, 28 Sep 2021 15:13:04 +0200 Subject: [PATCH] Do not rely on the exit status of ping.exe for module_ping. When an ICMP destination unreachable message is received, the exit status of ping.exe is 0, which breaks module_ping modules. Pipe the output of ping.exe to find.exe instead. Ref. pandora_enterprise#7942. --- pandora_agents/win32/modules/pandora_module_ping.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_agents/win32/modules/pandora_module_ping.cc b/pandora_agents/win32/modules/pandora_module_ping.cc index 4da7020a82..875f26bf53 100644 --- a/pandora_agents/win32/modules/pandora_module_ping.cc +++ b/pandora_agents/win32/modules/pandora_module_ping.cc @@ -30,7 +30,7 @@ using namespace Pandora_Modules; * @param host Host to be pinged. */ Pandora_Module_Ping::Pandora_Module_Ping (string name, string host, string count, string timeout, string advanced_options) - : Pandora_Module_Exec (name, "ping -n " + count + " -w " + timeout + " " + advanced_options + " " + host) { + : Pandora_Module_Exec (name, "ping -n " + count + " -w " + timeout + " " + advanced_options + " " + host + " | find \"TTL=\"") { this->proc = 1; this->setKind (module_ping_str); }