id: aws-bucket-takeover info: name: AWS Bucket Takeover Detection author: pdteam,pwnhxl,zy9ard3 severity: high description: AWS Bucket takeover was detected. reference: - https://github.com/EdOverflow/can-i-take-over-xyz/issues/36 metadata: max-request: 1 tags: takeover,aws,bucket http: - method: GET path: - "{{BaseURL}}" matchers-condition: and matchers: - type: dsl dsl: - Host != ip - type: word words: - "The specified bucket does not exist" - "BucketName" condition: and - type: dsl dsl: - contains(tolower(header), 'x-guploader-uploadid') - contains(tolower(header), "aliyunoss") negative: true - type: word part: host words: - "amazonaws.com" - "ks3.ksyun.com" - "kss.ksyun.com" - "kss3.ksyun.com" - "ks3-cn-beijing.ksyun.com" - "ks3-cn-guangzhou.ksyun.com" - "ks3-cn-hk-1.ksyun.com" - "ks3-cn-shanghai.ksyun.com" - "ks3-jr-beijing.ksyun.com" - "ks3-jr-shanghai.ksyun.com" - "ks3-rus.ksyun.com" - "ks3-sgp.ksyun.com" - "obs.jrzq.huaweicloud.com" - "obs.petalpay.huaweicloud.com" - "oss-cn-hangzhou.aliyuncs.com" - "oss-cn-shanghai.aliyuncs.com" - "oss-cn-qingdao.aliyuncs.com" - "oss-cn-beijing.aliyuncs.com" - "oss-cn-zhangjiakou.aliyuncs.com" - "oss-cn-huhehaote.aliyuncs.com" - "oss-cn-shenzhen.aliyuncs.com" - "oss-cn-hongkong.aliyuncs.com" - "oss-us-west-1.aliyuncs.com" - "oss-us-east-1.aliyuncs.com" - "oss-ap-southeast-1.aliyuncs.com" - "oss-ap-southeast-2.aliyuncs.com" - "oss-ap-southeast-3.aliyuncs.com" - "oss-ap-southeast-5.aliyuncs.com" - "oss-ap-south-1.aliyuncs.com" - "oss-ap-northeast-1.aliyuncs.com" - "oss-eu-central-1.aliyuncs.com" - "oss-me-east-1.aliyuncs.com" negative: true extractors: - type: regex part: body group: 1 regex: - '
  • BucketName: (.*?)
  • ' - '(.*?)' # digest: 4a0a00473045022100a1bf43094a8a2ebf252d9ff331d334da4732cc4973121200c8d1a1faad8c0d0002201952b9324faa832fbed0e7662d820c1e56ea3f0820a3a67bc11da01926bba9b0:922c64590222798bb761d5b6d8e72950