Bypass macOS' max_protection using mach_vm_protect(VM_PROT_COPY)#31
Merged
Snaipe merged 1 commit intoSnaipe:masterfrom Nov 17, 2021
Merged
Bypass macOS' max_protection using mach_vm_protect(VM_PROT_COPY)#31Snaipe merged 1 commit intoSnaipe:masterfrom
Snaipe merged 1 commit intoSnaipe:masterfrom
Conversation
Merged
Snaipe
requested changes
Nov 12, 2021
712145f to
31aae3c
Compare
Snaipe
reviewed
Nov 16, 2021
Collaborator
Author
|
I'm investigating an issue with the new patch Update: Nope, I just messed up the vm_protect detection. :) |
31aae3c to
847dea4
Compare
max_prot disallows injecting the BoxFort trampoline into main()'s location. This commit replaces the mprotect() call with vm_protect(VM_PROT_COPY), which gets (COW) a writable page.
847dea4 to
17c9680
Compare
Collaborator
Author
|
Okay, I think everything is fine now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
max_protdisallows injecting the BoxFort trampoline into main()'s location.This PR replaces the
mprotect()call withvm_protect(VM_PROT_COPY), which gets (COW) a writable page.https://stackoverflow.com/questions/60654834/using-mprotect-to-make-text-segment-writable-on-macos
Note:
mprotect()would still work in cases when the library is dynamically linked to the executable.