Thursday, January 22, 2015

How to secure your home WiFi

These days most people have a home wifi network, yet it's my experience that very few people (even technically minded people) know how to properly and completely secure their wifi network.  So here is my guide to securing your home wifi network.

First, I'll briefly cover why you should secure your home wifi.  There are multiple reasons, all of which revolve around protecting you and your privacy.
  1. Keep others (like your neighbors) from freeloading off your Internet which you pay for.
  2. Keep the data on your network from prying eyes.  Even if an attacker doesn't use your network to access the Internet they can still monitor your network in hopes of grabbing things like credit card numbers.
  3. Protects you from possible lawsuit.  Suppose someone uses your wifi and downloads illegal material.  Since they did it using your network you could be held liable for their actions, even though you didn't know it was happening.
  4. Keeps you safer from viruses, malware, trojans, etc.  Suppose your neighbor is stealing your wifi and they get a virus - since they're on your network now you're more vulnerable to getting infected.

So here are my top 17 recommendations of things to do to protect yourself and securing your wifi network.  Since every router is different I can't tell you exactly how to implement the following, you'll need to research your specific model.
  1. Buy your own wifi router.  Many times the ISP (e.g. ATT, Charter, or Comcast) will give customers a free wifi router.  These are almost garbage and should not be used.  First off their router is likely to have security holes in it, and the manufacturer is not likely to publish an updated firmware fixing the problem.  Also, some ISPs have a feature whereby they turn your home wifi router into a "wifi hotspot" for anyone else who's a customer.  So other people might be sharing your connection with your ISPs permission, and there's nothing you can do to disable it (yes it's an isolated network so in theory they can't access your files, but it still uses your bandwidth and electricity).  So I recommend ditching their free wifi router and buying your own.  If their wifi router is integrated with the modem (a.k.a. a gateway) then look in the settings for a way to disable the wifi access point and add your own router.
  2. Update the firmware of your router.  Good router manufactures release updated firmwares from time to time that add new features and (most importantly) fix security issues.  So check for an update and install it if available.
  3. When buying a router, use a well-known and trusted manufacturer.  If a manufacturer makes a lot of routers, chances are they have worked out the security flaws in the operating system of the router whereas that no-name manufacturer may have lots of issues.  Probably the biggest router manufacturers are Asus, Belkin, Cisco, D-Link, Linksys, and Netgear.  Of these, I personally prefer Netgear, Asus, and D-Link.
  4. Enable the strongest wifi security available to you.  WEP is awful, don't use it.  WPA is good, but WPS2 is better.  TKIP is okay, but AES is stronger.
  5. Disable WPS (Wi-Fi Protected Setup).  This feature (which might go by other names) is a convenience feature where you press a button on the outside of your router then you can connect a device without having to input your wifi password.  It can be convenient, but there is a well-known security flaw in the design that allows an attacker to gain access to your network in a few short hours.  So disable it!
  6. Disable access levels and points you're not using.  If all your devices are 5GHz then disable the 2.4GHz band. If all your devices are wireless-N, then disable wireless-A/B/G.  The idea is to minimize the ways in which someone could try and access your network.
  7. Disable remote administration.  Most routers allow you to remotely login to them via the Internet.  Chances are you don't need this feature, so disable it.
  8. Consider disabling wifi administration.  Most routers allow you to enable/disable the ability to login to and mange the router from a wireless device.  Assuming you have at least one wired computer connected to the router, then disable this feature.  Anytime you need to manage your router, do it from a wired connection.  In the event someone hacks into your network, this at least keeps them from gaining access to the router itself.
  9. Enable HTTPS login for the router management and disable HTTP.  Many routers allow you to login to the router management via HTTP and/or HTTPS.  Don't use unsecure HTTP and always use HTTPS (the S stands for Secure - literally!).
  10. Check port forwarding and DMZ, and disable unless necessary.  All routers offer features like port forwarding and DMZs.  Close any you're not using as each of these is one more security risk.
  11. Use firewalls on all computers and devices within your network.  This helps protect your computers in the event your network is compromised.
  12. Use long complex passwords everywhere.  This includes your router login, the wifi network password, and the DSL login (where applicable).  The longer the better, the more random the better.  Use a password generator if necessary.  The password "myDSLaccount" is easy to crack whereas "zcXZadF0SmIZCspqw9vG9CUf1aj6NYOa" is hard to crack.
  13. Change passwords from time to time.  Maybe once a month.  If someone hacks in, if you change the password you'll lock them back out.
  14. Record all MAC addresses for the hardware you own.  Any good router will show you the devices connected to it, but most of the time it's just a MAC address (10:23:E3:F6:03:1A).  Unless you've taken the time to figure out all your devices and their MAC address(es) then you won't know if someone else is on your network.
  15. Do not use hidden SSIDs.  This used to be a recommended security practice.  But this does nothing good, and in fact has negative side-effects.  Any would-be hacker will be using tools that shows him all wifi networks, regardless of hidden SSIDs or not.  So don't fool yourself into thinking you're safe.  But they've also shown that hidden SSIDs also reduce the battery life of your portable devices because the device is constantly having to verify the hidden network is in fact the one it thinks it is.
  16. Don't put personal info into the SSID.  Don't have an SSID of "StephensWiFi" or "375PalmAve."  SSIDs like this compromise your personal info and/or give away your location.  If someone wants to hack into your network, don't make it easier for them.
  17. If you have friends and family visiting, enable the guest SSID(s), use a strong password, and give them access to the guest account.  This keeps them off your main secure network.  If you're not expecting friends or family, then disable the guest SSID.  Again, expose as few of avenues of attack to hackers as you can.

