From 1c2829cbd04dec2012646c841245f124c781c8a4 Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 25 Oct 2018 16:30:48 +0000 Subject: [PATCH] Fix a bug: if service is vulnerable, this is a table, not a string. --- scripts/smb-vuln-webexec.nse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/smb-vuln-webexec.nse b/scripts/smb-vuln-webexec.nse index 9f27d7b53..9fedaa0a8 100644 --- a/scripts/smb-vuln-webexec.nse +++ b/scripts/smb-vuln-webexec.nse @@ -137,7 +137,7 @@ action = function(host, port) local test_status, test_result = msrpc.svcctl_openservicew(smbstate, open_result['handle'], test_service, 0x00000) -- If the service DOES_NOT_EXIST, we couldn't run code - if string.match(test_result, 'DOES_NOT_EXIST') then + if not test_status and string.match(test_result, 'DOES_NOT_EXIST') then stdnse.debug1("Result: Test service does not exist: probably not vulnerable") msrpc.svcctl_closeservicehandle(smbstate, open_result['handle'])