Description Inspecting network traffic is an essential part of troubleshooting network deployments. fw monitor
is a powerful built-in tool to simplify the task of capturing network packets at multiple capture points within the firewall chain. These packets can be inspected using industry-standard tools later on.
In many deployment and support scenarios capturing network packets is an essential functionality. tcpdump
or snoop
are tools normally used for this task. fw monitor
provides an even better functionality but omits many requirements and risks of these tools.
tcpdump
and snoop
are normally used with network interface cards in promiscuous mode. Unfortunately the promiscuous mode allows remote attacks against these tools. fw monitor
does not use the promiscuous mode to capture packets. In addition most firewall operating systems are hardened. In most cases this hardening includes the removal of tools like tcpdump
or snoop
because of their security risk.fw monitor
is a built-in firewall tool which needs no separate installation in case capturing packets is needed. It is a functionality provided with the installation of the Firewall package.fw monitor
allows you to capture packets at multiple capture positions within the firewall kernel module chain; both for inbound and outbound packets. This enables you to trace a packet through the different functionalities of the Firewall.fw monitor
on different platforms. Tools like snoop or tcpdump are often platform dependent or have specific "enhancements" on certain platforms. fw monitor
and all its related functionality and syntax is absolutely identical across all platforms. There is no need to learn any new "tricks" on an unknown platform.Normally the Check Point kernel modules are used to perform several functions on packets (like filtering, encrypting and decrypting, QoS …). fw monitor
adds its own modules to capture packets. Therefore fw monitor can capture all packets which are seen and/or forwarded by the Firewall.
See SecureKnowledge solution sk30583.
Only one instance of fw monitor
can be run at a time.
Use ^C
(that is Control + C) to stop fw monitor from capturing packets.
Syntax
> fw monitor [-u|s] [-i] [-d] [-D] [{-e <expr>|{-f <filter-file>|-}}] [-l <len>] [-m <mask>]
[-x <offset>[,<len>]] [-o <file>] [[-pi <pos>] [-pI <pos>] [-po <pos>] [-pO <pos>] | -p all]] [-a]
[-ci <count>] [-co <count>] [-h] -T
Parameter |
Description |
---|---|
|
Printing the UUID or the SUUID: The option |
|
Flushing the standard output: Use to make sure that captured data for each packet is at once written to standard output. This is especially useful if you want to kill a running fw monitor process and want to be sure that all data is written to a file. |
|
Debugging fw monitor: The |
|
Filtering fw monitor packets:
|
|
Limiting the packet length: |
|
Setting capture masks: By default |
|
Printing packet/payload data: In addition to the IP and Transport header |
|
Write output to file: Save the raw packet data to a file in a standard (RFC 1761) format. The file can be examined using by tools like snoop, tcpdump or Ethereal. Note - The snoop file format is normally used to store Layer 2 frames. For "normal" capture files this means that the frame includes data like a source and a destination MAC address. |
|
Print time stamp in microseconds. |
|
Insert fw monitor chain module at a specific position: In addition to capture masks (which give the ability to look at packets in a specific position) |
|
Use absolute chain positions: If you use |
|
Capture a specific number of packets: |
|
Displays the usage. |
Example The easiest way to use fw monitor
is to invoke it without any parameter. This will output every packet from every interface that passes (or at least reaches) the Check Point Security Gateway. The same packet appears several times (two times in the example below). This is caused by fw monitor
capturing the packets at different capture points.
Output
cpmodule> fw monitor monitor: getting filter (from command line) monitor: compiling monitorfilter: Compiled OK. monitor: loading monitor: monitoring (control-C to stop) eth0:i[285]: 192.0.2.133 -> 192.0.2.2 (TCP) len=285 id=1075 TCP: 1050 -> 18190 ...PA. seq=bf8bc98e ack=941b05bc eth0:I[285]: 192.0.2.133 -> 192.0.2.2 (TCP) len=285 id=1075 TCP: 1050 -> 18190 ...PA. seq=bf8bc98e ack=941b05bc eth0:o[197]: 192.0.2.2 -> 192.0.2.133 (TCP) len=197 id=44599 TCP: 18190 -> 1050 ...PA. seq=941b05bc ack=bf8bca83 eth0:O[197]: 192.0.2.2 -> 192.0.2.133 (TCP) len=197 id=44599 TCP: 18190 -> 1050 ...PA. seq=941b05bc ack=bf8bca83 eth0:o[1500]: 192.0.2.2 -> 192.0.2.133 (TCP) len=1500 id=44600 TCP ^C : 18190 -> 1050 ....A. seq=941b0659 ack=bf8bca83 monitor: caught sig 2 monitor: unloading |
The first line of the fw monitor
output is
|
This packet was captured on the first network interface (eth0
) in inbound direction before the virtual machine (lowercase i). The packet length is 285 bytes (in square parenthesis; repeated at the end of the line. Note that these two values may be different. The packets ID is 1075. The packet was sent from 192.0.2.133 to 192.0.2.2 and carries a TCP header/payload.
The second line of the fw monitor
output is
|
The second line tells us that this is a TCP payload inside the IP packet which was sent from port 1050 to port 18190. The following element displays the TCP flags set (in this case PUSH and ACK). The last two elements are showing the sequence number (seq=bf8bc98e) of the TCP packet and the acknowledged sequence number (ack=941b05bc). You will see similar information for UDP packets.
You will only see a second line if the transport protocol used is known to fw monitor. Known protocols are for example TCP, UDP and ICMP. If the transport protocol is unknown or cannot be analyzed because it is encrypted (e.g. ESP or encapsulated (e.g. GRE) the second line is missing.
Description Use these expressions to help when you are filtering fw monitor
.
Syntax > fw monitor -e "accept <expression>;"
Expressions for Protocols
Expression |
Description |
---|---|
|
TCP |
|
UDP |
|
ICMP v4 |
|
ICMP v6 |
|
ESP |
Expressions for Services
Expression |
Description |
---|---|
|
HTTP (TCP port 80) |
|
HTTPS (TCP port 443) |
|
FTP (TCP port 20 or 21) |
|
SSH (TCP port 22) |
|
TELNET (TCP port 23) |
|
SMTP (TCP Port 25) |
|
POP3 (TCP port 110) |
|
DNS (TCP / UDP port 53 |
|
HTTP (TCP port 8080) |
Expressions for VPN
For more information, see sk52421.
Expression |
Description |
Check Point Description |
---|---|---|
|
IKE (UDP port 500) |
|
|
NAT-T (UDP port 4500) |
|
|
UDP encapsulation (UDP port 2746) |
Check Point SecuRemote IPsec Transport Encapsulation Protocol |
|
Check Point RDP (UDP port 259) |
Proprietary Check Point "Reliable Data Protocol" (does not comply with RDP as specified in RFC 908/RFC 1151) |
|
Check Point Security Gateway SecuRemote Topology Requests (TCP port 264) |
Topology Download from Security Gateway (by FWD daemon) to SecuRemote (build 4100 and higher) and SecureClient |
|
L2TP (TCP port 1701) |
|
|
Check Point Tunnel Testing (UDP port 18234) |
Check Point tunnel testing application - Testing ICA through VPN by SecuRemote / SecureClient |
Expressions for ICA (Internal Certificate Authority)
For more information, see sk52421.
Expression |
Description |
Check Point Description |
---|---|---|
|
Check Point Internal CA Pull Certificate Service (TCP port 18210) |
Pulling certificates by Security Gateway from Security Management Server (by CPCA daemon) |
|
Check Point Internal CA Push Certificate Service (TCP port 18211) |
Pushing certificates from the Internal Certificate Authority (ICA) on Security Management Server (by CPD daemon) to Security Gateway |
|
Check Point Internal CA Fetch CRL and User Registration Services (TCP port 18264) |
Protocol for Certificate Revocation Lists and registering users when using the Policy Server (needed when, e.g., Security Gateway is starting). See sk35292. |
|
Check Point Internal CA Management Tools (TCP port 18265) |
|
Expressions for Security Management Server
Expression |
Description |
---|---|
|
Port 18190 (SmartConsole) |
|
Port 18191 (Install policy) |
|
Port 18192 (AMON server) |
|
Port 18231 |
|
Port 18233 (Client SCV) |
Expressions for Common Tasks
Expression |
Description |
---|---|
|
Uses these expressions: |
|
Uses these expressions: |
|
Uses these expressions: |
|
Uses expressions for standard site to site: |
|
Uses expressions for remote access: |
|
Uses expressions for multi-portal: |
|
Uses expressions for all VPN services: |
|
Uses expressions for VPN and common test services: |
Expressions to Exclude Background Traffic
Expression |
Description |
---|---|
|
Uses expressions to exclude remote terminal: |
|
Uses expressions to exclude Check Point management services: |
Example: > fwmonitor -e "accept https;"