Add Support for Windows .writable? in Post Mixin#21573
Open
jheysel-r7 wants to merge 4 commits into
Open
Conversation
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.
Description
This adds support to the Post Mixin for Windows sessions to run the
.writable?method.Meterpreter sessions will try to open a write handle to the file via
session.fs.file.new(path, 'wb')Shell sessions will try to append to the file via
type nul >> pathReviewer Notes
Create two separates files to test. As a low privilege user, create the files in your home directory - avoid creating the files elsewhere like
C:\users\publicorC:\which will inherit unwanted privileges which will affected the test.Create
writable.txt:Create
not_writable.txt:Take away write privileges from your user by setting
(R)read privs only:Double check everything looks good:
From the GUI you should see:

Verification Steps
Test Evidence
Evidence included in the verification steps. See the rspec output below:
Environment
AI Usage Disclosure
Claude wrote the tests
Pre-Submission Checklist
rubocopon new files with no new offenses (net new files only)msftidyon changed module files with no new offenses (modules only)msftidy_docson changed documentation files with no new offenses (documentation files only)documentation/modules(new modules only)lib/changes)