Skip to content

Instantly share code, notes, and snippets.

@staylorx
Created July 15, 2016 21:15
Show Gist options
  • Save staylorx/a0cfab7f679a8178cefdf45fcc8b3556 to your computer and use it in GitHub Desktop.
Save staylorx/a0cfab7f679a8178cefdf45fcc8b3556 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ $# -eq 0 ]]; then
echo "Usage: tslooper.sh hostinput.txt"
exit 1
else
HOSTS="$1"
fi
rm -rf target
mkdir -p target
for LINE in $(cat $HOSTS)
do
echo "Working line $LINE"
#look for the host and default to 443 if a port is missing
HOST=$(echo "$LINE" | cut -d: -f1)
PORT=$(echo "$LINE" | cut -d: -f2); if [[ "$PORT" == "$HOST" ]]; then PORT="443"; fi
SERVER="$HOST:$PORT"
timeout 20 testssl/testssl.sh --quiet $SERVER | aha > target/$SERVER.html
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment