From 1338a55b0de8db68a7a727a59811b1412fe443f1 Mon Sep 17 00:00:00 2001 From: OJ Date: Fri, 13 Mar 2015 21:49:45 +1000 Subject: [PATCH] Adjust error handling for extension enumeration Make the catch case more generic for when the target doesn't support the command for extension enumeration. This supports more than just windows now. --- lib/rex/post/meterpreter/client_core.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/rex/post/meterpreter/client_core.rb b/lib/rex/post/meterpreter/client_core.rb index 542927e68e..7fa9a99315 100644 --- a/lib/rex/post/meterpreter/client_core.rb +++ b/lib/rex/post/meterpreter/client_core.rb @@ -53,13 +53,11 @@ class ClientCore < Extension # No response? if response.nil? raise RuntimeError, "No response was received to the core_enumextcmd request.", caller - elsif response.result == 50 + elsif response.result != 0 # This case happens when the target doesn't support the core_enumextcmd message. # If this is the case, then we just want to ignore the error and return an empty # list. This will force the caller to load any required modules. return [] - elsif response.result != 0 - raise RuntimeError, "The core_enumextcmd request failed with result: #{response.result}.", caller end commands = []