-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Download EC2 Instance User Data technique does request userdata properly #353
Comments
It looks like IAM user fails to assume the role.
Here is screenshot of the CloudTrail event history, although it has Admin privileges. I guess that's why I'm seeing DescribeAccountAttributes API call.
![image](https://user-images.githubusercontent.com/90977809/236269947-292ec413-bc7e-4fe4-88a8-d3760e2c3c33.png)
When I try to assume the role manually, it works.
![image](https://user-images.githubusercontent.com/90977809/236269052-caec8787-b317-45f5-9c31-46dd36b6e42d.png)
From: Alex Groyz
Sent: Thursday, May 4, 2023 11:41 AM
To: DataDog/stratus-red-team ***@***.***>; DataDog/stratus-red-team ***@***.***>
Cc: Author ***@***.***>
Subject: RE: [DataDog/stratus-red-team] Download EC2 Instance User Data technique does request userdata properly (Issue #353)
Hi Christophe,
Here is the screenshot of the output. And I've also attached an export of CloudTrail for the AWS user to execute the technique.
I've redacted the account id, access key, and IP address.
***@***.***
From: Christophe Tafani-Dereeper ***@***.******@***.***>>
Sent: Thursday, May 4, 2023 4:06 AM
To: DataDog/stratus-red-team ***@***.******@***.***>>
Cc: Alex Groyz ***@***.******@***.***>>; Author ***@***.******@***.***>>
Subject: Re: [DataDog/stratus-red-team] Download EC2 Instance User Data technique does request userdata properly (Issue #353)
Tested it and it seems to be working properly:
[image]<https://user-images.githubusercontent.com/136675/236145633-a1bf32bb-dc88-4fb4-8e20-e458087bd373.png>
[image]<https://user-images.githubusercontent.com/136675/236145685-def2a1a0-b118-4f29-b809-6d847045b2b0.png>
And the requestParameters looks fine to me:
[image]<https://user-images.githubusercontent.com/136675/236145790-2237d205-3bf1-4fb2-ba90-3a0e4fbed716.png>
Can you share the full output and a full CloudTrail log sample?
-
Reply to this email directly, view it on GitHub<#353 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AVWDMEKZHTZWEP3Y5WUSN6LXENPNHANCNFSM6AAAAAAXU3VKEU>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Thanks, can you share your full Stratus Red Team output? Make sure the technique is clean first:
|
./stratus detonate aws.discovery.ec2-download-user-data |
This looks correct, what makes you think that "It looks like IAM user fails to assume the role"? |
Can you paste here the whole CSV, or show the whole user agent field? Thanks |
Hi, I wanted to follow up on this ticket. Are there any local logs I can check? We have a detection that this technique should trigger. So it would be great if I could get this to work. Thanks |
Hello, I'm not sure why this fails in your account, to be frank! Can you share the IAM policy attached to the identity you're using to run Stratus Red Team? |
Hello, I have the same issue. The role is created correctly "stratus-red-team-get-usr-data-role". However, the role cannot be assumed by Stratus and in the CloudTrail logs you get "AccessDenied" on the AssumeRole events. I can assume the role manually with aws cli using the same IAM user that Stratus is using "aws sts assume-role --role-arn arn:aws:iam::123456789101:role/stratus-red-team-get-usr-data-role --role-session-name stratus --profile stratus" I am using an Intel Mac and used brew to install Stratus. |
Thanks for the detail, I was able to reproduce this. Will investigate ASAP |
Looks like this is due to the eventual consistency of AWS. When the role is created, it cannot be assumed right away |
Ok. Now that I understand the issue, I have a workaround for my tests. Up to now, I've scripted to trigger all the techniques using detonate without warmup. But now I've changed it to warm up first, wait n seconds, and then detonate. This approach solved the issue. Thanks for your help. |
Good to know! Are you able to give #358 a try to confirm it fixes the issue, even without waiting manually? |
I will assume that #358 fixes your issue - please let me know otherwise and I'll be happy to revisit |
What is not working?
Download EC2 Instance User Data technique does send userdata properly.
"requestParameters": {
"accountAttributeNameSet": {},
"filterSet": {}
},
What OS are you using?
Ubuntu
What is your Stratus Red Team version?
2.5.3
The text was updated successfully, but these errors were encountered: