2005-07-09 21:22:32 +00:00
|
|
|
require 'msf/core'
|
2005-05-18 06:28:12 +00:00
|
|
|
|
|
|
|
module Msf
|
|
|
|
module Encoders
|
2005-07-13 18:54:41 +00:00
|
|
|
module X86
|
2005-05-18 06:28:12 +00:00
|
|
|
|
|
|
|
class JmpCallAdditive < Msf::Encoder::XorAdditiveFeedback
|
|
|
|
|
|
|
|
def initialize
|
|
|
|
super(
|
2005-07-10 20:49:13 +00:00
|
|
|
'Name' => 'Jump/Call XOR Additive Feedback Encoder',
|
2005-05-18 06:28:12 +00:00
|
|
|
'Version' => '$Revision$',
|
|
|
|
'Description' => 'Jump/Call XOR Additive Feedback',
|
|
|
|
'Author' => 'skape',
|
2005-07-13 18:54:41 +00:00
|
|
|
'Arch' => ARCH_X86,
|
2005-07-10 20:49:13 +00:00
|
|
|
'Decoder' =>
|
|
|
|
{
|
|
|
|
'Stub' =>
|
|
|
|
"\xfc" + # cld
|
|
|
|
"\xbbXORK" + # mov ebx, key
|
|
|
|
"\xeb\x0c" + # jmp short 0x14
|
|
|
|
"\x5e" + # pop esi
|
|
|
|
"\x56" + # push esi
|
|
|
|
"\x31\x1e" + # xor [esi], ebx
|
|
|
|
"\xad" + # lodsd
|
|
|
|
"\x01\xc3" + # add ebx, eax
|
|
|
|
"\x85\xc0" + # test eax, eax
|
|
|
|
"\x75\xf7" + # jnz 0xa
|
|
|
|
"\xc3" + # ret
|
|
|
|
"\xe8\xef\xff\xff\xff", # call 0x8
|
|
|
|
'KeyOffset' => 2,
|
|
|
|
'KeySize' => 4,
|
|
|
|
'BlockSize' => 4,
|
|
|
|
})
|
2005-05-18 06:28:12 +00:00
|
|
|
end
|
|
|
|
|
2005-11-11 01:22:03 +00:00
|
|
|
#
|
|
|
|
# Append the termination block
|
|
|
|
#
|
|
|
|
def encode_end(state)
|
|
|
|
state.encoded += [ state.key ].pack(state.decoder_key_pack)
|
|
|
|
end
|
|
|
|
|
2005-05-18 06:28:12 +00:00
|
|
|
end
|
|
|
|
|
2005-05-22 07:14:16 +00:00
|
|
|
end end end
|