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/external/source/shellcode/windows/x86/src/test_rc4.asm
Views: 11789
;-----------------------------------------------------------------------------;1; Author: Michael Schierl (schierlm[at]gmx[dot]de)2; Version: 1.0 (29 December 2012)3;-----------------------------------------------------------------------------;45;6; c1 = OpenSSL::Cipher::Cipher.new('RC4')7; c1.encrypt8; c1.key="Hello, my world!"9; c1.update("This is some magic data you may want to have encoded and decoded again").unpack("H*")10;11; => "882353c5de0f5e6b10bf0d25c432c5d16424dc797e895f37f261c893b31d577e7e69f77e07aa576d58c7f757164e7d74988feb10f972b28dcfa1e3a2b1cc0b0fa1a8b116294b"12;13; c1 = OpenSSL::Cipher::Cipher.new('RC4')14; c1.decrypt15; c1.key="Hello, my world!"16; c1.update(["882353c5de0f5e6b10bf0d25c432c5d16424dc797e895f37f261c893b31d577e7e69f77e07aa576d58c7f757164e7d74988feb10f972b28dcfa1e3a2b1cc0b0fa1a8b116294b"].pack("H*"))17;18; => "This is some magic data you may want to have encoded and decoded again"19;2021[BITS 32]22[ORG 0]2324cld ; Clear the direction flag.25call pushkey ; push the address of the key onto the stack26db "Hello, my world!"27pushkey:28pop esi ; and store it into ESI29call pushdata ; push the address of the encrypted data on the stack30db 0x88, 0x23, 0x53, 0xc5, 0xde, 0x0f, 0x5e, 0x6b, 0x10, 0xbf, 0x0d, 0x25, 0xc4, 0x32, 0xc5, 0xd1, 0x64, 0x24, 0xdc, 0x79, 0x7e, 0x89, 0x5f, 0x37, 0xf2, 0x61, 0xc8, 0x93, 0xb3, 0x1d, 0x57, 0x7e, 0x7e, 0x69, 0xf7, 0x7e, 0x07, 0xaa, 0x57, 0x6d, 0x58, 0xc7, 0xf7, 0x57, 0x16, 0x4e, 0x7d, 0x74, 0x98, 0x8f, 0xeb, 0x10, 0xf9, 0x72, 0xb2, 0x8d, 0xcf, 0xa1, 0xe3, 0xa2, 0xb1, 0xcc, 0x0b, 0x0f, 0xa1, 0xa8, 0xb1, 0x16, 0x29, 0x4b31pushdata:32pop ebp ; and store it into EBP33mov ecx, 70 ; store data length into ECX34sub esp, 0x100 ; make space on stack for S-Box35mov edi, esp ; and store address into EDI36nop37nop38nop39int 3 ; for stepping through the code40; let's run the RC4 decoder41%include "./src/block/block_rc4.asm"42int 3 ; EBP should point to decoded data now434445