Re: icmp redirect at layer 3

Alberto Ornaghi <[email protected]> Thu, 13 May 2004 09:52:00 +0200
Newsgroups gmane.comp.security.libnet
Message-ID <[email protected]>
Frédéric Raynal wrote:
> 
> batman# route del default
> batman# netstat -nr
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags   MSS Window irtt Iface
> 192.168.0.0     0.0.0.0         255.255.255.0   U         0 0      0    eth0
> batman# # ./icmp_redirect_raw4 -g 3.3.3.3 -s 2.2.2.2 -d 1.1.1.1
> libnet 1.1 packet shaping: ICMP redirect[raw4]
> Write error: libnet_write_raw_ipv4(): -1 bytes written (Network is unreachable)

ok. I can confirm that:

Kernel IP routing table
Destination     Gateway     Genmask         Flags Metric Ref Use Iface
169.254.0.0     0.0.0.0     255.255.0.0     U     0      0    0  eth0

./icmp_redirect_raw -s 1.1.1.1 -d 2.2.2.2 -g 3.3.3.3
libnet 1.1 packet shaping: ICMP redirect[raw4]
Write error: libnet_write_raw_ipv4(): -1 bytes written (Network is 
unreachable)


> batman# ./icmp_redirect_raw4 -g 3.3.3.3 -s 2.2.2.2 -d 192.168.0.42
> libnet 1.1 packet shaping: ICMP redirect[raw4]
> Wrote 56 byte ICMP packet; check the wire.
> 
> Fine, the kernel found a route for our packet :)

no way here...

./icmp_redirect_raw -g 3.3.3.3 -s 1.1.1.1 -d 169.254.1.1
libnet 1.1 packet shaping: ICMP redirect[raw4]
Write error: libnet_write_raw_ipv4(): -1 bytes written (Operation not 
permitted)

and those are my netfilter rules:

iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination



> PS: special UNgreetz to Alberto for that interesting question: I'm
> late now on other stuffs

ehehhe, I will investigate it by myself, many thanks for your time.
btw I've CC'd Angelo, he is a TCP/IP kernel hacker, I hope he will throw 
some light on it...

bye

-- 

    --==> ALoR <==---------------------- -  -   -

  There are only 10 types of people in this world...
  Those who understand binary, and those who don't.