Path: blob/master/modules/encoders/x86/jmp_call_additive.rb
19778 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Encoder::XorAdditiveFeedback67# Uncomment when we get the poly stuff working again.8# Rank = GreatRanking910def initialize11super(12'Name' => 'Jump/Call XOR Additive Feedback Encoder',13'Description' => 'Jump/Call XOR Additive Feedback',14'Author' => 'skape',15'Arch' => ARCH_X86,16'License' => MSF_LICENSE,17'Decoder' => {18'Stub' =>19"\xfc" + # cld20"\xbbXORK" + # mov ebx, key21"\xeb\x0c" + # jmp short 0x1422"\x5e" + # pop esi23"\x56" + # push esi24"\x31\x1e" + # xor [esi], ebx25"\xad" + # lodsd26"\x01\xc3" + # add ebx, eax27"\x85\xc0" + # test eax, eax28"\x75\xf7" + # jnz 0xa29"\xc3" + # ret30"\xe8\xef\xff\xff\xff", # call 0x831'KeyOffset' => 2,32'KeySize' => 4,33'BlockSize' => 434})35end3637#38# Append the termination block.39#40def encode_end(state)41state.encoded += [ state.key ].pack(state.decoder_key_pack)42end43end444546