You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Logical and Relational Opera<strong>to</strong>rs<br />
In addition <strong>to</strong> the single expressions testing for equality it is possible <strong>to</strong> combine different expressions<br />
using several logical and relational opera<strong>to</strong>rs<br />
< Less than<br />
> Greater than<br />
= Greater than or equal <strong>to</strong><br />
= or is Equal<br />
!= or is not Not equal<br />
Figure 42: <strong>fw</strong> moni<strong>to</strong>r – Relational Opera<strong>to</strong>rs<br />
, Logical AND<br />
or Logical Or<br />
xor Logical XOR<br />
not Logcial NOT<br />
Figure 43: <strong>fw</strong> moni<strong>to</strong>r – Logical Opera<strong>to</strong>rs<br />
! Please note that INSPECT <strong>use</strong>s another opera<strong>to</strong>r precedence than e.g. C. In INSPECT the<br />
expression “a , b or c” is unders<strong>to</strong>od as “a , ( b or c)”. That is, or takes precedence over<br />
, (and). Parentheses “(“ and “)” – can be <strong>use</strong>d <strong>to</strong> force opera<strong>to</strong>r precedence. There is no penalty<br />
for redundant parentheses..<br />
Using relational and logical opera<strong>to</strong>rs it is easily possible <strong>to</strong> build complex capture filters:<br />
Everything except http accept not ( [20:2,b]=80 or [22:2,b]=80);<br />
Every non-root TCP connection accept [9:1]=9 , th_sport > 1024;<br />
Every TCP packet between accept [9:1]=9 , (([12:4,b]=10.2.4.12 ,<br />
10.2.4.12 and 172.16.1.2 [16:4,b]=172.16.1.2) or ([12:4,b]=172.16.1.2 ,<br />
[16:4,b]=10.2.4.12));<br />
Figure 44: <strong>fw</strong> moni<strong>to</strong>r – example of logical and relational opera<strong>to</strong>rs<br />
! Even if <strong>fw</strong> moni<strong>to</strong>r filters allow you <strong>to</strong> specify complex filters it’s normally not advisable. In many<br />
cases a <strong>to</strong>o complex filter might not capture packets you are interested in. It’s normally better <strong>to</strong> just<br />
filter out bulk traffic you’re not interested in (e.g. HTTP) and do the granular filtering later on (e.g.<br />
using Ethereal on files generated with -o). An exception is using <strong>fw</strong> moni<strong>to</strong>r on high-loaded<br />
gateways. There you might have simply no choice but <strong>to</strong> reduce the amiunt of traffic being captured.<br />
<strong>How</strong> <strong>to</strong> <strong>use</strong> <strong>fw</strong> moni<strong>to</strong>r Page 35 of 70<br />
Revision: 1.01