Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LoadLibraryR.c #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update LoadLibraryR.c #6

wants to merge 1 commit into from

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