使用socat将流量转储到pcap

问题描述

大家好,这是我关于stackoverflow的第一个问题!

我正在使用this软件(这是一种NIDS);其功能之一是使用socat创建可将流量保存到pcap的代理。

这是它用来执行此操作的命令:/usr/bin/socat -d OPENSSL-LISTEN:50010,cipher=HIGH,method=TLS1.2,reuseaddr,pf=ip4,fk,cert=/usr/local/owlh/src/owlhnode/conf/certs/ca.pem,verify=0 SYstem:"/usr/sbin/tcpdump -n -r - -s 0 -G 50 -W 100 -w /usr/local/owlh/pcaps/remote-test%d%m%Y%H%M%s.pcap not port 22"

当我使用curl尝试通过代理向Google发出请求时,就会发生这种情况:

╭─myasnik@tanuki ~/…/ossihr-poc/docker ‹master*›
╰─$ export https_proxy=https://0.0.0.0:50010/
╭─myasnik@tanuki ~/…/ossihr-poc/docker ‹master*›
╰─$ export http_proxy=https://0.0.0.0:50010/
╭─myasnik@tanuki ~/…/ossihr-poc/docker ‹master*›
╰─$ curl --proxy-insecure www.google.it
curl: (52) Empty reply from server
root@owlh-node:/# /usr/bin/socat -d OPENSSL-LISTEN:50010,verify=0 SYstem:"/usr/sbin/tcpdump -n -r - -s 0 -G 50 -W 100 -w /usr/local/owlh/pcaps/remote-test%d%m%Y%H%M%s.pcap not port 22"
tcpdump: unkNown file format
2020/08/18 12:00:08 socat[1590] W system("/usr/sbin/tcpdump -n -r - -s 0 -G 50 -W 100 -w /usr/local/owlh/pcaps/remote-test%d%m%Y%H%M%s.pcap not port 22") returned with status 256
2020/08/18 12:00:08 socat[1590] W system(): No such file or directory
2020/08/18 12:00:08 socat[1589] E waitpid(): child 1590 exited with status 1

非常感谢您的帮助!

解决方法

这是问题的答案,我想我误解了应该做的方式:https://github.com/OwlH-net/OwlH-Node/issues/47