2009-11-17 00:00:08 +00:00
|
|
|
##
|
2009-11-17 00:05:19 +00:00
|
|
|
# $Id$
|
2009-11-17 00:00:08 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2009-11-17 00:00:08 +00:00
|
|
|
# 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/
|
2009-11-17 00:00:08 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Encoder
|
|
|
|
|
2009-12-03 08:39:22 +00:00
|
|
|
# Below normal ranking because this will produce incorrect code a lot of
|
|
|
|
# the time.
|
|
|
|
Rank = LowRanking
|
|
|
|
|
2009-11-17 00:00:08 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'Generic ${IFS} Substitution Command Encoder',
|
2009-11-17 00:05:19 +00:00
|
|
|
'Version' => '$Revision$',
|
2009-11-17 00:00:08 +00:00
|
|
|
'Description' => %q{
|
|
|
|
This encoder uses standard Bourne shell variable substitution
|
|
|
|
to avoid spaces without being overly fancy.
|
|
|
|
},
|
|
|
|
'Author' => 'egypt',
|
|
|
|
'Arch' => ARCH_CMD)
|
|
|
|
end
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-11-17 00:00:08 +00:00
|
|
|
#
|
|
|
|
# Encodes the payload
|
|
|
|
#
|
|
|
|
def encode_block(state, buf)
|
|
|
|
buf.gsub!(/\s/, '${IFS}')
|
|
|
|
return buf
|
2010-04-30 08:40:19 +00:00
|
|
|
end
|
2009-11-17 00:00:08 +00:00
|
|
|
|
|
|
|
end
|