diff --git a/scripts/dns-zone-transfer.nse b/scripts/dns-zone-transfer.nse index 62c2ebb2a..bbe037f88 100644 --- a/scripts/dns-zone-transfer.nse +++ b/scripts/dns-zone-transfer.nse @@ -227,7 +227,7 @@ function build_domain(host) abs_name = listop.reverse(abs_name) -- prepend each element with its length - while i <= table.getn(abs_name) do + while i <= #abs_name do buf = buf .. string.char(string.len(abs_name[i])) .. abs_name[i] i = i + 1 end diff --git a/scripts/http-wp-plugins.nse b/scripts/http-wp-plugins.nse index cb931b693..8712bb05d 100644 --- a/scripts/http-wp-plugins.nse +++ b/scripts/http-wp-plugins.nse @@ -148,7 +148,7 @@ action = function(host, port) end - if table.getn(result) > 0 then + if #result > 0 then result.name = "search amongst the " .. plugin_count .. " most popular plugins" return stdnse.format_output(true, result) else diff --git a/scripts/ms-sql-brute.nse b/scripts/ms-sql-brute.nse index 74f82678b..1a04c76d7 100644 --- a/scripts/ms-sql-brute.nse +++ b/scripts/ms-sql-brute.nse @@ -101,7 +101,7 @@ local function create_instance_output_table( instance ) end end - if ( table.getn( credsOutput ) == 0 ) then + if ( #credsOutput == 0 ) then table.insert( instanceOutput, "No credentials found" ) end end diff --git a/scripts/ms-sql-empty-password.nse b/scripts/ms-sql-empty-password.nse index b0bdf7399..bf2b155de 100644 --- a/scripts/ms-sql-empty-password.nse +++ b/scripts/ms-sql-empty-password.nse @@ -152,7 +152,7 @@ local function process_instance( instance ) for _, message in ipairs( instance.ms_sql_empty ) do table.insert( instanceOutput, message ) end - if ( nmap.verbosity() > 1 and table.getn( instance.ms_sql_empty ) == 0 ) then + if ( nmap.verbosity() > 1 and #instance.ms_sql_empty == 0 ) then table.insert( instanceOutput, "'sa' account password is not blank." ) end end diff --git a/scripts/smtp-open-relay.nse b/scripts/smtp-open-relay.nse index ae1000fbf..ced853df4 100644 --- a/scripts/smtp-open-relay.nse +++ b/scripts/smtp-open-relay.nse @@ -209,7 +209,7 @@ function go(host, port) end end - for index = 1, table.getn(tests), 1 do + for index = 1, #tests do status, response = do_request(socket, "RSET\r\n") if not status then