With security there is always a trade-off.  One the one hand there is convenience, on the other is security.  Rarely do they overlap, which means if you want your home network to be more secure, ultimately it will be less convenient for you as the user.  But once you accept this fact you can secure your network and enjoy piece of mind.

Homemade Yagi antenna - design and model


In addition to the Gray-Hoverman antenna I designed and built, I wanted to construct a single-channel Yagi antenna to try and receive channel 19 - the one weak signal in my area.  As with the Gray-Hoverman design I used 4nec2 to design and model the antenna.


Here's the actual NEC file.  Feel free to download, use, modify, etc.  If you're interested in building this model, I suggest using this file and 4nec2 to get the exact dimensions of each element.

CM D--EVAL --num-cores=2 --uhf
CE
SY RAD=0.003175
SY FRAD=0.00215
SY DIPOLE_WIDTH=0.3
SY DIPOLE_HEIGHT=0.039
SY DIPOLE_A=DIPOLE_HEIGHT/3.41421356
SY DIPOLE_Z=DIPOLE_HEIGHT/2
SY DIPOLE_CENTER=0.013
SY REF_Y=0.296
SY REF_X=0.14
SY EL1_Y=0.261
SY EL1_X=0.07
SY EL2_Y_DIFF=0.008
SY EL2_X_DIFF=0.151
SY EL2_Y=EL1_Y-EL2_Y_DIFF
SY EL2_X=EL1_X+EL2_X_DIFF
SY EL3_Y_DIFF=0.008
SY EL3_X_DIFF=0.2
SY EL3_Y=EL2_Y-EL3_Y_DIFF
SY EL3_X=EL2_X+EL3_X_DIFF
SY EL4_Y_DIFF=0.002
SY EL4_X_DIFF=0.214
SY EL4_Y=EL3_Y-EL4_Y_DIFF
SY EL4_X=EL3_X+EL4_X_DIFF
SY EL5_Y_DIFF=0.013
SY EL5_X_DIFF=0.2
SY EL5_Y=EL4_Y-EL5_Y_DIFF
SY EL5_X=EL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POLE_A+DIPOLE_Z RAD
GW 10 1 0 DIPOLE_WIDTH/2+DIPOLE_A -DIPOLE_HEIGHT/2+DIPOLE_A+DIPOLE_Z 0 DIPOLE_WIDTH/2+DIPOLE_A DIPOLE_HEIGHT/2-DIPOLE_A+DIPOLE_Z RAD
GW 11 9 -REF_X -REF_Y/2 0 -REF_X REF_Y/2 0 RAD
GW 12 9 EL1_X -EL1_Y/2 0 EL1_X EL1_Y/2 0 RAD
GW 13 9 EL2_X -EL2_Y/2 0 EL2_X EL2_Y/2 0 RAD
GW 14 8 EL3_X -EL3_Y/2 0 EL3_X EL3_Y/2 0 RAD
GW 15 8 EL4_X -EL4_Y/2 0 EL4_X EL4_Y/2 0 RAD
GW 16 7 EL5_X -EL5_Y/2 0 EL5_X EL5_Y/2 0 RAD
GE    0
LD    5    0    0    0    COND
GN    -1
EK
EX 0 1 1 0 1 0 0
FR    0    7    0    0    500    1
RP    0    1    73    1510    90    0    1    5    0    0
EN


