Re: 14 octet MACs and security

From: Bill Davidsen (davidsen_at_deathstar.prodigy.com)
Date: 08/10/05

  • Next message: Ian: "Re: pppd sends LCP ConfReq then gives up"
    Date: Wed, 10 Aug 2005 18:28:51 GMT
    
    

    Luigi wrote:
    > Hello all -
    >
    > I gave up on WEP for my home wireless network a long time ago.
    > Instead, I have my gentoo router implement some strict policies on
    > which hosts can access the network, on both the wired and unwired
    > network.

    Maybe you should un-giveup on WEP and see if you can let the router
    reject some things for you without crapping up your system...
    >
    > One of my lines of defense is a mac address filter in my iptables
    > NAT-ing firewall.
    >
    > #####
    >
    > iptables -t mangle -N maccheck
    >
    > # if a request comes in from eth0, check its MAC by jumping to the
    > maccheck table
    > iptables -t mangle -I PREROUTING -i eth0 -p tcp -j maccheck
    >
    > # create the maccheck table of allowed MACs
    > allowed_mac="iptables -t mangle -A maccheck -m mac -j RETURN
    > --mac-source "
    >
    > # if any of these match the current MAC, we return from this table
    > without
    > # doing anything
    >
    > $allowed_mac 00:12:12:12:12:12
    > $allowed_mac 00:ab:ab:ab:ab:ab
    >
    > # otherwise, give any disallowed MAC address the mark 1 and log it
    > iptables -t mangle -A maccheck -j MARK --set-mark 1 2>1 >> /dev/null
    > iptables -t mangle -A maccheck -j LOG --log-prefix="set mark 1: " 2>1
    >
    >>>/dev/null
    >
    > #"
    > iptables -t mangle -A maccheck -j RETURN >> /dev/null
    >
    > # force marked requests to the local webserver's
    > # port 81 no matter what their intended destination, and deny all other
    > tcp
    > # requests

    Sure looks like you will never get a hit on port 81, given that you
    unconditionally REJECT the packet first. Am I misreading something?
    >
    > iptables -t nat -A PREROUTING -m mark --mark 1 -p tcp -j REJECT
    > iptables -t nat -A PREROUTING -m mark --mark 1 -p tcp
    > --destination-port 80 -j DNAT --to-destination=10.0.0.1:81
    >
    >
    > ################
    >
    > Lately my clients have had trouble with an inability to renew their IPs
    > (though getting the ip in the first place is fine). After checking
    > dhcpd (it was fine), I started poking through logs, and found what
    > looks like a network flood due to denied requests.
    >
    > from the output of dmesg:

    May I suggest that use of log-level will let you put all the iptables
    messages in a different and better place?
    >
    > set mark 1: IN=eth0 OUT= MAC=00:05:5d:81:04:46:00:02:2d:ba:96:98:08:00
    > SRC=10.0.0.245 DST=192.168.0.107 LEN=48 TOS=0x00 PREC=0x00 TTL=128
    > ID=10480 DF PROTO=TCP SPT=1760 DPT=9100 WINDOW=16384 RES=0x00 SYN
    > URGP=0
    >
    > This is repeated many many times. I suspect it's one of my neighbors
    > accidentally hopping onto my LAN via WiFi. Poor sucker gets an
    > unprivelaged IP, and tries to access something that's local to his
    > network, but which is obviously out of his subnet. Then he hammers it
    > (and therefore, me) to death.

    Don't bet on accidentally, and wouldn't using WEP prevent this?
    >
    > I'm happy my filter is working so well, but this brings up a few
    > questions for me.
    >
    > 1) What's with his MAC adddress?
    > 00:05:5d:81:04:46:00:02:2d:ba:96:98:08:00 is 14 octets... I have no
    > idea what that means. I recognize the first 6 as belonging to my
    > firewall's internal adapter, but what's up with the next 8?

    You know how IPv6 is longer than IPv4? Don't you know about MACv6? Okay,
    I'm kidding, I actually have no idea what's up. Does any of that look
    like part of one of your MAC addresses? I'm thinking someone trying to
    spoof your MAC address and botching the job.
    >
    > 2) Could this flood of unauthorized conn attempts be what's keeping my
    > clients from refreshing their dhcp?

    Anything is possible, my guess is no.
    >
    > 3) Unfortunately, just because I deny him access to anything doesn't
    > mean that he isn't using my resources! If this is indeed what is
    > causing a problem, what can I do to stop it? My wifi points don't have
    > MAC filtering, and denying him DHCP entirely doesn't get rid of his
    > connection attempts, either.
    >
    > Any thoughts?

    - move your log files
    - try to block the packets before they get into you network at all
       using WEP or whatever.
    - MAC authentication isn't very strong
    - unless you have a boatload of system which change often, ditch
       DHCP and use fixed IP addresses.

    >
    > Thanks!

    Always glad to criticise ;-)

    -- 
    bill davidsen
       SBC/Prodigy Yorktown Heights NY data center
       http://newsgroups.news.prodigy.com
    

  • Next message: Ian: "Re: pppd sends LCP ConfReq then gives up"

    Relevant Pages

    • Re: Preventing DHCP from allocating IPs
      ... Each segment is physically separate with a Linux ... unknown MAC addresses firstly don't get a DHCP ... >> wants access to your network, they will have to come to you to obtain ...
      (Security-Basics)
    • Re: Secure your DHCP
      ... I can only think of allocating via dhcp reservation using network card ... Create an exclusion of your whole DHCP scope (So no IP's are free to be ... assign each mac address an Ip address from what was in your pool. ...
      (microsoft.public.windows.server.sbs)
    • RE: DHCP
      ... Asunto: Re: DHCP ... I am looking for a way to block any PC that plugs into my network ... Windows Server 2008 can do this, but I'm not sure about 2003. ... MAC, this server will send IP address and parameters for configure the ...
      (Security-Basics)
    • TidBITS#794/29-Aug-05
      ... This week's issue brings a potpourri of Mac news, ... Mark Anbinder looks briefly at Google Talk, ... Adding Tiger's AirPort Preferred Network List ...
      (comp.sys.mac.digest)
    • Re: dial-up to ethernet
      ... >255.255.255.0 (Mac agrees), network is ... >Especially about DHCP? ... then restart networking ("/etc/init.d/networking restart", ...
      (Debian-User)