Skip to content

Commit 98363bc

Browse files
authored
Merge pull request #250 from SrFlipFlop/stepfunctions-old-cli
Corrected AWS CLI syntax for Step Functions
2 parents 39346f3 + 26a50a6 commit 98363bc

File tree

1 file changed

+5
-5
lines changed
  • src/pentesting-cloud/aws-security/aws-privilege-escalation/aws-stepfunctions-privesc

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Or you could also go to the API AWS documentation and check each action docs:
2828
An attacker with the **`states:TestState`** & **`iam:PassRole`** permissions can test any state and pass any IAM role to it without creating or updating an existing state machine, potentially enabling unauthorized access to other AWS services with the roles' permissions. Combined, these permissions can lead to extensive unauthorized actions, from manipulating workflows to alter data to data breaches, resource manipulation, and privilege escalation.
2929

3030
```bash
31-
aws states test-state --definition <value> --role-arn <value> [--input <value>] [--inspection-level <value>] [--reveal-secrets | --no-reveal-secrets]
31+
aws stepfunctions test-state --definition <value> --role-arn <value> [--input <value>] [--inspection-level <value>] [--reveal-secrets | --no-reveal-secrets]
3232
```
3333

3434
The following examples show how to test an state that creates an access key for the **`admin`** user leveraging these permissions and a permissive role of the AWS environment. This permissive role should have any high-privileged policy associated with it (for example **`arn:aws:iam::aws:policy/AdministratorAccess`**) that allows the state to perform the **`iam:CreateAccessKey`** action:
@@ -73,14 +73,14 @@ An attacker with the **`states:CreateStateMachine`**& **`iam:PassRole`** would b
7373

7474
```bash
7575
# Create a state machine
76-
aws states create-state-machine --name <value> --definition <value> --role-arn <value> [--type <STANDARD | EXPRESS>] [--logging-configuration <value>]\
76+
aws stepfunctions create-state-machine --name <value> --definition <value> --role-arn <value> [--type <STANDARD | EXPRESS>] [--logging-configuration <value>]\
7777
[--tracing-configuration <enabled=true|false>] [--publish | --no-publish] [--version-description <value>]
7878

7979
# Start a state machine execution
80-
aws states start-execution --state-machine-arn <value> [--name <value>] [--input <value>] [--trace-header <value>]
80+
aws stepfunctions start-execution --state-machine-arn <value> [--name <value>] [--input <value>] [--trace-header <value>]
8181

8282
# Start a Synchronous Express state machine execution
83-
aws states start-sync-execution --state-machine-arn <value> [--name <value>] [--input <value>] [--trace-header <value>]
83+
aws stepfunctions start-sync-execution --state-machine-arn <value> [--name <value>] [--input <value>] [--trace-header <value>]
8484
```
8585

8686
The following examples show how to create an state machine that creates an access key for the **`admin`** user and exfiltrates this access key to an attacker-controlled S3 bucket, leveraging these permissions and a permissive role of the AWS environment. This permissive role should have any high-privileged policy associated with it (for example **`arn:aws:iam::aws:policy/AdministratorAccess`**) that allows the state machine to perform the **`iam:CreateAccessKey`** & **`s3:putObject`** actions.
@@ -160,7 +160,7 @@ Depending on how permissive is the IAM Role associated to the state machine is,
160160
2. **Not permissive IAM Role**: In contrast with the previous case, here an attacker would also require the **`iam:PassRole`** permission since it would be necessary to associate a permissive IAM Role to the state machine in addition to modify the state machine definition.
161161

162162
```bash
163-
aws states update-state-machine --state-machine-arn <value> [--definition <value>] [--role-arn <value>] [--logging-configuration <value>] \
163+
aws stepfunctions update-state-machine --state-machine-arn <value> [--definition <value>] [--role-arn <value>] [--logging-configuration <value>] \
164164
[--tracing-configuration <enabled=true|false>] [--publish | --no-publish] [--version-description <value>]
165165
```
166166

0 commit comments

Comments
 (0)