display('Number of rows: {}'.format(len(df)))
display('Unique SSIDs: {}'.format(len(df['SSID'].unique())))
display('Unique MACs: {}'.format(len(df['MAC'].unique())))
display('Number of Auth Mode types: {}'.format(len(df['AuthMode'].unique())))

def auth_filter(x):
    if 'WPA2' in x:
        return 'WPA2'
    elif 'WPA' in x:
        return 'WPA'
    elif 'WEP' in x:
        return 'WEP'
    else:
        return 'OPEN'

df['AuthMode'].apply(auth_filter).value_counts().plot(kind='barh')

"""
Explanation: Now we have the data loaded nicely into a Pandas dataframe and we can look at some of the basics of the data.
End of explanation
"""


def wps(x):
    if 'WPS' in x:
        return 'WPS'
    else:
        return 'Not WPS'
df['AuthMode'].apply(wps).value_counts().plot(kind='barh')

"""
Explanation: So there are a significant number of open networks, but the overall majority use WPA2. That's good for the University but not so great for attackers. Of course, there could be a way around that via WPS. How many networks use that?
End of explanation
"""


s = df['AuthMode'].apply(wps)
wps_entries = df.ix[s[s == 'WPS'].index]
wps_entries.head()

"""
Explanation: Over 500 networks use WPS! Using a tool like Reaver an attacker could easily breach those networks.
This is just some basic insights into the data. We could look further into the different forms of WPA/WPA2 authentication, but for an attacker these insights are enough. Using the above function for extracting WPS networks, an attacker could determine the locations of those networks and mount an attack on each of them.
End of explanation
"""


