News for hackers. Stuff that matters.
Re:IP traffic over ICMP tunneling by txutxu on Wednesday November 11, 2015 @11:37AM (#10547481)
I use to restrict ICMP to echo/reply using -m icmp on iptables, but this uses just that kind of packets...

Is there anyway to stop things like this at the corporate firewall?

Re:IP traffic over ICMP tunneling by omh on Wednesday November 11, 2015 @11:46AM (#10547543)
High end firewalls will monitor ICMP and can restrict the size of the payload. They'd probably also notice the large number of ICMP packets.

Big corporate places can completely restrict things and prevent any traffic from internal hosts to the internet. You can use proxying for web browsing etc. and then monitor that to check for any unauthorised traffic.

Re:IP traffic over ICMP tunneling by scurvy on Wednesday November 11, 2015 @12:16PM (#10547712)
Out of curiosity, why would you drop echo requests or replies? I know the normal thought is "So no one will know if the IP is in use or not," but that argument doesn't hold water. Scanning toolkits have been fast enough for the past decade to skip ICMP altogether. They know you're home even with ICMP blocked.

Edited for spelling

Re:IP traffic over ICMP tunneling by burkaman on Wednesday November 11, 2015 @02:34PM (#10548688)
They said they only allow echo and reply, not drop them.
Re:IP traffic over ICMP tunneling by scurvy on Thursday November 12, 2015 @11:52AM (#10554297)
That's even worse. PMTU detection is OK but not perfect. Fragmentation needed but DF bit set ICMP messages are important.
Re:IP traffic over ICMP tunneling by angersock on Wednesday November 11, 2015 @12:29PM (#10547794)
Re:IP traffic over ICMP tunneling by vampire_dk on Wednesday November 11, 2015 @11:40AM (#10547498)
Yes. In my opinion they should restrict the payload size of an ICMP message. Blocking all echo/reply can have adverse impact on other applications as well.
Re:IP traffic over ICMP tunneling by txutxu on Wednesday November 11, 2015 @11:51AM (#10547574)
OK, I see "length" extension in man iptables-extensions (Debian 8), so for example, to drop pings with a packet size greater than 85 bytes:

    # iptables -A FORWARD -p icmp --icmp-type echo-request -m length --length 86:0xffff -j DROP
Still, until someone checks the code of this tool, or a working test environment, we won't know if the rule stops this tool.

Update: as for the number of packets, there is -m limit and other recipes.

Re:IP traffic over ICMP tunneling by ryan-c on Wednesday November 11, 2015 @11:57AM (#10547603)
If you're going to do that, set the maximum length to 128 bytes. Different ping tools use different sized payloads - I know of some common ones that generate packets by default that would be blocked with that limit.

Also, instead of using the plain limit match, check out hashlimit. It can apply a rate limit on a per sender, destination, or sender+destination basis. The recent match may also be of interest.

Re:IP traffic over ICMP tunneling by jacquesm on Wednesday November 11, 2015 @11:47AM (#10547549)
A couple of million small packets in a short timeframe will still eat up your resources. If an application needs ICMP echo to pass transparently through your firewall then you should probably review your need for that application, you're one step away from becoming a partner in someone else's amplification attack.
Re:IP traffic over ICMP tunneling by toast0 on Wednesday November 11, 2015 @12:35PM (#10547830)
ICMP echo isn't amplification, as long as you don't respond to multicast/broadcast addresses. It's still 1:1 reflection, so you probably want to rate limit if it's simple (FreeBSD and Linux come out of the box with sane default rate limits).
Re:IP traffic over ICMP tunneling by jacquesm on Wednesday November 11, 2015 @12:50PM (#10547958)
It is amplification if you allow the packets through transparently because all the hosts behind your firewall will respond if you send an echo request to the broadcast address.

So you're going to have to do a little bit more configuration than just allow a maximum packet size if you're going to allow ICMP to transit at all you should also limit the allowed set of addresses (you should do that regardless, but echo can be used for amplification requests by virtue of the broadcast feature of the IP protocol). Hence the 'one step away'.

This was known as the 'smurf' attack. Fortunately this is now mostly a thing of the past. But poking holes in your firewall for ICMP is a delicate affair.

Re:IP traffic over ICMP tunneling by toast0 on Wednesday November 11, 2015 @01:09PM (#10548102)
Sorry, I had lost the context that it was a network firewall (not a host firewall), and missed the 'one step away' as well.
Re:IP traffic over ICMP tunneling by jacquesm on Wednesday November 11, 2015 @01:43PM (#10548356)
Ah ok. It was only a one line context switch so that was an easy mistake to make.