Skip to content

Instantly share code, notes, and snippets.

Avatar

Jerome A. Djey1301

  • NoWhere
View GitHub Profile
@Djey1301
Djey1301 / scan.awk
Created Sep 29, 2016 — forked from elecnix/scan.awk
Parse iw scan output
View scan.awk
# 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"]);
}
You can’t perform that action at this time.