Skip to content

Instantly share code, notes, and snippets.

View Djey1301's full-sized avatar

Jerome A. Djey1301

  • NoWhere
View GitHub Profile
@Djey1301
Djey1301 / scan.awk
Created September 29, 2016 12:53 — forked from elecnix/scan.awk
Parse iw scan output
# iw wlan0 scan | sed -e 's#(on wlan# (on wlan#g' | awk -f scan.awk
#BEGIN {
# printf("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s\n","MAC","SSID","freq","signal","sig%","WPA","WPA2","WEP","TKIP","CCMP");
#}
NF > 0{
if ($1 == "BSS") {
if( $2 ~ /^[a-z0-9:]{17}$/ ) {
if( e["MAC"] ){
printf("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s\n",e["MAC"],e["SSID"],e["freq"],e["sig"],e["sig%"],e["WPA"],e["WPA2"],e["WEP"],e["TKIP"],e["CCMP"]);
}