Listen on a network port and save data to a text f

2019-03-08 06:56发布

Is there some easy way in linux to listen for data on network and save them to a text file?

Thank you.

3条回答
Viruses.
2楼-- · 2019-03-08 07:33

Other tools are Ethereal (man page) or Wireshark and it's console variant tshark.

In any case please be aware that you are following local and company rules.

查看更多
Ridiculous、
3楼-- · 2019-03-08 07:48

Netcat is your friend here.

nc -l localhost 10000 > log.txt

Netcat will listen for a connection on port 10000, redirect anything received to log.txt.

查看更多
叼着烟拽天下
4楼-- · 2019-03-08 07:59

Also available is TCPDump.

sudo tcpdump -i eth0 -vvvvtttAXns 1500 'port 10000'
查看更多
登录 后发表回答