Mailing List Archive

Re: Plugins-writers Digest, Vol 26, Issue 2
Date: Wed, 7 Dec 2005 17:52:21 -0500
From: Renaud Deraison <deraison@nessus.org>
Subject: Re: [Plugins-writers] SSL Connection Functions?
To: Nessus Plugin Writeres Mailing List
<plugins-writers@list.nessus.org>
Message-ID: <7437A5D3-B5C6-4B07-931D-FA48775F23BF@nessus.org>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

< QUOTE >

It opens the TCP connection but does not perform the SSL negociation.
In general, I'd simply recommand to force your plugin to depend on
find_service.nes (which detects SSL) and to make sure you're
portscanning the relevant port. If you do so, then open_sock_tcp()
will negotiate SSL automagically.

In your case, since you know the application, you can force the SSL
negotiation:

soc = open_sock_tcp(ssl_port, transport:ENCAPS_TLSv1);

Then instead of hardcoding your GET request, you probably want to
include http_func.inc so your script becomes :

include("http_func.inc");

soc = open_sock_tcp(ssl_port, transport:ENCAPS_TLSv1);
if ( ! soc ) {
display("Port is closed or SSL negotiation failed\n");
exit(1);
}

send(socket:soc, data:http_get(item:"/some_file.http", port:ssl_port));
r = http_recv(socket:soc);
close(soc);
if (! r ) {
display("No reply from the remote web server\n");
exit(1);
}
else display(r);


Hope this helps,


-- Renaud
< /QUOTE >

Thank you. That worked quite well.

Steven Smith



_______________________________________________
Plugins-writers mailing list
Plugins-writers@list.nessus.org
http://mail.nessus.org/mailman/listinfo/plugins-writers