Skip to content

Commit 98d36f0

Browse files
committed
ssm
1 parent d418fff commit 98d36f0

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
- [AWS - SNS Persistence](pentesting-cloud/aws-security/aws-persistence/aws-sns-persistence.md)
231231
- [AWS - Secrets Manager Persistence](pentesting-cloud/aws-security/aws-persistence/aws-secrets-manager-persistence.md)
232232
- [AWS - SQS Persistence](pentesting-cloud/aws-security/aws-persistence/aws-sqs-persistence.md)
233-
- [AWS - SSM Perssitence](pentesting-cloud/aws-security/aws-persistence/aws-ssm-perssitence.md)
233+
- [AWS - SSM Perssitence](pentesting-cloud/aws-security/aws-persistence/aws-ssm-persistence.md)
234234
- [AWS - Step Functions Persistence](pentesting-cloud/aws-security/aws-persistence/aws-step-functions-persistence.md)
235235
- [AWS - STS Persistence](pentesting-cloud/aws-security/aws-persistence/aws-sts-persistence.md)
236236
- [AWS - Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/README.md)

src/pentesting-cloud/aws-security/aws-persistence/aws-ssm-perssitence.md renamed to src/pentesting-cloud/aws-security/aws-persistence/aws-ssm-persistence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For more information check:
1212

1313
### Using ssm:CreateAssociation for persistence
1414

15-
An attacker with the permission ssm:CreateAssociation can create a State Manager Association to automatically execute commands on EC2 instances managed by SSM. These associations can be configured to run at a fixed interval, making them suitable for backdoor-like persistence without interactive sessions.
15+
An attacker with the permission **`ssm:CreateAssociation`** can create a State Manager Association to automatically execute commands on EC2 instances managed by SSM. These associations can be configured to run at a fixed interval, making them suitable for backdoor-like persistence without interactive sessions.
1616

1717

1818
```bash

src/pentesting-cloud/aws-security/aws-privilege-escalation/aws-ssm-privesc.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,23 @@ aws ssm get-command-invocation --command-id <cmd_id> --instance-id <i_id>
121121

122122
**Potential Impact:** Find sensitive information inside the output of the command lines.
123123

124+
### Using ssm:CreateAssociation
125+
126+
An attacker with the permission **`ssm:CreateAssociation`** can create a State Manager Association to automatically execute commands on EC2 instances managed by SSM. These associations can be configured to run at a fixed interval, making them suitable for backdoor-like persistence without interactive sessions.
127+
128+
129+
```bash
130+
aws ssm create-association \
131+
--name SSM-Document-Name \
132+
--targets Key=InstanceIds,Values=target-instance-id \
133+
--parameters commands=["malicious-command"] \
134+
--schedule-expression "rate(30 minutes)" \
135+
--association-name association-name
136+
```
137+
138+
> [!NOTE]
139+
> This persistence method works as long as the EC2 instance is managed by Systems Manager, the SSM agent is running, and the attacker has permission to create associations. It does not require interactive sessions or explicit ssm:SendCommand permissions. **Important:** The `--schedule-expression` parameter (e.g., `rate(30 minutes)`) must respect AWS's minimum interval of 30 minutes. For immediate or one-time execution, omit `--schedule-expression` entirely — the association will execute once after creation.
140+
124141
### Codebuild
125142

126143
You can also use SSM to get inside a codebuild project being built:

src/pentesting-cloud/aws-security/aws-services/aws-ec2-ebs-elb-ssm-vpc-and-vpn-enum/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,14 @@ In the following page you can check how to **abuse SSM permissions to escalate p
200200
../../aws-privilege-escalation/aws-ssm-privesc.md
201201
{{#endref}}
202202

203+
### Perssistence
204+
205+
In the following page you can check how to **abuse SSM permissions to achieve persistence**:
206+
207+
{{#ref}}
208+
../../aws-persistence/aws-ssm-persistence.md
209+
{{#endref}}
210+
203211
## ELB
204212

205213
**Elastic Load Balancing** (ELB) is a **load-balancing service for Amazon Web Services** (AWS) deployments. ELB automatically **distributes incoming application traffic** and scales resources to meet traffic demands.

0 commit comments

Comments
 (0)