now browsing by tag
Source: ISC Sans
There is an interesting way of knowing what kind of filters are placed in the gateway of a specific host. It is called firewalk and it is based on IP TTL expiration. The algorithm goes as follows:
- The entire route is determined using any of the traceroute techniques available
- A packet is sent with the TTL equal to the distance to the target
- If the packet times out, it is resent with the TTL equal to the distance to the target minus one.
- If an ICMP type 11 code 0 (Time-to-Live exceeded) is received, the packet was forwarded and so the port is not blocked.
- If no response is received, the port is blocked on the gateway.
Let’s see this with a real example. Consider the following network diagram:
Firewalking happens with the following steps:
- Traceroute packets are sent to determine the gateway with decremental TTL:
2. An ICMP Time Exceeded message is received from the default gateway for the TTL=2 and TTL=1 packet, which means there are two gateways between origin and destination and TTL=3 is the distance to the destination
3. Several packets are sent with TTL=3 to the destination varying the destination port. The sequence goes as follows: A first packet is sent with TTL=3. If a timeout occurs, a second packet is sent with TTL=1. If an ICMP type 11 code 0 (Time-to-live exceeded) is received, the gateway is forwarding the packet.
Let’s see the first packet to port 1 and TTL=3:
Timeout occurs, so same packet is sent with TTL=2:
ICMP type 11 code 0 is sent from the gateway routing the destination host, which means the packet was forwarded and the port is opened:
How can we use this technique? Nmap has a firewalk script that can be used. For this example, the following command should be issued:
nmap --script=firewalk --traceroute 172.16.2.165
Source: ISC Sans
When the corporate network becomes target, auditing for security policy compliance can be challenging if you don’t have a software controlling irregular usage of administrator privilege granted and being used to install unauthorized software or to change configuration by installing services that could cause an interruption in network service. Examples of this possible issues are additional DHCP Servers (IPv4 and IPv6), Dropbox, Spotify or ARP scanning devices.
We can use nmap to detect all protocols that sends broadcast packets and are supported by packetdecoders.lua:
- ARP requests (IPv4)
- CDP – Cisco Discovery Protocol
- EIGRP – Cisco Enhanced Interior Gateway Routing Protocol
- OSPF – Open Shortest Path First
- Logitech SqueezeBox Discovery
- Multicast DNS/Bonjour/ZeroConf
The following example shows how to use nmap with the broadcast listener script and we can see the result of a device with dropbox installed, a device sending ARP request (a router in this case) and a device sending DHCPv6 requests:
You can run this program periodically to track common security issues in your network, just in case your IPS could be missing something 😉