New persistence module: Microsoft Bits #20839
Open
+410
−0
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.
fixes #20823
Prob a good one for @dledda-r7 to look at since we may be able to optimize how persistence and httpserver mixins work together.
This PR adds a new persistence mechanism using microsoft bits. Bits, as you can read from my module documentation and code comments, is very difficult to work with and shape its behavior. From the few articles I read about using it for persistence, most people didn't actually use it for persistence. They used it as a file transfer mechanism, or combined it with something else (task) to get the persistence to kick at a later time.
Through research (aka trial and error) I determined that sending certain http responses will put BITS into a state to retry the connection at a later time without cancelling the job. This later time isn't easy to control though.
Verification
You'll likely want to make this quick (but not instant) so I used the following to test:
use exploit/windows/persistence/bitsset session #set srvhost <ip>run