Skip to content

Instantly share code, notes, and snippets.

@Twibow
Last active August 25, 2022 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Twibow/8507d9337af630dec1fde4054102911a to your computer and use it in GitHub Desktop.
Save Twibow/8507d9337af630dec1fde4054102911a to your computer and use it in GitHub Desktop.
SSL Pin calculator with Bash (SSL Pinning)
#!/usr/bin/env bash
echo -e "+ SSL-PIN hash-key calculator +"
read -p "+ Domaine : " -r url
echo -e "\n+ Récupération de la clé publique & calcul de la hash-key :\n\n"
# Connexion à l'hôte et récupération de la clé publique
pubkey=$(echo | openssl s_client -servername $url -connect $url:443 | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64)
echo -e "\n\n+ Hash-key du domaine $url : $pubkey \n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment