Skip to content

Conversation

@xHector1337
Copy link
Contributor

No description provided.

@dledda-r7 dledda-r7 self-assigned this Jan 29, 2026
@dledda-r7
Copy link
Contributor

w00t w00t

@xHector1337 xHector1337 force-pushed the add-extension-encryption branch from cb1c64a to 6b7a220 Compare January 30, 2026 14:52
@dledda-r7 dledda-r7 changed the title Extension Encryption For Meterpreter Extension Encryption For Meterpreter: Add Dependency Jan 30, 2026
@dledda-r7 dledda-r7 marked this pull request as ready for review January 30, 2026 16:09
@dledda-r7
Copy link
Contributor

#include <stdio.h>
#include "rc4.h"

int main() {
    const unsigned char key[] = "i_love_metasploit";
    const unsigned char plaintext[] = "This is a test of RC4 encryption.";
    RC4_CTX ctx;
    InitRc4(&ctx, key, sizeof(key) - 1);
    RC4Cipher(&ctx, (unsigned char*)&plaintext, sizeof(plaintext));
    printf("Ciphertext: ");
    for (size_t i = 0; i < sizeof(plaintext); i++) {
        printf("%02x ", plaintext[i]);
    }
    printf("\n");
    // Reset context for decryption
    InitRc4(&ctx, key, sizeof(key) - 1);
    RC4Cipher(&ctx, (unsigned char*)&plaintext, sizeof(plaintext));
    printf("Decrypted: %s\n", plaintext);
    return 0;
}   
┌──(kali㉿kali)-[~/…/c/meterpreter/source/metsrv]
└─$ x86_64-w64-mingw32-gcc rc4.c rc4_test.c -o rc4_test.exe
rc4_test.c: In function ‘main’:
rc4_test.c:8:19: warning: passing argument 2 of ‘InitRc4’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
    8 |     InitRc4(&ctx, key, sizeof(key) - 1);
      |                   ^~~
In file included from rc4_test.c:2:
rc4.h:8:47: note: expected ‘unsigned char *’ but argument is of type ‘const unsigned char *’
    8 | BOOL InitRc4(RC4_CTX* Context, unsigned char* Key, size_t len);
      |                                ~~~~~~~~~~~~~~~^~~
rc4_test.c:16:19: warning: passing argument 2 of ‘InitRc4’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   16 |     InitRc4(&ctx, key, sizeof(key) - 1);
      |                   ^~~
rc4.h:8:47: note: expected ‘unsigned char *’ but argument is of type ‘const unsigned char *’
    8 | BOOL InitRc4(RC4_CTX* Context, unsigned char* Key, size_t len);
      |                                ~~~~~~~~~~~~~~~^~~
                                                                                                                                                                                                                                          
┌──(kali㉿kali)-[~/…/c/meterpreter/source/metsrv]
└─$ wine rc4_test.exe                                      
it looks like wine32 is missing, you should install it.
multiarch needs to be enabled first.  as root, please
execute "dpkg --add-architecture i386 && apt-get update &&
apt-get install wine32:i386"
Ciphertext: d6 ae 26 2a 86 84 b9 da 95 6d bc 1f d7 2d 23 17 b2 bd 9a 1a 6f 9c 8b 56 72 6d 8b b8 59 6d 90 d6 15 d3
Decrypted: This is a test of RC4 encryption.
                                                                                                                                                                                                                                          
┌──(kali㉿kali)-[~/…/c/meterpreter/source/metsrv]
└─$ 

@dledda-r7 dledda-r7 merged commit 6c647ef into rapid7:master Feb 2, 2026
31 checks passed
@xHector1337 xHector1337 deleted the add-extension-encryption branch February 2, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants