Collection of templates for use with aws-execute
| enum | ||
| README.md | ||
Bash script exerpts for aws-execute
This repo contains script excertps that can be passed directly to aws-execute.
These script excerpts are basically full bash scripts without a #!/bin/bash header.
You can template variables or locations in the script with the golang templating engine which
allows you to pass various EC2 info from aws into a bash script that can be used to perform
complex tasks and automation. See the aws-execute repo for what EC2 variables are exposed.
An example usage for these scripts would be
aws-execute -r us-east-1 -c "$(cat templated-bash-script-here)"
Why would you want this?
If you would like to organize nmap scans by AWS Instance ID instead of IP Address, you could use this example to store san results in a dynamically created directory for each instance;
## DEPENDS: grepcidr nmap
SCOPE="10.0.0.0/16 10.1.0.0/16 10.2.0.0/16 10.3.0.0/16"
target="{{.PrivateIpAddress}}"
name="{{.InstanceId}}"
## Test for scope
grepcidr "$SCOPE" <(echo "$target")
if [[ $? -ne 0 ]]; then
exit 0
fi
## Full port scan
mkdir -p $name
cd $name
nmap -Pn -p- -T3 -sC -sV -oA $name-script-version-all-ports "$target"