AWS - CloudFront Post Exploitation

Reading time: 3 minutes

tip

AWS 해킹 배우기 및 연습하기:HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기: HackTricks Training GCP Red Team Expert (GRTE) Azure 해킹 배우기 및 연습하기: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks 지원하기

CloudFront

자세한 정보는 다음을 확인하세요:

AWS - CloudFront Enum

cloudfront:Delete*

cloudfront:Delete* 권한이 부여된 attacker는 distributions, policies 및 기타 중요한 CDN 구성 객체 — 예를 들어 distributions, cache/origin policies, key groups, origin access identities, functions/configs 및 관련 리소스 — 를 삭제할 수 있습니다. 이는 서비스 중단, 콘텐츠 손실 및 구성이나 포렌식 아티팩트의 삭제를 초래할 수 있습니다.

To delete a distribution an attacker could use:

bash
aws cloudfront delete-distribution \
--id <DISTRIBUTION_ID> \
--if-match <ETAG>

Man-in-the-Middle

This blog post에서는 LambdaCloudFront를 통한 통신에 추가(또는 이미 사용 중이면 수정)하여 세션 cookie와 같은 사용자 정보를 stealing하고 응답(response)을 modifying(악성 JS 스크립트 주입)하는 목적의 몇 가지 시나리오를 제시합니다.

scenario 1: MitM where CloudFront is configured to access some HTML of a bucket

  • Create 악성 function.
  • Associate 그것을 CloudFront distribution에 연결합니다.
  • **event type to "Viewer Response"**로 설정합니다.

response에 접근하면 사용자 cookie를 탈취하고 악성 JS를 주입할 수 있습니다.

scenario 2: MitM where CloudFront is already using a lambda function

  • lambda function의 코드를 Modify the code하여 민감한 정보를 탈취합니다

You can check the tf code to recreate this scenarios here.

tip

AWS 해킹 배우기 및 연습하기:HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기: HackTricks Training GCP Red Team Expert (GRTE) Azure 해킹 배우기 및 연습하기: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks 지원하기