-
Notifications
You must be signed in to change notification settings - Fork 14.1k
How to XOR with Metasploit Framework Compiler
adfoster-r7 edited this page Sep 5, 2021
·
3 revisions
The Metasploit C compiler has built-in support for XOR encoding and decoding, which is implemented as the xor.h
header.
#include <Windows.h>
#include <String.h>
#include <xor.h>
int main(int args, char** argv) {
char* xorStr = "NNNN";
char xorKey = 0x0f;
LPVOID lpBuf = VirtualAlloc(NULL, sizeof(int) * strlen(xorStr), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
memset(lpBuf, '\0', strlen(xorStr));
xor((char*) lpBuf, xorStr, xorKey, strlen(xorStr));
MessageBox(NULL, lpBuf, "Test", MB_OK);
return 0;
}
To compile, use Metasploit::Framework::Compiler::Windows.compile_c
- Home Welcome to Metasploit!
- Using Metasploit A collection of useful links for penetration testers.
-
Setting Up a Metasploit Development Environment From
apt-get install
togit push
. - CONTRIBUTING.md What should your contributions look like?
- Landing Pull Requests Working with other people's contributions.
- Using Git All about Git and GitHub.
- Contributing to Metasploit Be a part of our open source community.
- Meterpreter All about the Meterpreter payload.