[Openvas-commits] r3227 - in trunk/openvas-plugins: . scripts

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon May 4 10:55:21 CEST 2009


Author: mime
Date: 2009-05-04 10:55:20 +0200 (Mon, 04 May 2009)
New Revision: 3227

Modified:
   trunk/openvas-plugins/ChangeLog
   trunk/openvas-plugins/scripts/sip_detection.nasl
Log:
Fixed typo. Added detection of Asterisk PBX

Modified: trunk/openvas-plugins/ChangeLog
===================================================================
--- trunk/openvas-plugins/ChangeLog	2009-05-04 07:29:54 UTC (rev 3226)
+++ trunk/openvas-plugins/ChangeLog	2009-05-04 08:55:20 UTC (rev 3227)
@@ -1,3 +1,8 @@
+2009-05-04 Michael Meyer <mime at gmx.de>
+	* scripts/sip_detection.nasl:
+	Fixed typo which prevented detection of sip. 
+	Added detection of Asterisk PBX.
+
 2009-05-04  Michael Wiegand <michael.wiegand at intevation.de>
 
 	* scripts/remote-Leap_CMS_multi.nasl: Fixed typo in include.

Modified: trunk/openvas-plugins/scripts/sip_detection.nasl
===================================================================
--- trunk/openvas-plugins/scripts/sip_detection.nasl	2009-05-04 07:29:54 UTC (rev 3226)
+++ trunk/openvas-plugins/scripts/sip_detection.nasl	2009-05-04 08:55:20 UTC (rev 3227)
@@ -1,6 +1,8 @@
 #
 # This script was written by Noam Rathaus
 #
+# Modified by Michael Meyer 2009-05-04
+#
 # See the Nessus Scripts License for details
 #
 
@@ -107,23 +109,47 @@
  if (debug)
  {
   display("data: ", data, "\n");
- }
+}
 
- if ("SIP/2.0 " >< data)
+ if ("SIP/2.0" >< data)
  {
   if (egrep(pattern: '^Server:', string: data))
   {
    banner = egrep(pattern: '^Server:', string: data);
    banner -= "Server: ";
    banner -= string("\r\n");
+  } 
+  
+  else if (egrep(pattern: '^User-Agent:', string: data)) {
+   
+    banner = egrep(pattern: '^User-Agent:', string: data);
+    banner -= "User-Agent: ";
+    banner -= string("\r\n");
 
+  }  
+
+  if( banner ) { 
    if(!get_kb_item("sip/banner/5060"))
    {
     set_kb_item(name:"sip/banner/5060", value:banner);
    }
   }
 
-  desc["english"] += '\n\nPlugin output :\n\n' + banner;
+  desc["english"] += '\n\nPlugin output :\n\n' + banner + '\n';
+
+  if(egrep(pattern:"Allow:.*OPTIONS.*", string: data)) {
+
+    OPTIONS = egrep(pattern:"Allow:.*OPTIONS.*", string: data);
+    OPTIONS -= "Allow: ";
+    OPTIONS = chomp(OPTIONS);
+  }  
+
+  if(!isnull(OPTIONS)) {
+
+    desc["english"] += '\nSupported Options:\n' + OPTIONS + '\n';
+
+  }  
+
   security_note(port:5060, protocol:"udp", data:desc["english"]);
   register_service(port: 5060, ipproto: "udp", proto: "sip");
  }



More information about the Openvas-commits mailing list