Skip to content

Instantly share code, notes, and snippets.

@cordx56
Created November 21, 2018 12:07
Show Gist options
  • Save cordx56/606d02baa49f28c60917444a8798983e to your computer and use it in GitHub Desktop.
Save cordx56/606d02baa49f28c60917444a8798983e to your computer and use it in GitHub Desktop.
wpa_supplicant.conf generator for WPA2-PEAP
#!/bin/bash
echo -n "input SSID: "
read wpassid
echo -n "input user: "
read wpauser
echo -n "input password: "
read wpapsw
wpapsw=`echo -n "$wpapsw" | iconv -t utf16le | openssl md4 -binary | xxd -p`
cat << EOF > wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=JP
network={
ssid="$wpassid"
scan_ssid=1
key_mgmt=WPA-EAP
eap=PEAP
identity="$wpauser"
password=hash:$wpapsw
phase1="peaplabel=0"
phase2="auth=MSCHAPV2"
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment