Samba < 2.2.8a / 3.0.0 Multiple Remote Overflows - Nessus

Critical   Plugin ID: 11523

This page contains detailed information about the Samba < 2.2.8a / 3.0.0 Multiple Remote Overflows Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 11523
Name: Samba < 2.2.8a / 3.0.0 Multiple Remote Overflows
Filename: samba_trans2open_overflow.nasl
Vulnerability Published: 2003-04-07
This Plugin Published: 2003-04-07
Last Modification Time: 2018-07-27
Plugin Version: 1.32
Plugin Type: remote
Plugin Family: Gain a shell remotely
Dependencies: smb_nativelanman.nasl
Required KB Items [?]: Settings/ParanoidReport, SMB/samba

Vulnerability Information


Severity: Critical
Vulnerability Published: 2003-04-07
Patch Published: N/A
CVE [?]: CVE-2003-0196, CVE-2003-0201
CPE [?]: cpe:/a:samba:samba
Exploited by Malware: True

Synopsis

Arbitrary code may be run on the remote server.

Description

The remote Samba server is vulnerable to a buffer overflow when it calls the function trans2open(). An attacker may exploit this flaw to gain a root shell on this host.

In addition, it is reported that this version of Samba is vulnerable to additional overflows, although Nessus has not checked for them.

Solution

Upgrade to Samba 2.2.8a or 3.0.0.

Public Exploits


Target Network Port(s): 139, 445
Target Asset(s): N/A
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub, Immunity Canvas)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Samba < 2.2.8a / 3.0.0 Multiple Remote Overflows vulnerability:

  1. Metasploit: exploit/solaris/samba/trans2open
    [Samba trans2open Overflow (Solaris SPARC)]
  2. Metasploit: exploit/freebsd/samba/trans2open
    [Samba trans2open Overflow (*BSD x86)]
  3. Metasploit: exploit/linux/samba/trans2open
    [Samba trans2open Overflow (Linux x86)]
  4. Metasploit: exploit/osx/samba/trans2open
    [Samba trans2open Overflow (Mac OS X PPC)]
  5. Exploit-DB: exploits/osx/remote/9924.rb
    [EDB-9924: Samba 2.2.0 < 2.2.8 (OSX) - trans2open Overflow (Metasploit)]
  6. Exploit-DB: exploits/solaris_sparc/remote/16330.rb
    [EDB-16330: Samba 2.2.8 (Solaris SPARC) - 'trans2open' Remote Overflow (Metasploit)]
  7. Exploit-DB: exploits/linux_x86/remote/16861.rb
    [EDB-16861: Samba 2.2.8 (Linux x86) - 'trans2open' Remote Overflow (Metasploit)]
  8. Exploit-DB: exploits/osx_ppc/remote/16876.rb
    [EDB-16876: Samba 2.2.8 (OSX/PPC) - 'trans2open' Remote Overflow (Metasploit)]
  9. Exploit-DB: exploits/bsd_x86/remote/16880.rb
    [EDB-16880: Samba 2.2.8 (BSD x86) - 'trans2open' Remote Overflow (Metasploit)]
  10. GitHub: https://github.com/2davic3/Reporte
    [CVE-2003-0201]
  11. GitHub: https://github.com/Drift-Security/Shadow_Brokers-Vs-NSA
    [CVE-2003-0201]
  12. GitHub: https://github.com/R3K1NG/ShadowBrokersFiles
    [CVE-2003-0201]
  13. GitHub: https://github.com/antiscammerarmy/ShadowBrokersFiles
    [CVE-2003-0201]
  14. GitHub: https://github.com/bl4ck4t/Tools
    [CVE-2003-0201]
  15. GitHub: https://github.com/cipherreborn/SB--.-HACK-the-EQGRP-1
    [CVE-2003-0201]
  16. GitHub: https://github.com/happysmack/x0rzEQGRP
    [CVE-2003-0201]
  17. GitHub: https://github.com/kongjiexi/leaked2
    [CVE-2003-0201]
  18. GitHub: https://github.com/maxcvnd/bdhglopoj
    [CVE-2003-0201]
  19. GitHub: https://github.com/r3p3r/x0rz-EQGRP
    [CVE-2003-0201]
  20. GitHub: https://github.com/rebekattan/Reporte-de-Resultados
    [CVE-2003-0201]
  21. GitHub: https://github.com/shakenetwork/shadowbrokerstuff
    [CVE-2003-0201]
  22. GitHub: https://github.com/thePevertedSpartan/EQ1
    [CVE-2003-0201]
  23. GitHub: https://github.com/thetrentusdev/shadowbrokerstuff
    [CVE-2003-0201]
  24. GitHub: https://github.com/thetrentus/ShadowBrokersStuff
    [CVE-2003-0201]
  25. GitHub: https://github.com/wuvuw/EQGR
    [CVE-2003-0201]
  26. GitHub: https://github.com/x0rz/EQGRP
    [CVE-2003-0201]
  27. GitHub: https://github.com/KernelPan1k/trans2open-CVE-2003-0201
    [CVE-2003-0201: Samba exploit CVE2003-0201]
  28. Immunity Canvas: CANVAS

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:C/I:C/A:C/E:H/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:8.7 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.7 (High)

