Re: New C functions for Nessus 2.2?

Paul Johnston <[email protected]> Thu, 16 Sep 2004 10:26:12 +0100
Newsgroups gmane.comp.security.nessus.devel
Message-ID <[email protected]>
Hi Michel,

That sounds ok... only one script actually needs to call it, so trusted 
is fine. Just checking the semantics:

same_host(hostname, ipaddress)
returns true if the hostname resolves to the ipaddress (and resolves 
uniquely)
returns false otherwise

Given that, I'd propose adding something like this (not tested) to 
http_func.inc:

# Generate a URL suitible for display in the report
function build_url(port, path)
{
  local url;

  if(get_port_transport(port) == ENCAPS_IP)
    url = 'http://';
  else
    url = 'https://';

  # if kb key missing, default to using domainname
  if(get_kb_item("dns/badhostname"))
    url += get_host_ip();
  else
    url += get_host_name();

  return url + ":" + port + path;
}

Web plugins can call this to generate proper URLs for display. This 
would be good for us here as it would save time tidying up the reports.

Regards,

Paul




Michel Arboi wrote:

>On Wed Sep 15 2004 at 12:28, Paul Johnston wrote:
>
>  
>
>>Ok... did you have any thoughts on the DNS function?
>>    
>>
>
>Sending data to an external server is not great (although we could do
>it already if the target runs a SMTP, NNTP or DNS relay, or an HTTP
>proxy)
>
>I wrote same_host, which compares two addresses / host names. But it
>is a "privileged" function for now.
>
>
>  
>

-- 
Paul Johnston
Internet Security Specialist
Westpoint Limited
Albion Wharf, 19 Albion Street,
Manchester, M1 5LN
England
Tel: +44 (0)161 237 1028
Fax: +44 (0)161 237 1031
email: [email protected]
web: www.westpoint.ltd.uk


_______________________________________________
Nessus-devel mailing list
[email protected]
http://mail.nessus.org/mailman/listinfo/nessus-devel