AWS - EMR Privesc
EMR
有关EMR的更多信息,请参阅:
AWS - EMR Enumiam:PassRole
,elasticmapreduce:RunJobFlow
iam:PassRole
,elasticmapreduce:RunJobFlow
拥有这些权限的攻击者可以运行一个新的EMR集群并附加EC2角色,尝试窃取其凭据。
请注意,为了做到这一点,您需要了解在帐户中导入的某个ssh私钥,或者导入一个,并且能够在主节点中打开端口22(您可以使用--ec2-attributes
中的EmrManagedMasterSecurityGroup
和/或ServiceAccessSecurityGroup
属性来实现这一点)。
注意在--service-role
中指定了EMR角色,在InstanceProfile
中的--ec2-attributes
中指定了ec2角色。然而,这种技术只允许窃取EC2角色凭证(因为您将通过ssh连接),而不是EMR IAM角色。
潜在影响: 提升至指定的EC2服务角色。
elasticmapreduce:CreateEditor
、iam:ListRoles
、elasticmapreduce:ListClusters
、iam:PassRole
、elasticmapreduce:DescribeEditor
、elasticmapreduce:OpenEditorInConsole
elasticmapreduce:CreateEditor
、iam:ListRoles
、elasticmapreduce:ListClusters
、iam:PassRole
、elasticmapreduce:DescribeEditor
、elasticmapreduce:OpenEditorInConsole
具有这些权限,攻击者可以进入AWS控制台,创建一个笔记本并访问它以窃取IAM角色。
即使您在笔记本实例中附加了IAM角色,在我的测试中我注意到我能够窃取AWS托管凭证,而不是与IAM角色相关的凭证。
潜在影响: 提升至AWS托管角色arn:aws:iam::420254708011:instance-profile/prod-EditorInstanceProfile
elasticmapreduce:OpenEditorInConsole
elasticmapreduce:OpenEditorInConsole
仅具有此权限,攻击者将能够访问Jupyter Notebook并窃取与其关联的IAM角色。
笔记本的URL为https://<notebook-id>.emrnotebooks-prod.eu-west-1.amazonaws.com/<notebook-id>/lab/
即使您在笔记本实例中附加了IAM角色,在我的测试中我注意到我能够窃取AWS托管凭证,而不是与IAM角色相关的凭证。
潜在影响: 提升至AWS托管角色arn:aws:iam::420254708011:instance-profile/prod-EditorInstanceProfile
Last updated