Go back to menu.

Plugin Source


This is the samba_trans2open_overflow.nasl nessus plugin source code. This script is Copyright (C) 2003-2018 Tenable Network Security, Inc.

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

# Ref:
#  Date: Mon, 7 Apr 2003 07:44:58 +0000 (UTC)
#  From: Erik Parker <[email protected]>
#  To: [email protected]
#  Subject: [VulnWatch] [DDI-1013] Buffer Overflow in Samba allows remote root compromise
#

include("compat.inc");

if (description)
{
 script_id(11523);
 script_version("1.32");
 script_cvs_date("Date: 2018/07/27 18:38:14");

 script_cve_id("CVE-2003-0196", "CVE-2003-0201");
 script_bugtraq_id(7294, 7295);
 script_xref(name:"RHSA", value:"2003:137-02");
 script_xref(name:"SuSE", value:"SUSE-SA:2003:025");

 script_name(english:"Samba < 2.2.8a / 3.0.0 Multiple Remote Overflows");
 script_summary(english:"overflows the remote samba server");

 script_set_attribute(attribute:"synopsis", value:"Arbitrary code may be run on the remote server.");
 script_set_attribute(attribute:"description", value:
"The remote Samba server is vulnerable to a buffer overflow when it
calls the function trans2open(). An attacker may exploit this flaw to
gain a root shell on this host.

In addition, it is reported that this version of Samba is vulnerable
to additional overflows, although Nessus has not checked for them.");
 script_set_attribute(attribute:"solution", value:"Upgrade to Samba 2.2.8a or 3.0.0.");
 script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
 script_set_cvss_temporal_vector("CVSS2#E:H/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:"exploited_by_malware", value:"true");
 script_set_attribute(attribute:"metasploit_name", value:'Samba trans2open Overflow (Solaris SPARC)');
 script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
 script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
 script_set_attribute(attribute:"canvas_package", value:'CANVAS');

 script_set_attribute(attribute:"vuln_publication_date", value:"2003/04/07");
 script_set_attribute(attribute:"plugin_publication_date", value:"2003/04/07");

 script_set_attribute(attribute:"potential_vulnerability", value:"true");
 script_set_attribute(attribute:"plugin_type", value:"remote");
 script_set_attribute(attribute:"cpe", value:"cpe:/a:samba:samba");
 script_end_attributes();

 script_category(ACT_ATTACK);
 script_copyright(english:"This script is Copyright (C) 2003-2018 Tenable Network Security, Inc.");
 script_family(english:"Gain a shell remotely");

 script_dependencie("smb_nativelanman.nasl");
 script_require_keys("SMB/samba", "Settings/ParanoidReport");
 script_require_ports(139,445);

 exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("smb_func.inc");

if (report_paranoia < 2) audit(AUDIT_PARANOID);

#
# The script code starts here
#

function old_smb_recv(socket, length)
{
   local_var header, len, trailer;

   header = recv(socket:socket, length:4, min:4);
   if (strlen(header) < 4)return(NULL);
   len = 256 * ord(header[2]);
   len += ord(header[3]);
   if (len == 0)return(header);
   trailer = recv(socket:socket, length:len, min:len);
   if(strlen(trailer) < len )return(NULL);
   return strcat(header, trailer);
}

port = kb_smb_transport();
if(!get_port_state(port))exit(1);


ssetup = raw_string(0x00, 0x00, 0x00, 0x2e, 0xff, 0x53, 0x4d, 0x42, 0x73, 0x00, 0x00, 0x00, 0x00, 0x08,
                   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x20, 0x02, 0x00, 0x01,
                   0x00, 0x00, 0x00, 0x00);


treeconnect = raw_string(0x00, 0x00, 0x00, 0x3c, 0xff, 0x53, 0x4d, 0x42, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00,
           0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00,
           0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x5c, 0x69, 0x70, 0x63, 0x24,
           0x25, 0x6e, 0x6f, 0x62, 0x6f, 0x64, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x50,
           0x43, 0x24);

trans2 = raw_string(
            0x00, 0x00, 0xA, 0x00, 0xff, 0x53, 0x4d, 0x42, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
        0x64, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x07, 0x0c, 0x00, 0xd0, 0x07, 0x0c, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x07, 0x43, 0x00, 0x0c, 0x00, 0x14, 0x08, 0x01,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90);
trans2 +=  crap(4096 - strlen(trans2));


soc = open_sock_tcp(port);
if(!soc)exit(1);


send(socket:soc, data:ssetup);
r = old_smb_recv(socket:soc);
if(strlen(r) < 33)exit(0);

send(socket:soc, data:treeconnect);
r = old_smb_recv(socket:soc);
if(!r)exit(0);

send(socket:soc, data:trans2);
r = old_smb_recv(socket:soc);
if(!r)security_hole(port);
close(soc);

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

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

Go back to menu.

How to Run


Here is how to run the Samba < 2.2.8a / 3.0.0 Multiple Remote Overflows 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 Gain a shell remotely plugin family.
  6. On the right side table select Samba < 2.2.8a / 3.0.0 Multiple Remote Overflows plugin ID 11523.
  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 samba_trans2open_overflow.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

/opt/nessus/bin/nasl -T - samba_trans2open_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 samba_trans2open_overflow.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: RHSA | Red Hat Security Advisory: SuSE Security Advisory:
  • SUSE-SA:2003:025
See also: Similar and related Nessus plugins:
  • 15117 - Debian DSA-280-1 : samba - buffer overflow
  • 14028 - Mandrake Linux Security Advisory : samba (MDKSA-2003:044)
  • 12387 - RHEL 2.1 : samba (RHSA-2003:138)
  • 122056 - Samba < 2.2.8a Remote Code Execution Vulnerability
  • 13795 - SUSE-SA:2003:025: samba
  • 11398 - Samba < 2.2.8 Multiple Vulnerabilities
  • 11442 - Samba TNG < 0.3.1 Multiple Remote Vulnerabilities
  • 11168 - Samba Encrypted Password String Conversion Decryption Overflow
  • 25217 - Samba < 3.0.25 Multiple Vulnerabilities
  • 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
  • 47036 - Samba 3.x < 3.3.13 SMB1 Packet Chaining Memory Corruption
  • 55733 - Samba 3.x < 3.3.16 / 3.4.14 / 3.5.10 Multiple Vulnerabilities
  • 82580 - Samba 3.0.0 'SamrChangePassword' RCE
  • 69276 - Samba 3.x < 3.5.22 / 3.6.x < 3.6.17 / 4.0.x < 4.0.8 read_nttrans_ea_lis DoS
  • 132023 - Samba 4.x < 4.9.17 / 4.10.x < 4.10.11 / 4.11.x < 4.11.3 Multiple Vulnerabilities
  • 133210 - Samba 4.x < 4.9.18 / 4.10.x < 4.10.12 / 4.11.x < 4.11.5 Multiple Vulnerabilities
  • 81485 - Samba 3.5.x < 3.5.22 / 3.6.x < 3.6.25 / 4.0.x < 4.0.25 / 4.1.x < 4.1.17 TALLOC_FREE() RCE
  • 138223 - Samba 4.x < 4.10.17 / 4.11.x < 4.11.11 / 4.12.x < 4.12.4 Multiple Vulnerabilities
  • 142419 - Samba 3.6.x < 4.11.15 / 4.12.x < 4.12.9 / 4.13.x < 4.13.1 Multiple Vulnerabilities
  • 149699 - Samba 4.12.x < 4.12.14 / 4.13.x < 4.13.7 / 4.14.x < 4.14.2 Multiple DoS
  • 149350 - Samba 3.6.x < 4.12.15 / 4.13.x < 4.13.8 / 4.14.x < 4.14.4 Unauthorized File Access
  • 155620 - Samba 4.13.x < 4.13.14 / 4.14.x < 4.14.10 / 4.15.x < 4.15.2 Multiple Vulnerabilities
  • 157360 - Samba 4.13.x < 4.13.17 / 4.14.x < 4.14.12 / 4.15.x < 4.15.5 Multiple Vulnerabilities
  • 90508 - Samba 3.x < 4.2.10 / 4.2.x < 4.2.10 / 4.3.x < 4.3.7 / 4.4.x < 4.4.1 Multiple Vulnerabilities (Badlock)
  • 100388 - Samba 3.5.x < 4.4 / 4.4.x < 4.4.14 / 4.5.x < 4.5.10 / 4.6.x < 4.6.4 Shared Library RCE
  • 103535 - Samba 4.4.x < 4.4.16 / 4.5.x < 4.5.14 / 4.6.x < 4.6.8 Multiple Vulnerabilities
  • 108378 - Samba 4.5.x < 4.5.16 / 4.6.x < 4.6.14 / 4.7.x < 4.7.6 Multiple Vulnerabilities
  • 90509 - Samba Badlock Vulnerability
  • 130628 - Samba 4.5.x / 4.6.x / 4.7.x / 4.8.x / 4.9.x < 4.9.15 / 4.10.x < 4.10.10 / 4.11.x < 4.11.2 Password Complexity Check Bypass (CVE-2019-14833)
  • 130629 - Samba 4.x < 4.9.15 / 4.10.x < 4.10.10 AD DC LDAP Server Denial of Service (CVE-2019-14847)
  • 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
  • 44406 - Samba Symlink Traversal Arbitrary File Access (unsafe check)

Version


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

Go back to menu.