Copiar Buffer en proceso actual usando ReadProcessMemory
# CopyReadProcessMemory
## Description
CopyReadProcessMemory expoits the miss-configuration/vulnerability present on the API Windows method *ReadProcessMemory* discovered by *DarkCoderSc*.
It exploits the nature of the in/out pointer param named **lpNumberOfBytesRead*, that enables to write into process memory without calling common API methods to do so such as memcpy, this is perfect for AV and EDR detection evasion
La clase esta en que se le pasa como parametro nSize el caracter a leer por ejemplo 'H' que es 0x48 o 72 en Hexadimal, y donde lo va a guardar el numero de caracteres leidos es en *lpNumberOfBytesRead donde le pasamos la direccion de nuestro buffer.
This tool can directly be used on red team operations as a POC.
pDestOffset = (SIZE_T*)((BYTE*)pNewBuffer + I);
## Download
// Esta llamada en realidad no copia correctamente, pero se deja igual que en Delphi
ReadProcessMemory(
GetCurrentProcess(), // handle del proceso
pNewBuffer, // dirección origen (??)
pDummyBuffer, // destino temporal
*((BYTE*)AString.data() + I), // tamaño (??)
(SIZE_T*)pDestOffset // bytes leídos
);
Just go the release section of the repo and download the latest version
Es una nueva forma de escribir en el proceso normal o remoto
**From an attacker’s perspective, dropping raw shellcode on a system usually means instant detection and failure. Because of this, attackers often obfuscate or encrypt their shellcode to avoid being flagged by AV/EDR solutions, which requires decrypting or de-obfuscating it in memory. To support this workflow, I added an extra feature that can de-obfuscate the payload using the `-x` argument, allowing you to provide the key used for de-xor’ing it.**
It can also be applied to the other features described earlier in this document.
Additionally, a Python script is included to help with payload obfuscation.
### Credits
Big kudos to Jean-Pierre LESUEUR (DarkCoderSc) for discovering the pointer vulnerability and posting it to the unprotect.it project, you can contact him here:
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.