ID OPENVAS:1361412562310900811 Type openvas Reporter Copyright (C) 2009 SecPod Modified 2020-08-25T00:00:00
Description
Detection of Asterisk.
The script sends a connection request to the server and attempts to
extract the version number from the reply.
###############################################################################
# OpenVAS Vulnerability Test
#
# Asterisk Version Detection
#
# Authors:
# Sharath S <sharaths@secpod.com>
#
# Copyright:
# Copyright (C) 2009 SecPod, http://www.secpod.com
#
# Updated to Set KB for Product Installation
# - By Sharath S <sharaths@secpod.com> On 2009-08-28
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# (or any later version), as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
###############################################################################
if(description)
{
script_oid("1.3.6.1.4.1.25623.1.0.900811");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_version("2020-08-25T06:55:13+0000");
script_tag(name:"last_modification", value:"2020-08-25 06:55:13 +0000 (Tue, 25 Aug 2020)");
script_tag(name:"creation_date", value:"2009-08-05 14:14:14 +0200 (Wed, 05 Aug 2009)");
script_tag(name:"cvss_base", value:"0.0");
script_name("Asterisk Detection (SIP)");
script_category(ACT_GATHER_INFO);
script_copyright("Copyright (C) 2009 SecPod");
script_family("Product detection");
script_dependencies("sip_detection.nasl");
script_mandatory_keys("sip/banner/available");
script_tag(name:"summary", value:"Detection of Asterisk.
The script sends a connection request to the server and attempts to
extract the version number from the reply.");
script_tag(name:"qod_type", value:"remote_banner");
exit(0);
}
include("cpe.inc");
include("host_details.inc");
include("sip.inc");
include("misc_func.inc");
include("port_service_func.inc");
infos = sip_get_port_proto( default_port:"5060", default_proto:"udp" );
port = infos["port"];
proto = infos["proto"];
banner = sip_get_banner(port:port, proto:proto);
if(banner && ("Asterisk PBX" >< banner || "FPBX-" >< banner)) {
version = "unknown";
asteriskVer = eregmatch(pattern:"Asterisk PBX (certified/)?([0-9.]+(.?[a-z0-9]+)?)", string:banner);
if( ! isnull( asteriskVer[2] ) ) {
version = ereg_replace(pattern:"-", replace:".", string:asteriskVer[2]);
set_kb_item(name:"Asterisk-PBX/Ver", value:version);
} else {
vers = eregmatch( pattern:'FPBX-[0-9.]+\\(([0-9.]+[^)]+)\\)', string:banner );
if (!isnull(vers[1])) {
version = vers[1];
set_kb_item(name:"Asterisk-PBX/Ver", value:version);
}
}
set_kb_item(name:"Asterisk-PBX/Installed", value:TRUE);
cpe = build_cpe(value:version, exp:"^([0-9.]+\.[0-9]+)\.?((rc[0-9]+)|(cert[1-9]))?", base:"cpe:/a:digium:asterisk:");
if(!cpe)
cpe = "cpe:/a:digium:asterisk";
location = port + "/" + proto;
register_product( cpe:cpe, port:port, location:location, service:"sip", proto:proto );
log_message(data: build_detection_report(app:"Asterisk-PBX", version:version, install:location, cpe:cpe, concluded:banner),
port:port, proto:proto);
}
exit(0);
{"id": "OPENVAS:1361412562310900811", "type": "openvas", "bulletinFamily": "scanner", "title": "Asterisk Detection (SIP)", "description": "Detection of Asterisk.\n\n The script sends a connection request to the server and attempts to\n extract the version number from the reply.", "published": "2009-08-05T00:00:00", "modified": "2020-08-25T00:00:00", "cvss": {"score": 0.0, "vector": "NONE"}, "href": "http://plugins.openvas.org/nasl.php?oid=1361412562310900811", "reporter": "Copyright (C) 2009 SecPod", "references": [], "cvelist": [], "lastseen": "2020-10-04T15:17:27", "viewCount": 5, "enchantments": {"dependencies": {"references": [], "modified": "2020-10-04T15:17:27", "rev": 2}, "score": {"value": -0.1, "vector": "NONE", "modified": "2020-10-04T15:17:27", "rev": 2}, "vulnersScore": -0.1}, "pluginID": "1361412562310900811", "sourceData": "###############################################################################\n# OpenVAS Vulnerability Test\n#\n# Asterisk Version Detection\n#\n# Authors:\n# Sharath S <sharaths@secpod.com>\n#\n# Copyright:\n# Copyright (C) 2009 SecPod, http://www.secpod.com\n#\n# Updated to Set KB for Product Installation\n# - By Sharath S <sharaths@secpod.com> On 2009-08-28\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License version 2\n# (or any later version), as published by the Free Software Foundation.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n###############################################################################\n\nif(description)\n{\n script_oid(\"1.3.6.1.4.1.25623.1.0.900811\");\n script_tag(name:\"cvss_base_vector\", value:\"AV:N/AC:L/Au:N/C:N/I:N/A:N\");\n script_version(\"2020-08-25T06:55:13+0000\");\n script_tag(name:\"last_modification\", value:\"2020-08-25 06:55:13 +0000 (Tue, 25 Aug 2020)\");\n script_tag(name:\"creation_date\", value:\"2009-08-05 14:14:14 +0200 (Wed, 05 Aug 2009)\");\n script_tag(name:\"cvss_base\", value:\"0.0\");\n script_name(\"Asterisk Detection (SIP)\");\n script_category(ACT_GATHER_INFO);\n script_copyright(\"Copyright (C) 2009 SecPod\");\n script_family(\"Product detection\");\n script_dependencies(\"sip_detection.nasl\");\n script_mandatory_keys(\"sip/banner/available\");\n\n script_tag(name:\"summary\", value:\"Detection of Asterisk.\n\n The script sends a connection request to the server and attempts to\n extract the version number from the reply.\");\n\n script_tag(name:\"qod_type\", value:\"remote_banner\");\n\n exit(0);\n}\n\ninclude(\"cpe.inc\");\ninclude(\"host_details.inc\");\ninclude(\"sip.inc\");\ninclude(\"misc_func.inc\");\ninclude(\"port_service_func.inc\");\n\ninfos = sip_get_port_proto( default_port:\"5060\", default_proto:\"udp\" );\nport = infos[\"port\"];\nproto = infos[\"proto\"];\n\nbanner = sip_get_banner(port:port, proto:proto);\n\nif(banner && (\"Asterisk PBX\" >< banner || \"FPBX-\" >< banner)) {\n\n version = \"unknown\";\n\n asteriskVer = eregmatch(pattern:\"Asterisk PBX (certified/)?([0-9.]+(.?[a-z0-9]+)?)\", string:banner);\n\n if( ! isnull( asteriskVer[2] ) ) {\n version = ereg_replace(pattern:\"-\", replace:\".\", string:asteriskVer[2]);\n set_kb_item(name:\"Asterisk-PBX/Ver\", value:version);\n } else {\n vers = eregmatch( pattern:'FPBX-[0-9.]+\\\\(([0-9.]+[^)]+)\\\\)', string:banner );\n if (!isnull(vers[1])) {\n version = vers[1];\n set_kb_item(name:\"Asterisk-PBX/Ver\", value:version);\n }\n }\n\n set_kb_item(name:\"Asterisk-PBX/Installed\", value:TRUE);\n cpe = build_cpe(value:version, exp:\"^([0-9.]+\\.[0-9]+)\\.?((rc[0-9]+)|(cert[1-9]))?\", base:\"cpe:/a:digium:asterisk:\");\n if(!cpe)\n cpe = \"cpe:/a:digium:asterisk\";\n\n location = port + \"/\" + proto;\n\n register_product( cpe:cpe, port:port, location:location, service:\"sip\", proto:proto );\n log_message(data: build_detection_report(app:\"Asterisk-PBX\", version:version, install:location, cpe:cpe, concluded:banner),\n port:port, proto:proto);\n}\n\nexit(0);\n", "naslFamily": "Product detection"}