Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/encoders/x86/xor_dynamic.rb
Views: 11779
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Encoder::XorDynamic67def initialize8super(9'Name' => 'Dynamic key XOR Encoder',10'Description' => 'An x86 XOR encoder with dynamic key size',11'Author' => [ 'lupman', 'phra' ],12'Arch' => ARCH_X86,13'License' => MSF_LICENSE14)15end1617# Indicate that this module can preserve some registers18# ...which is currently not true. This is a temp fix19# until the full preserve_registers functionality is20# implemented.21def can_preserve_registers?22true23end2425def stub26"\xeb\x23" + # jmp _call27"\x5b" + # _ret: pop ebx28"\x89\xdf" + # mov edi, ebx29"\xb0\x41" + # mov al, 'A'30"\xfc" + # cld31"\xae" + # _lp1: scas al, BYTE PTR es:[edi]32"\x75\xfd" + # jne _lp133"\x89\xf9" + # mov ecx, edi34"\x89\xde" + # _lp2: mov esi, ebx35"\x8a\x06" + # _lp3: mov al, BYTE PTR [esi]36"\x30\x07" + # xor BYTE PTR [edi], al37"\x47" + # inc edi38"\x66\x81\x3f\x42\x42" + # cmp WORD PTR [edi], 'BB'39"\x74\x08" + # je _jmp40"\x46" + # inc esi41"\x80\x3e\x41" + # cmp BYTE PTR [esi], 'A'42"\x75\xee" + # jne _lp343"\xeb\xea" + # jmp _lp244"\xff\xe1" + # _jmp: jmp ecx45"\xe8\xd8\xff\xff\xff" # _call: call _ret46end4748def stub_key_term49/A/50end5152def stub_payload_term53/BB/54end55end565758