New persistence module: Microsoft Bits#20839
Merged
dledda-r7 merged 15 commits intorapid7:masterfrom Apr 14, 2026
Merged
Conversation
bwatters-r7
reviewed
Jan 14, 2026
Co-authored-by: Brendan <bwatters@rapid7.com>
Co-authored-by: Brendan <bwatters@rapid7.com>
dledda-r7
reviewed
Apr 9, 2026
Co-authored-by: Diego Ledda <diego_ledda@rapid7.com>
fix bits persistence to be used with HttpServer
Contributor
|
@h00die may i can ask you to rebase on the current upstream master? if i do it i will steal all you commits :( |
dledda-r7
reviewed
Apr 13, 2026
dledda-r7
reviewed
Apr 13, 2026
Co-authored-by: Diego Ledda <diego_ledda@rapid7.com>
dledda-r7
approved these changes
Apr 14, 2026
dledda-r7
reviewed
Apr 14, 2026
dledda-r7
reviewed
Apr 14, 2026
Contributor
Release NotesThis adds a new persistence module that uses Microsoft Bits to mantain access to the system. |
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.
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