# OpenVAS Vulnerability Test
# $Id: egp_detect.nasl 6063 2017-05-03 09:03:05Z teissa $
# Description: EGP detection
#
# Authors:
# Michel Arboi <[email protected]>
#
# Copyright:
# Copyright (C) 2003 Michel Arboi
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2,
# 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.
#
tag_summary = "The remote IP stack answers to an obsolete protocol.
Description :
The remote host is running EGP, an obsolete routing protocol.
If possible, this IP protocol should be disabled.";
tag_solution = "If this protocol is not needed, disable it or filter incoming traffic going
to IP protocol #8";
# See RFC 827 & RFC 888
if(description)
{
script_id(11908);
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_version("$Revision: 6063 $");
script_tag(name:"last_modification", value:"$Date: 2017-05-03 11:03:05 +0200 (Wed, 03 May 2017) $");
script_tag(name:"creation_date", value:"2005-11-03 14:08:04 +0100 (Thu, 03 Nov 2005)");
script_tag(name:"cvss_base", value:"0.0");
name = "EGP detection";
script_name(name);
summary = "Sends an EGP Neighbor Acquisition Message";
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_copyright("This script is Copyright (C) 2003 Michel Arboi");
script_family("Service detection");
script_tag(name : "solution" , value : tag_solution);
script_tag(name : "summary" , value : tag_summary);
script_exclude_keys("keys/islocalhost","keys/TARGET_IS_IPV6");
exit(0);
}
##include("dump.inc");
include('global_settings.inc');
include("network_func.inc");
if (islocalhost() ) exit(0);
if(TARGET_IS_IPV6())exit(0);
s = this_host();
v = eregmatch(pattern: "^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9])+$", string: s);
if (isnull(v)) exit(0);
for (i = 1; i <=4; i++) a[i] = int(v[i]);
a1 = rand() % 256; a2 = rand() % 256;
s1 = rand() % 256; s2 = rand() % 256;
r = raw_string( 2, # EGP version
3, # Type
0, # Code = Neighbor Acquisition Request
0, # Info (not used here)
0, 0, # checksum
a1, a2, # Autonomous system
s1, s2, # Identification
0, 30, # NR Hello Interval
0, 120 # NR Poll Interval
);
ck = ip_checksum(data: r);
r2 = insstr(r, ck, 4, 5);
egp = forge_ip_packet(ip_v: 4, ip_hl: 5, ip_tos: 0, ip_p: 8, ip_ttl: 64,
ip_off: 0, ip_src: this_host(), data: r2);
f = "ip proto 8 and src " + get_host_ip();
for ( i = 0 ; i < 3 ; i ++ )
{
r = send_packet(egp, pcap_active: TRUE, pcap_filter: f, pcap_timeout:1);
if ( r ) break;
}
if ( r == NULL ) exit(0);
hl = ord(r[0]) & 0xF; hl *= 4;
egp = substr(r, hl);
if (ord(egp[0]) == 2 && ord(egp[1]) == 3 && ord(egp[2]) <= 4)
log_message(port: 0, proto: "egp");
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation