nc,有很多系統的版本,freebsd也不例外,先運行看看 :-)
$nc
usage: nc [-46DEdhklnrStUuvz] [-e policy] [-i interval] [-p source_port]
[-s source_ip_address] [-w timeout] [-X proxy_version]
[-x proxy_address[:port]] [hostname] [port[s]]
$nc -h
usage: nc [-46DEdhklnrStUuvz] [-e policy] [-i interval] [-p source_port]
[-s source_ip_address] [-w timeout] [-X proxy_version]
[-x proxy_address[:port]] [hostname] [port[s]]
Command Summary:
-4 Use IPv4
-6 Use IPv6
-e policy Use specified IPsec policy
-E Use IPsec ESP
-D Enable the debug socket option
-d Detach from stdin
-h This help text
-i secs Delay interval for lines sent, ports scanned
-k Keep inbound sockets open for multiple connects
-l Listen mode, for inbound connects
-n Suppress name/port resolutions
-p port Specify local port for remote connects
-r Randomize remote ports
-S Enable the TCP MD5 signature option
-s addr Local source address
-t Answer TELNET negotiation
-U Use UNIX domain socket
-u UDP mode
-v Verbose
-w secs Timeout for connects and final net reads
-X proto Proxy protocol: "4", "5" (SOCKS) or "connect"
-x addr[:port] Specify proxy address and port
-z Zero-I/O mode [used for scanning]
Port numbers can be individual or ranges: lo-hi [inclusive]
See ipsec_set_policy(3) for -e argument format
暈倒,和以前用的不一樣了,好像功能更強大。。。。。
hoho,撿到寶了,找代碼看看先
$cd /usr/src/usr.bin/nc
只有個Makefile,我再找
$cd /usr/src/contrib/netcat
哈哈,找到了。
開linux,移植到linux中試試 :-)
去掉了一些功能以後,終於編譯過去了 :-)
1. TCP MD5 signature option
2. Randomize remote ports
在編譯時,需要加上 -DSO_REUSEPORT 才能編譯通過,奇怪.