我有个这样的测试:
我的子民:
操作系统:debian 8
A:172.20.0.1 (gateway suricata v3.2 )
B:172.20.0.2 (App Server)
C:172.20.0.3 (Client)我的网络:
client(C) ----> gateway suricata A (ids) -----> AppServer B我的suricata构建信息:
wget https://github.com/inliniac/suricata/archive/suricata-3.2.zip
unar suricata-3.2.zip
cd suricata-3.2
git clone https://github.com/OISF/libhtp.git
./configure --enable-nfqueue --enable-pfring --enable-hiredis --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make
make install
make install-conf
make install-rules并且只加载一个测试规则:
alert http any any -> any any (msg:"http test"; content:"GET";) #no.1
alert tcp any any -> any any (msg:"tcp test"; content:"GET";) #no.2
alert tcp any any -> any any (msg:"tcp http test"; content:"GET";http_method;) #no.3答:172.20.0.1(网关suricata) OS信息:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -F
iptables -F
iptables -A FORWARD -j ACCEPT客户端发送请求为
'http://172.20.0.2/test'跟踪fast.log。只有2号规则匹配
我试着用iptable打开nat,比如:
iptables -t nat -A POSTROUTING -j MASQUERADE这一次,第一#第2##第3规则匹配
但是,nat被打开了,应用服务器没有得到正确的客户端ip。
地址。
现在,我希望使用7层协议--一些参数,比如http_uri、http_method等等。nat必须关闭。
我想要正确的方式~~~谢谢!
发布于 2016-12-13 10:04:20
我想出了一个办法:
iptables -A INPUT -i eth0 -p tcp -m tcp --sport 80 -j TEE --gateway 172.20.8.147
iptables -A OUTPUT -o eth0 -p tcp -m tcp --dport 80 -j TEE --gateway 172.20.8.147纳特太糟了,
主题结束
https://stackoverflow.com/questions/41054736
复制相似问题