分页: 1 / 1

[转] OpenBSD netcat demystified

发表于 : 2018-10-22 17:45
acheng
简单解释了OpenBSD上netcat的用法,更重要的是对源代码的解读。

https://github.com/NanXiao/openbsd-netcat-demystified
Owing to its versatile functionalities, netcat earns the reputation as "TCP/IP Swiss army knife". For example, you can create a simple chat app using netcat:

(1) Open a terminal and input following command:

# nc -l 3003
This means a netcat process will listen on 3003 port in this machine (the IP address of current machine is 192.168.35.176).

(2) Connect aforemontioned netcat process in another machine, and send a greeting:

# nc 192.168.35.176 3003
hello
Then in the first machine's terminal, you will see the "hello" text:

# nc -l 3003
hello