Project

General

Profile

Actions

Bug #13652

closed

Inconsistent behavior filtering ICMP traffic

Added by Serge Caron about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Rules / NAT
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Default
Affected Version:
2.6.x
Affected Architecture:

Description

I have the following FLOATING rules to filter out unwanted ICMP traffic on the network (these are repeated for all interfaces in the firewall but only the WAN, em1.66, is shown here):

block drop quick on em1.66 inet proto icmp all icmp-type timereq label "USER_RULE: Discard any and all ICMP Timestamp requests" ridentifier 1667827889
block drop quick on em1.66 inet proto icmp all icmp-type maskreq label "USER_RULE: Discard any and all ICMP Address mask requests" ridentifier 1667828285

block drop out log on em1.66 inet proto icmp all icmp-type timerep label "USER_RULE: Discard any and all ICMP Outgoing Timestamp replies" ridentifier 1667764490
block drop out log on em1.66 inet proto icmp all icmp-type maskrep label "USER_RULE: Discard any and all ICMP Outgoing Address mask re..." ridentifier 1667828326

Under unknown conditions, ICMP TimeStamp requests are allowed on the network and pfSense replies. This behavior does not occur for Address Mask requests.

I can reproduce this issue using the Qualys scanners over a set of consecutive IP addresses. I have placed a network TAP (Dualcomm ETAP-PI) in front of the ISP router and the relevant capture is attached. The pfSense host is labelled pfSenseWAN and handles two virtual IPs labeled pfSenseVirt and pfSenseVirtHost.

All Address mask requests from the Qulays scanner are dropped:

157 204.410768675  QualysScanner         pfSenseWANVirt        ICMP     60     Address mask request id=0x118f, seq=26729/26984, ttl=245
158 204.414693012 QualysScanner pfSenseWAN ICMP 60 Address mask request id=0x1192, seq=30825/27000, ttl=245
159 204.524882130 QualysScanner pfSenseVirtHost ICMP 60 Address mask request id=0x1195, seq=18537/26952, ttl=245

These are repeated twice in the attached capture (between sequence number 160 to 179)

However, TimeStamp requests are honored by the pfSense firewall itself:

138 202.411235592  QualysScanner         pfSenseWANVirt        ICMP     60     Timestamp request    id=0x118f, seq=26729/26984, ttl=245
139 202.411318979 pfSenseWANVirt QualysScanner ICMP 60 Timestamp reply id=0x118f, seq=26729/26984, ttl=64
140 202.414854325 QualysScanner pfSenseWAN ICMP 60 Timestamp request id=0x1192, seq=30825/27000, ttl=245
141 202.414940916 pfSenseWAN QualysScanner ICMP 60 Timestamp reply id=0x1192, seq=30825/27000, ttl=64

ICMP traffic that is NATed to an internal host is properly discarded (the second virtual IP is NATed to this host via simple NAT rules in this setup):

146 202.524821388  QualysScanner         pfSenseVirtHost       ICMP     60     Timestamp request    id=0x1195, seq=18537/26952, ttl=245
[...]
162 210.524959887 QualysScanner pfSenseVirtHost ICMP 60 Timestamp request id=0x1195, seq=18537/26952, ttl=245
[...]
176 218.525489225 QualysScanner pfSenseVirtHost ICMP 60 Timestamp request id=0x1195, seq=18537/26952, ttl=245

Clearly, this behavior is inconsistent.

Even stranger, the inbound rules work as expected when the Qualys scanner or any other utility, such as hping3 or nmap, is used to target each host one at a time.

Also. when I disable the timereq/maskreq rules, I do not see the outgoing replies blocked in the pfSense Firewall log. My understanding is that this is the expected behavior from the above rules.

NOTE: I moved these rules to FLOATING because the behavior was the same when they were in the WAN ruleset.


Files

ICMP (No details).txt (13.4 KB) ICMP (No details).txt WireShark capture Serge Caron, 11/11/2022 10:40 AM
packet_capture_just_icmp_packets.pcap (4.54 KB) packet_capture_just_icmp_packets.pcap Infra Weavers, 01/20/2023 05:51 AM
config-TESTpfSense.home.arpa-20230124161406.xml (16.9 KB) config-TESTpfSense.home.arpa-20230124161406.xml Infra Weavers, 01/24/2023 10:14 AM
Scan_Profile.html (13.1 KB) Scan_Profile.html Infra Weavers, 01/24/2023 10:18 AM
Scan_2023-01-24_16-19-36.pcap (2.02 MB) Scan_2023-01-24_16-19-36.pcap Infra Weavers, 01/24/2023 10:19 AM
config-testpfsense.home.arpa-20230125115540.xml (12.7 KB) config-testpfsense.home.arpa-20230125115540.xml Infra Weavers, 01/25/2023 06:03 AM
PF_2.7.0_2023-01-25_11-56-46.pcap (2.08 MB) PF_2.7.0_2023-01-25_11-56-46.pcap Infra Weavers, 01/25/2023 06:03 AM
Option Profile Information.html (20.7 KB) Option Profile Information.html Qualys Profile Infra Weavers, 01/25/2023 09:34 AM
packetcapture_25_01_2023_15_43.pcap (358 KB) packetcapture_25_01_2023_15_43.pcap Infra Weavers, 01/25/2023 09:44 AM

Related issues

Related to Bug #13918: ICMP timestamp requests are passed by states created from ICMP echo requests if they use the same IDNewReid Linnemann

Actions
Actions

Also available in: Atom PDF