← 返回命令列表

Linux command

ncat 命令

文件

涉及管道、覆盖或删除,执行前请先确认路径和参数。

常用示例

Listen

ncat -l [port] > [path/to/file]

Listen

ncat -lk [port]

Send file

ncat < [path/to/file] [address] [port]

Example

ncat --ssl -lk [port]

Connect

ncat --ssl [host] [port]

Check connectivity

ncat -w [seconds] -vz [host] [port]

Example

ncat -l [port] --chat

说明

ncat is a networking utility from the Nmap project for reading, writing, redirecting, and encrypting data across networks. It is a reimplementation of netcat with additional features including SSL support, proxy connections, and IPv6. Ncat can operate as a simple TCP/UDP client or server, port scanner, or network relay. It supports connection brokering, access control, and can be used for file transfer, port forwarding, and network debugging.

参数

-l, --listen
Listen for incoming connections
-k, --keep-open
Accept multiple connections in listen mode
--ssl
Use SSL/TLS encryption
--ssl-cert _file_
Specify SSL certificate file
--ssl-key _file_
Specify SSL private key file
-w, --wait _seconds_
Connection timeout in seconds
-v, --verbose
Enable verbose output
-z
Zero-I/O mode; report connection status only
-p, --source-port _port_
Specify source port
-e, --exec _command_
Execute command after connection
--chat
Enable chat mode for multiple users
--proxy _host:port_
Connect through proxy
--proxy-type _type_
Proxy type: http, socks4, socks5
-4
Use IPv4 only
-6
Use IPv6 only

FAQ

What is the ncat command used for?

ncat is a networking utility from the Nmap project for reading, writing, redirecting, and encrypting data across networks. It is a reimplementation of netcat with additional features including SSL support, proxy connections, and IPv6. Ncat can operate as a simple TCP/UDP client or server, port scanner, or network relay. It supports connection brokering, access control, and can be used for file transfer, port forwarding, and network debugging.

How do I run a basic ncat example?

Run `ncat -l [port] > [path/to/file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l, --listen do in ncat?

Listen for incoming connections