The big question is - after construction, how did it perform?  I compared the antenna to a Channel Master 4-bay antenna (CM4221), which is kind of an unfair comparison since the Channel Master is a wide-band antenna whereas the yagi is designed for one frequency.  Anyway, I mounted each antenna in the same location and used my TV to scan for all channels.  For each digital channel I wrote down the average signal strength.  My TV reports two signal numbers, the overall signal level in percentage, and the signal-to-noise ratio in decibels.  For both numbers, higher is better.

Channel CM4221 Yagi (ch. 19)
15 98% (32db) 98% (31db)
16 89% (26db) 89% (27db)
19 56% (15db) 62% (20db)
24 95% (29db) 98% (30db)
31 84% (25db) 76% (22db)
34 89% (27db) 78% (23db)
41 87% (26db) 87% (26db)
50 98% (32db) 62% (17db)

As you can see, at the design frequency (ch. 19) the yagi outperforms the Channel Master.  For the most part, all other channels the Channel Master outperformed the yagi (as expected).  I was surprised to see channels 16 and 24 where better than the Channel Master, probably because those channels aren't far off of the designed channel.

Even with the antenna specifically designed for one channel, I was disappointed with the results.  62% is very low, I expected at least 80.  But I think the main problem was the mounting location which was 1 foot away from and behind my house from the broadcast antenna.  I could move the antenna and try again, but it's actually moot.  In the few weeks it took me to design, build, and test this antenna, channel 19 installed a low power digital repeater closer to my house.  So I no longer need this dedicated yagi antenna.  I guess you could say it was obsolete before it was completed.  Oh well, good thing it was relatively inexpensive to construct.  I estimate the cost of materials at $20.


Here is a youtube video I uploaded showing design and construction of the antenna.


Here are download links useful to antenna modeling:
4nec2 - http://www.qsl.net/4nec2/
nikiml's python scripts - http://clients.teksavvy.com/~nickm/scripts.html
Optimized versions of the NEC2 engine - http://users.otenet.gr/~jmsp/

Homemade Gray-Hoverman antenna - design and model


I recently designed and built a homemade antenna for TV reception.  The design is called a Gray-Hoverman.  The idea behind this antenna is to replace my existing Channel Master 4-bay antenna (CM4221).  There is nothing wrong with the Channel Master antenna, mainly I'm just curious if I can construct a better antenna.  That's the type of nerd I am. :)

To design the antenna I used a free piece of software called 4nec2, which allows you to design and model (or predict) how the antenna will perform.  I also used some python scripts to optimize the design.  I'll include links to all the software below.  I'm not going to go into the details on antenna modelling and the use of 4nec2 as it's a very complicated subject that took me a while to learn.

The Gray-Hoverman design I came up with is optimized for my specific area.  The TV channels in my area that I care about are 15, 16, 19, 24, and 31.  So my design is optimized just for this range.

