Soo, now we know how to build an access point in software, maybe we should have a look at how to secure Wifi at home.
This is a beginners article, it's not about company class wifi networks, they are another beast.

So, let's get to it :)

First, what is a network card, what kind of addresses do they have ?
There are two kind of addresses, namely the IP, and the MAC. Lets have a look at a typical output from a network card, here it's a Linux machine.

ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.113  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::cac7:2c2e:bc6c:d063  prefixlen 64  scopeid 0x20<link>
        ether 6c:3b:e5:1a:8f:fb  txqueuelen 1000  (Ethernet)
        

Note there is an address called "inet", that's the IP address. And the one called "ether", is the MAC address. Here it's an IPV4 type.

What do they tell us, what role do they play on the network itself ? The IP is the machines network address, typically it's also what firewalls allow or deny, and the way machines find each other.
But, what is that "ether" thing ? A MAC address is the physical network cards address. Machines find each other, and keep track on IP adresses based on MAC. Normally thet would keep something called an APR table in memory, linking MAC to IP. So, if we were to engage MAC locks in a network, that is to say, that only certain MAC addresses are allowed, and that certain MAC addresses should have a static IP, and we set up firewall rules, is'nt that secure enough ?

No... :)

If we can see what MAC addresses are allowed, we could set our own to something like it, and bypass MAC allowed / deny listings.

Typically we could use something like the Aircrack-NG suite of wifi tools, to look for probes, and se what MAC they are coming from, to what BSSID, thus gathering intelligence on possible Base Staton ID, and client MAC addresses. But, we would need to set out own MAC, how do we do that. Let's have a look something called macchanger.

root@xeon:~# macchanger --help
GNU MAC Changer
Usage: macchanger [options] device

  -h,  --help                   Print this help
  -V,  --version                Print version and exit
  -s,  --show                   Print the MAC address and exit
  -e,  --ending                 Don't change the vendor bytes
  -a,  --another                Set random vendor MAC of the same kind
  -A                            Set random vendor MAC of any kind
  -p,  --permanent              Reset to original, permanent hardware MAC
  -r,  --random                 Set fully random MAC
  -l,  --list[=keyword]         Print known vendors
  -b,  --bia                    Pretend to be a burned-in-address
  -m,  --mac=XX:XX:XX:XX:XX:XX
       --mac XX:XX:XX:XX:XX:XX  Set the MAC XX:XX:XX:XX:XX:XX

Report bugs to https://github.com/alobbs/macchanger/issues

Please note the -e -m switches :)

root@xeon:~# macchanger -e eth0
Current MAC:   6c:3b:e5:1a:8f:fb (Hewlett Packard)
Permanent MAC: 6c:3b:e5:1a:8f:fb (Hewlett Packard)
New MAC:       6c:3b:e5:41:52:8f (Hewlett Packard)
root@xeon:~# 

The first three bytes, are vendor bytes, telling what the vendor is. Sometimes it's good to keep them, if we want to spoof the last, we use the -e switch, for getting a new, random MAC.

root@xeon:~# macchanger -m aa:aa:aa:bb:bb:bb eth0
Current MAC:   6c:3b:e5:41:52:8f (Hewlett Packard)
Permanent MAC: 6c:3b:e5:1a:8f:fb (Hewlett Packard)
New MAC:       aa:aa:aa:bb:bb:bb (unknown)
root@xeon:~# 

If we want to change it all, we use the -m switch.

So, is MAC allow / deny safe. No not really.

But, what about crypto, can't we secure the wifi network ?. Sure. Let's dive in, and see what options we got :)

1. Crypto function.
2. Access codes
3. Change SSID
4. MAC Allow / deny
5. Update firmware
6. Hide SSID

When it comes to crypto, there is a couple of options. Ranging from the old WEP, to WPA2-PSK, and beyond to WPA2 with RADIUS authentication for large networks, with a lot of Access Points.
WPA2 is the normal kind, and the one in use almost everywhere today (hopefully). WEP is flawed, and very easy to crack, so it should be avoided at all costs.
So now we know that for home use / small networks, WPA2 is the standard, lets talk about access codes.

A fairly safe code, is defined as.

1. Being at least eight characters long
2. A mix of capitalized and small letters
3. Have at least one number
4. Have at least one special character !"#¤%&/()=?, and the like.

So, if we make a passord, based on these rules, it is safe ?, No, it depends on a lof of things. For example, what if we took a password like lastname1980! , is it safe ?
No, not really. Don't base passwords on something that's easy to identify, based on eg Facebook, your website, your name, your spouses name, childrens, your pet dog / cat, and so on and so forth.
Why ?, because it's easy to run a password generator, or dictionary generator, and generate all the combinations, based on simple rules.

Lets, have some fun with a program called crunch.

crunch <min-len> <max-len> [<charset string>] [options]

OPTIONS :

-t @,%^
              Specifies  a pattern, eg: @@god@@@@ where the only the @'s, ,'s,
              %'s, and ^'s will change.
              @ will insert lower case characters
              , will insert upper case characters
              % will insert numbers
              ^ will insert symbols

So, lets generate out pretty lame password, lastname1099!. Lets assume the name is smith, and we know it is, because we found it on Facebook. We know that Smith is born somewhere around the 19xx, so can we make a crunch rule, that generates out password ?

crunch 10 10 smith%%%%^ >> wordlist.txt

 It will find the password, eventually. You can check that with grep

cat wordlist.txt | grep "smith1980!"

It should hit the correct password, so tagging a special character in the end, or at the beginning doesnt make your password safe :)
But, Now we know how to generate a custom wordlist, how do we actually use it. Go have some fun with Aircrack-ng, find out how to capture a handshake from wifi, and try to see if you can crack it :)
See the articles Basic WEP cracking and Basic WPA cracking for how to do that :)

A better, not ultimate safe password, would be something like this, generated with makepasswd in Linux.

root@xeon:~# makepasswd --minchars 8 --maxchars 8 --count 10
5QXDfEAW
5N4tK4Yu
69L5Pcyr
4rgz7qTp
GRNXaoiu
hPw8K0Ge
SbLTxUQT
PJI4DqHG
HRMQejJi
gWGPNwFP
root@xeon:~#

These are very hard to generate with crunch, as they are almost totally random. But, also totally impossible to remember. So, write them down, and keep it on a yellow post-it beside the computer :)

That kind of wraps it up for passwords. So, on to some notes on BSSID / Network name.

Most modems will have default settings, and that includes admin / password. So, if people can crack the key, or find a default key, I'm sorry, but it's not your network anymore. It belongs to the lameass hacker next door.
Change the default SSID, change default passwords, and update the firmware. Yes, I know you can hide SSID / Network name, but it really doesn't help all that much. BSSID broadcasts can be seen in the air, using wifi tools like Aircrack, and the like. And, we allready know that MAC Allow / deny doesn't really help either. So, long and wellthought passwords on the Wifi, is the only thing that will help.
There are ways around it, client side attack with rogue access points is a start. And some carefull use, and changing the password a couple of times a year, or when an attack have taken place.

The reeeally long way around would be to setup a RADIUS server, but that would be overkill for most use :)

So, time to give your wifi security an overhaul, and if you haven't done it, lock it down :)

You have no rights to post comments