Skip to content

Instantly share code, notes, and snippets.

@arall
Created November 13, 2018 07:44
Show Gist options
  • Save arall/b2e353e22a7865fa65fd4b0bf95e6b60 to your computer and use it in GitHub Desktop.
Save arall/b2e353e22a7865fa65fd4b0bf95e6b60 to your computer and use it in GitHub Desktop.
Checks Missing Security Headers
#!/bin/bash
headers=$(curl -s -I -L "https://"$1)
echo "$headers"
declare -a checks=(
'Strict-Transport-Security'
'X-Frame-Options'
'X-XSS-Protection'
'X-Content-Type-Options'
'Access-Control-Allow-Origin'
'Referrer-Policy'
'HTTPOnly'
'secure'
'SameSite'
)
for i in "${checks[@]}"
do
if ! echo $headers | grep -iqF $i; then
echo $i
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment