Logical Operations(逻辑运算):
可能值:not, and, or.
否(“not”)具有最高的优先级。或(“or”)和与(“and”)具有相同的优先级,运算时从左至右进行。
“not tcp port 3128 and tcp port 23″与”(not tcp port 3128) and tcp port 23″等价。
“not tcp port 3128 and tcp port 23″与”not (tcp port 3128 and tcp port 23)”不等价。
五、常见使用的捕获过滤语句
1.1 只(不)捕获某主机的HTTP流量
host 192.168.5.231 and port 80 and http#只捕获主机192.168.5.231 的http流量。注意如果你的HTTP端口为8080,把80 改为8080。
port 80 and http#捕获所有经过该接口的http流量。注意如果你的HTTP端口为8080,把80 改为8080。
host 192.168.5.231 and not port 80# 捕获主机192.168.5.231除 http 之外的其他所有流量,注意如果你的HTTP端口为8080,把80 改为8080。
not port 80 # 捕获除 http 之外的其他所有流量,注意如果你的HTTP端口为8080,把80 改为8080。
not port 80 and !http## 捕获除 http 之外的其他所有流量,注意如果你的HTTP端口为8080,把80 改为8080。