learn more...We have to ensure the security of the gateway that separates our AP or bridge or wireless-connected VLAN from the wired side. Such gateways are nothing more (or less) than a flexible stateful or proxy firewall that treats the interface connected to the WLAN side as an interface connecting the LAN to an insecure public network. The only specific requirement for the gateway is a capability to forward VPN traffic if VPN is implemented on the WLAN. Alternatively, the gateway can be a VPN concentrator if you want to cut spending on network security (usually not a good idea). If the VPN lies on the transport layer (e.g., cIPe), forwarding the traffic is straightforward: Open the ports used by the VPN protocol and let it go. Forwarding IPSec traffic is trickier. You have to allow protocols 50 or 51 through as well as have the UDP 500 port open for the IKE exchange. An example from the Linux Netfilter script allowing IPSec traffic through is shown here: iptables -A INPUT -i $EXT -p 50 -j ACCEPT iptables -A INPUT -i $EXT -p 51 -j ACCEPT iptables -A INPUT -i $EXT -p udp --sport 500 --dport 500 -j ACCEPT A good idea is to set static ARP table entries for all access points and critical servers connected to the gateway. Place the following lines into your /etc/rc.local if applicable: arp -s arp -s .............................................. arp -s arp -s arp -s You can also use the gateway as a DHCP server. Edit the /etc/dhcpcd.conf file to contain something like this: # dhcpd.conf # # Configuration file for ISC dhcpd (see 'man dhcpd.conf') # deny unknown-clients; one-lease-per-client true; authoritative; default-lease-time 604800; max-lease-time 604800; option subnet-mask 255.255.255.192; option domain-name "domain.name"; subnet 192.168.1.0 netmask 255.255.255.192 {
option broadcast-address 192.168.1.63; option routers 192.168.1.2; option domain-name-servers 192.168.1.2, 192.168.1.3; option smtp-server 192.168.1.2; option pop-server 192.168.1.2; option netbios-name-servers 192.168.1.3; #Sales Department laptops host toad1 { hardware ethernet
host toad2 { hardware ethernet
host toad3 { hardware ethernet
host toad4 { hardware ethernet
#Accounting Department laptops host gebril1 { hardware ethernet
"gebril1"; } host gebril2 { hardware ethernet
"gebril2"; } #Brokering Department laptops host tsetse1 { hardware ethernet
"tsetse1"; } host tsetse2 { hardware ethernet
"tsetse2"; } host tsetse3 { hardware ethernet
"tsetse"; } In this example the IP addresses are assigned on the MAC address basis so that the attacker will have to spoof the MAC address of a legal host to obtain an IP address from the DHCP server. This might confuse a low-level attacker for a while: The server is there, DHCP traffic is flowing, but no IP address is assigned.
You can even plug more PCI or PCMCIA cards into a custom-built universal wireless gateway and run them using the same HostAP driver to provide access on three different channels for round-robin load balancing using Netfilter. Alternatively, one of the plugged cards can be put into the monitoring mode and used to run a network monitoring or IDS tool. auto wlan0 iface wlan0 inet static address 0.0.0.0 up /sbin/iwconfig wlan0 essid Arh0nt-X /sbin/iwconfig wlan0 channel 11 /sbin/iwconfig wlan0 mode Master auto eth0 iface eth0 inet static address 0.0.0.0 auto br0 iface br0 inet static address 192.168.1.1 network 192.168.1.0 netmask 255.255.255.0 broadcast 192.168.1.255 bridge_ports wlan0 eth0 up Because it's Linux, there are always multiple ways to do it (e.g., see Bruce Potter's and Bob Fleck's "802.11 Security" for a different approach). Pick the one you like the most. iwpriv wlan0 maccmd 0: open policy for ACL (default) 1: allow policy for ACL 2: deny policy for ACL 3: flush MAC access control list 4: kick all authenticated stations iwpriv wlan0 addmac add mac addr into access control list iwpriv wlan0 delmac remove mac addr from access control list iwpriv wlan0 kickmac kick authenticated station from AP To create an ACL use iwpriv wlan0 maccmd $IPTABLES -N macfilter $IPTABLES -A macfilter -i $WLAN_INTERFACE -m mac -mac-source de:ad:be:ef:co:de -j ACCEPT $IPTABLES -A macfilter -i ! $WLAN_INTERFACE -j ACCEPT $IPTABLES -A macfilter -j LOG $IPTABLES -A macfilter -j DROP $IPTABLES -A FORWARD -j macfilter However, we recommend HostAP filtering: It's very straightforward to use and you can kick out suspicious authenticated hosts with ease. arhontus:# ./prism2_srec Usage: prism2_srec [-vvrfd] Options: -v verbose (add another for more verbosity) -r download SREC file into RAM (volatile) -f download SREC file into flash (non-volatile) -d dump SREC image into prism2_srec.dump -i ignore incompatible interfaces errors Warning! This can result in failed upgrade!
The -r and -f options cannot be used together. If -r or -f is not specified, image summary is shown and compatibility with the WLAN card is verified without downloading anything. prism2_srec -f wlan0 /path/to/firmware/ and check if the update is successful with prism2_diag wlan0. arhontus:/#prism2_param wlan0 ieee_802_1x 1 arhontus:/#hostapd -x -o AP-auth.serv.> wlan0 The authenticator in hostapd can automatically select a random default and broadcast WEP key shared by all authenticated stations. The selection is done with -b5 (64-bit WEP) or -b13 (128-bit WEP) flags passed to hostapd. In addition, the -i5 or -i13 option can be used to set individual unicast keys for stations. This demands individual key support in the station driver. Set the individual keys using the hostap_crypt_conf utility: arhontus:# ./hostap_crypt_conf Usage: hostap_crypt_conf [-123456789tpl] Options: -1 .. -9 key index (for WEP); only one index per command -t set TX key index (given with -1 .. -9) -p permanent station configuration (do not expire data) -l list configured keys (do not use addr or alg) device wlan# addr station hwaddr or ff:ff:ff:ff:ff:ff for default/broadcast key alg crypt algorithm (WEP, NULL, none) key key data (in hex, e.g. '0011223344', or s:string) Algorithms: WEP 40 or 104 bit WEP NULL NULL encryption (i.e., do not encrypt/decrypt); used to configure no encryption for given station when using default encryption none disable encryption Although you can also set HostAP client WEP keys using iwconfig, you won't be able to configure the individual keys for hostapd unicast key support using this command.
For the truly paranoid, there is always LIDS and security-enchanced Linux distributions such as National Security Agency (NSA) SELinux or Immunix. A properly configured and looked-after Linux machine is as secure as can be; do not blame the system when the real flaw is the system administrator's laziness and ignorance. |
||||||
Disclaimer
1) E-articles is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us to investigate the problem.
2) E-articles is not responsible for inaccuracies, falsehoods, or any other types of misinformation this article may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. link to this article |