From 4ad62b1cdf4fcbebea100f5524c497c0c66a79ba Mon Sep 17 00:00:00 2001 From: patrik Date: Tue, 27 Dec 2011 20:55:19 +0000 Subject: [PATCH] Fixed a bug that would prevent listing services unless an IP was specified as argument [Patrik] --- scripts/dns-blacklist.nse | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/dns-blacklist.nse b/scripts/dns-blacklist.nse index 74bb4d911..1bd701f20 100644 --- a/scripts/dns-blacklist.nse +++ b/scripts/dns-blacklist.nse @@ -93,12 +93,7 @@ local function formatResult(result) end dnsblAction = function(host) - - -- if the list argument was given, just list the services and abort - if ( arg_list ) then - return listServices() - end - + local helper if ( arg_services and ( not(arg_category) or "all" == arg_category:lower() ) ) then return "\n ERROR: A service filter can't be used without a specific category" @@ -147,7 +142,12 @@ action = function(...) if ( arg_IP and not(ipOps.todword(arg_IP)) ) then return "\n ERROR: Invalid IP address was supplied" end - + + -- if the list argument was given, just list the services and abort + if ( arg_list ) then + return listServices() + end + if ( arg_IP and "prerule" == SCRIPT_TYPE ) then return dnsblAction( { ip = arg_IP } ) elseif ( "hostrule" == SCRIPT_TYPE ) then