Here's the actual NEC file.  Feel free to download, use, modify, etc.  If you're interested in building this model, I suggest using this file and 4nec2 to get the exact dimensions of each element.
CM D--EVAL --num-cores=2 --uhf
CE
SY GAP=0.086
SY RAD=0.003175
SY FRAD=0.00229
SY SRAD=0.00635
SY SX=0.121
SY SY=0.642
SY SZ=0.054
SY COND=2.0e7
SY L=.1629
SY W=0.109
GW    1    1    0    -GAP/2    0    0    GAP/2    0    FRAD
GW    2    11    0    GAP/2    0    0    GAP/2+L    L    RAD
GW    3    11    0    GAP/2+L    L    0    GAP/2    2*L    RAD
GW    4    11    0    GAP/2    2*L    0    GAP/2+L    3*L    RAD
GW    5    4    0    GAP/2+L    3*L    0    GAP/2+L+W    3*L    RAD
GW    6    11    0    GAP/2    0    0    GAP/2+L    -L    RAD
GW    7    11    0    GAP/2+L    -L    0    GAP/2    -2*L    RAD
GW    8    11    0    GAP/2    -2*L    0    GAP/2+L    -3*L    RAD
GW    9    4    0    GAP/2+L    -3*L    0    GAP/2+L+W    -3*L    RAD
GW    10    11    0    -GAP/2    0    0    -GAP/2-L    L    RAD
GW    11    11    0    -GAP/2-L    L    0    -GAP/2    2*L    RAD
GW    12    11    0    -GAP/2    2*L    0    -GAP/2-L    3*L    RAD
GW    13    4    0    -GAP/2-L    3*L    0    -GAP/2-L-W    3*L    RAD
GW    14    11    0    -GAP/2    0    0    -GAP/2-L    -L    RAD
GW    15    11    0    -GAP/2-L    -L    0    -GAP/2    -2*L    RAD
GW    16    11    0    -GAP/2    -2*L    0    -GAP/2-L    -3*L    RAD
GW    17    4    0    -GAP/2-L    -3*L    0    -GAP/2-L-W    -3*L    RAD
GW    18    30    -SX    -SY/2    SZ    -SX    SY/2    SZ    SRAD
GW    19    30    -SX    -SY/2    SZ*3    -SX    SY/2    SZ*3    SRAD
GW    20    30    -SX    -SY/2    SZ*5    -SX    SY/2    SZ*5    SRAD
GW    21    30    -SX    -SY/2    SZ*7    -SX    SY/2    SZ*7    SRAD
GW    22    30    -SX    -SY/2    -SZ    -SX    SY/2    -SZ    SRAD
GW    23    30    -SX    -SY/2    -SZ*3    -SX    SY/2    -SZ*3    SRAD
GW    24    30    -SX    -SY/2    -SZ*5    -SX    SY/2    -SZ*5    SRAD
GW    25    30    -SX    -SY/2    -SZ*7    -SX    SY/2    -SZ*7    SRAD
GE    0
LD    5    0    0    0    COND
GN    -1
EK
EX    0    1    1    0    1    0    0
FR    0    17    0    0    476    6
RP    0    1    73    1510    90    0    1    5    0    0
EN


The big question is - after construction, how did it perform compared to the Channel Master antenna?  I mounted each antenna in the same location and used my TV to scan for all channels.  For each digital channel (including those beyond what I care about) I wrote down the average signal strength.  My TV reports two signal numbers, the overall signal level in percentage, and the signal-to-noise ratio in decibels.  For both numbers, higher is better.

Channel CM4221 Gray-Hoverman
15 98% (32db) 98% (33db)
16 89% (26db) 89% (27db)
19 56% (15db) 43% (12db)
24 95% (29db) 98% (30db)
31 84% (25db) 84% (25db)
34 89% (27db) 92% (28db)
41 87% (26db) 89% (27db)
50 98% (32db) 98% (30db)

As you can see, the Gray-Homerman antenna matched or exceeded the Channel Master for almost all channels, even some beyond what the antenna was designed for.  Only at channel 50 was the Channel Master better.  [I'm ignoring channel 19 because that channel is weak and anything below 60% and my TV cannot lock onto the signal.]

Here is a youtube video I uploaded showing design and construction of the antenna.


Here are download links useful to antenna modeling:
4nec2 - http://www.qsl.net/4nec2/
nikiml's python scripts - http://clients.teksavvy.com/~nickm/scripts.html
Optimized versions of the NEC2 engine - http://users.otenet.gr/~jmsp/