您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關如何使用netcat進行文件傳輸,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
首先看一下幫助信息。
$ nc -h OpenBSD netcat (Debian patchlevel 1.105-7ubuntu1) This is nc from the netcat-openbsd package. An alternative nc is available in 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機器需要簡單傳輸文件時,再好不過了~
關于“如何使用netcat進行文件傳輸”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。