Get the password of the wifi you're on

wifi_password() {
    airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport"
    ssid="`$airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'`"
    pwd="`security find-generic-password -D 'AirPort network password' -ga \"$ssid\" 2>&1 >/dev/null`"
    echo $pwd
}


$ wifi_password

password: "!forHackers"


1.07 Thousand
Ali

Get our stories delivered

From us to your inbox weekly.