sullo / nikto

Nikto web server scanner
Other
8.36k stars 1.21k forks source link

Template Variables not filled in XML header and footer #344

Closed jennamagius closed 8 years ago

jennamagius commented 8 years ago

Hello,

When outputting XML results, the XML header and footer are being output without template variables being filled. For example,

<niktoscan hoststest="#TEMPL_NIKTO_HOSTS_TESTED#" options="#TEMPL_NIKTO_CLI#" version="#TEMPL_NIKTO_VER#" scanstart="#TEMPL_SCAN_START#" scanend="#TEMPL_SCAN_END#" scanelapsed="#TEMPL_SCAN_ELAPSED#" nxmlversion="1.2">

<scandetails targetip="#TEMPL_IP#" targethostname="#TEMPL_HOSTNAME#" targetport="#TEMPL_PORT#" targetbanner="#TEMPL_BANNER#" starttime="#TEMPL_START#" sitename="#TEMPL_LINK_NAME#" siteip="#TEMPL_LINK_IP#" hostheader="#TEMPL_HOST_HEADER#" errors="#TEMPL_ERRORS#" checks="#TEMPL_CTR#">

TEMPL_SSL_INFO

I believe this is being caused by the if ($item->{'uri'} eq '') { return $template; } early exit to xml_change_vars in nikto_report_xml.plugin. Because this is happening before any substitution occurs, xml_change_vars is essentially a NOP when called from xml_host_start and xml_host_end. Prior to commit d71a8a3, a substitution happened before this early exit, but it was removed in that commit.

sullo commented 8 years ago

Fixed--thanks for the report!