Skip to content

Conversation

@GoodiesHQ
Copy link

@GoodiesHQ GoodiesHQ commented Jul 22, 2016

Changed the initial remote process allocation type to RW instead of RWX and added a VirtualProtectEx() call to change it to RX once it has been re-written. This will bypass any W^X memory protections.

Changed the initial remote process allocation type to RW instead of RWX and added a VirtualProtectEx() call to change it to RX once it has been re-written. This will bypass any R^X memory protections.
// alloc memory (RWX) in the host process for the image...
lpRemoteLibraryBuffer = VirtualAllocEx( hProcess, NULL, dwLength, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE );
// alloc memory (RW) in the host process for the image...
VirtualProtectEx = VirtualAllocEx( hProcess, NULL, dwLength, MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be setting lpRemoteLibraryBuffer with the return value from VirtualAllocEx?

busterb added a commit to busterb/ReflectiveDLLInjection that referenced this pull request Feb 13, 2018
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