Merged
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.
Attribution
I have not seen either technique documented well, it maybe my own ignorance given both techniques are very straight forward. I first encountered these techniques on a purple team engagement that targeted SSM lateral movement where my organization was attempting to identify all possible gaps in detection for lateral movement within SSM without using iam:PassRole, that list is much longer for SSM. However, while HackTricks does a great job document most of the techniques I thought these two were lacking documentation.
Update Document
An attacker with the permissions
ssm:UpdateDocumentandssm:UpdateDocumentDefaultVersioncan escalate privileges by modifying existing documents. This also allows for persistence within that document. Practically the attacker would also needssm:ListDocumentsto get the names for custom documents and if the attacker wants to obfuscate their payload within an existing documentssm:GetDocumentwould be necessary as well.Maintenance Windows
An attacker with the permissions
ssm:RegisterTaskWithMaintenanceWindowandssm:RegisterTargetWithMaintenanceWindowcan escalate privileges by first registering a new target with an existing maintenance window and then registering a new task. This achieves execution on the existing targets, but can allow an attacker to compromise compute with different roles by register new targets. This also allows for persistence as maintenance windows tasks are executed on a pre-defined interval during the window creation. Practically the attacker would also needssm:DescribeMaintenanceWindowsto get the maintenance window IDs.