将原始数据发送到 TCP 服务器的 Linux 工具
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3010507/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Linux tool to send raw data to a TCP server
提问by paul simmons
I am aware that this is not a direct 'development' question but I need this info to test a development project, so I think someone could've hit similar problem.
我知道这不是一个直接的“开发”问题,但我需要这些信息来测试一个开发项目,所以我认为有人可能会遇到类似的问题。
I will test a software that runs a TCP server and according to sent commands replies some answers. I will test the software and do not want to write code if it doesn't work well. So I want to send those commands and test drive the server software.
我将测试一个运行 TCP 服务器的软件,并根据发送的命令回复一些答案。我会测试软件,如果它不能很好地工作,我不想写代码。所以我想发送这些命令并测试驱动服务器软件。
How can I achieve this with a Linux box?
如何使用 Linux 机器实现这一目标?
采纳答案by luke
回答by Brian Agnew
回答by Dummy00001
From bash with dd:
从 bash 使用 dd:
dd if=/dev/zero bs=9000 count=1000 > /dev/tcp/$target_host/$port
or even with cat:
甚至与猫:
cat < /dev/urandom > /dev/tcp/$target_host/$port