Last active
August 25, 2022 12:11
-
-
Save Twibow/8507d9337af630dec1fde4054102911a to your computer and use it in GitHub Desktop.
SSL Pin calculator with Bash (SSL Pinning)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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