From ae0babda4db2b4843c24edfd3734ce7bcf41e9c9 Mon Sep 17 00:00:00 2001 From: nnposter Date: Mon, 15 Jun 2020 03:01:35 +0000 Subject: [PATCH] Propagate unpwdb errors to script output. Fixes #2011 --- scripts/pgsql-brute.nse | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/pgsql-brute.nse b/scripts/pgsql-brute.nse index 1369ac0b3..a239df4ff 100644 --- a/scripts/pgsql-brute.nse +++ b/scripts/pgsql-brute.nse @@ -91,10 +91,14 @@ action = function( host, port ) local usernames, passwords status, usernames = unpwdb.usernames() - if ( not(status) ) then return end + if not status then + return stdnse.format_output(false, usernames) + end status, passwords = unpwdb.passwords() - if ( not(status) ) then return end + if not status then + return stdnse.format_output(false, passwords) + end -- If the user explicitly does not disable SSL, enforce it if ( ( nmap.registry.args['pgsql.nossl'] == 'true' ) or