I found 'response' variable has NULL compare. I think it should be 'reply'
And for regex, use below method (easy to get value by using eregmatch).

dotNet_header = eregmatch(pattern:"Microsoft .NET Framework
Version:([0-9.]+)", string:reply, icase:TRUE);
aspNet_header = egrep(pattern:"ASP.NET Version:([0-9.]+)", string:reply,
icase:TRUE);

This will get in the form of list. Find the output below for the regex.
dotNet_header [ 0: 'Microsoft .NET Framework Version:2.0.50727.1433', 1:
'2.0.50727.1433' ]
aspNet_header [ 0: 'ASP.NET Version:2.0.50727.1433', 1: '2.0.50727.1433' ]

By using this you can set the version by pointing to index 1
dotNet_header[1] and aspNet_header[1]

Chandan

Chandrashekhar B wrote:
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Christian
> Eric Edjenguele
> Sent: Wednesday, March 18, 2009 3:05 AM
> To: [email protected]
> Subject: [Openvas-plugins] REGEX expert
>
> I've the following script, it works but the regex does not handle
> correctly the string I need (<b>Version Information:</b>&nbsp;Microsoft
> .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433)
> contents .net and asp version information, I can I extract it ?
>
> ch...@darkstar:~/Workspaces/OpenVAS/trunk/openvas-plugins/scripts$ sudo
> openvas-nasl -X remote-detect-MSdotNET-version2.nasl -t 216.134.222.61
> [7016] plug_set_key:internal_send(0)['3 Services/www/80/working=1;
> ']: Socket operation on non-socket
> [7016] plug_set_key:internal_send(0)['1 www/80/keepalive=yes;
> ']: Socket operation on non-socket
> [7016] plug_set_key:internal_send(0)['3 dotNET/installed=1;
> ']: Socket operation on non-socket
> [7016] plug_set_key:internal_send(0)['3 aspNET/installed=1;
> ']: Socket operation on non-socket
> [7016] plug_set_key:internal_send(0)['3 dotNET/port=80;
> ']: Socket operation on non-socket
> <b>Version Information:</b>&nbsp;Microsoft .NET Framework
> Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
>
> [7016] plug_set_key:internal_send(0)['1 SentData/(null)/INFO=
> <b>Version Information:</b>&nbsp;Microsoft .NET Framework
> Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433\r\n;
> ']: Socket operation on non-socket
> [7016] plug_set_key:internal_send(0)['3 Success/(null)=1;
> ']: Socket operation on non-socket
>
_______________________________________________
Openvas-plugins mailing list
[email protected]
http://lists.wald.intevation.org/mailman/listinfo/openvas-plugins


_______________________________________________
Openvas-plugins mailing list
[email protected]
http://lists.wald.intevation.org/mailman/listinfo/openvas-plugins

Reply via email to