SSRF tới cloud

6 cards

Review this deck
All cards in this deck

Đích SSRF trên AWS

IMDS `169.254.169.254`; ECS task `169.254.170.2` + `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`; EKS Pod Identity `169.254.170.23`; Lambda: credential trong biến môi trường

IMDSv2 không bảo vệ

endpoint credential của ECS task, SSRF điều khiển được method và header, dịch vụ nội bộ khác

Cách vượt bộ lọc URL

IP viết dạng khác (thập phân, hex, IPv6 ánh xạ), DNS trỏ nội bộ, DNS rebinding, redirect, khác biệt parser

Fetch an toàn

chỉ https, phân giải rồi kiểm mọi IP, **ghim IP** khi kết nối (giữ SNI theo hostname), không tự theo redirect, giới hạn kích thước và thời gian

Phòng thủ nhiều lớp cho SSRF

egress proxy (Smokescreen), tách fetcher không IAM role, IMDSv2 hop limit 1, GuardDuty finding credential dùng ngoài AWS

Mặc định IMDSv2 cấp account

`aws ec2 modify-instance-metadata-defaults --http-tokens required --http-put-response-hop-limit 1`

SSRF tới cloud – Flashcards – AppSec AI | Học Dev