diff --git a/scripts/hostmap-bfk.nse b/scripts/hostmap-bfk.nse index 4e5850d75..7a4b89c4e 100644 --- a/scripts/hostmap-bfk.nse +++ b/scripts/hostmap-bfk.nse @@ -27,19 +27,37 @@ This script was formerly (until April 2012) known as hostmap.nse. -- -- @output -- Host script results: --- | hostmap-bfk: Saved to hostmap-nmap.org --- | insecure.org --- | 74.207.254.18 --- | web.insecure.org --- | download.insecure.org --- | images.insecure.org --- | www.insecure.org --- | nmap.org --- | www.nmap.org --- | sectools.org --- | mirror.sectools.org --- | www.sectools.org --- |_seclists.org +-- | hostmap-bfk: +-- | hosts: +-- | insecure.org +-- | 173.255.243.189 +-- | images.insecure.org +-- | www.insecure.org +-- | nmap.org +-- | 189.243.255.173.in-addr.arpa +-- | mail.nmap.org +-- | svn.nmap.org +-- | www.nmap.org +-- | sectools.org +-- | seclists.org +-- |_ li253-189.members.linode.com +-- +-- @xmloutput +--
The server returned no hits.
") then - return "Error: found no hostnames but not the marker for \"no hostnames found\" (pattern error?)" + stdnse.print_debug(1,"Error: found no hostnames but not the marker for \"no hostnames found\" (pattern error?)") end - return + return nil end - + output_tab.hosts = hosts_log local hostnames_str = stdnse.strjoin("\n", hostnames) - local output_str local filename_prefix = stdnse.get_script_args("hostmap-bfk.prefix") if filename_prefix then local filename = filename_prefix .. filename_escape(host.targetname or host.ip) local status, err = write_file(filename, hostnames_str .. "\n") if status then - output_str = string.format("Saved to %s\n", filename) + output_tab.filename = filename else - output_str = string.format("Error saving to %s: %s\n", filename, err) + stdnse.print_debug(1,"Error saving to %s: %s\n", filename, err) end - else - output_str = "\n" end - output_str = output_str .. stdnse.strjoin("\n", hostnames) - return output_str + return output_tab end -- Escape some potentially unsafe characters in a string meant to be a filename.