微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用socat将流量转储到pcap

如何解决使用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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。