国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > Linux Shell > 正文

使用netcat(瑞士軍刀)進行文件傳輸

2020-07-27 19:03:06
字體:
來源:轉載
供稿:網友

nc(netcat)被譽為網絡工具中的“瑞士軍刀”,體積雖小但功能強大,nc最簡單的功能是端口掃描,這里我主要筆記一下它作為文件傳輸的妙用。

首先看一下幫助信息。

$ nc -hOpenBSD netcat (Debian patchlevel 1.105-7ubuntu1)This is nc from the netcat-openbsd package. An alternative nc is availablein the netcat-traditional package.usage: nc [-46bCDdhjklnrStUuvZz] [-I length] [-i interval] [-O length]   [-P proxy_username] [-p source_port] [-q seconds] [-s source]   [-T toskeyword] [-V rtable] [-w timeout] [-X proxy_protocol]   [-x proxy_address[:port]] [destination] [port]  Command Summary:    -4    Use IPv4    -6    Use IPv6    -b    Allow broadcast    -C    Send CRLF as line-ending    -D    Enable the debug socket option    -d    Detach from stdin    -h    This help text    -I length  TCP receive buffer length    -i secs    Delay interval for lines sent, ports scanned    -j    Use jumbo frame    -k    Keep inbound sockets open for multiple connects    -l    Listen mode, for inbound connects    -n    Suppress name/port resolutions    -O length  TCP send buffer length    -P proxyuser  Username for proxy authentication    -p port    Specify local port for remote connects      -q secs    quit after EOF on stdin and delay of secs    -r    Randomize remote ports    -S    Enable the TCP MD5 signature option    -s addr    Local source address    -T toskeyword  Set IP Type of Service    -t    Answer TELNET negotiation    -U    Use UNIX domain socket    -u    UDP mode    -V rtable  Specify alternate routing table    -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    DCCP mode    -z    Zero-I/O mode [used for scanning]  Port numbers can be individual or ranges: lo-hi [inclusive]

端口掃描:

$ nc -z -v -n 127.0.0.1 20-100...Connection to 127.0.0.1 80 port [tcp/*] succeeded!...

簡單文件傳輸:

客戶端:

$ nc -l 192.168.1.11 1234 > passwd.txt &

服務端:

$ nc 192.168.1.11 1234 < /etc/passwd

也可以是

cat /etc/passwd | nc 192.168.1.11 1234

服務端ip是192.169.1.11,端口是1234

如此,當兩臺linux機器需要簡單傳輸文件時,再好不過了~

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 彝良县| 乌兰察布市| 阳泉市| 万年县| 东安县| 溆浦县| 襄樊市| 会泽县| 营口市| 阳山县| 万荣县| 翼城县| 芦山县| 固阳县| 阳谷县| 微山县| 睢宁县| 长海县| 靖州| 景泰县| 武冈市| 突泉县| 清徐县| 错那县| 浏阳市| 阿克陶县| 耒阳市| 兴山县| 凭祥市| 青龙| 滨海县| 武冈市| 丹寨县| 金昌市| 四川省| 桃江县| 青海省| 阿拉善左旗| 信宜市| 武功县| 南皮县|