Advertisement

Linux上安装NetCat及简单使用

阅读量:

一、介绍:
Netcat是一个专为TCP/UDP协议设计的网络数据读写工具(功能模块),以其多功能性著称,在瑞士军迷中被誉为"万能刀具"。它广泛应用于调试、传输以及网络安全攻击等多个领域。使用该工具不仅可以实现将网络中任意一台设备的数据完整地发送至另一台主机终端显示或存储,并且还可以通过其他用途如验证服务器的安全性。

二、Linux上安装:

  • 第一种方式:
复制代码
    yum -y install nc
    yum remove nmap-ncat.x86_64(删除)
在这里插入图片描述
  • 第二种方式:
在这里插入图片描述

下载rpm包,在Linux上安装就好

三、简单使用
命令行参数介绍:

复制代码
      -U, --unixsock             Use Unix domain sockets only
      -C, --crlf                 Use CRLF for EOL sequence
      -c, --sh-exec <command>    Executes the given command via /bin/sh
      -e, --exec <command>       Executes the given command
      --lua-exec <filename>  Executes the given Lua script
      -g hop1[,hop2,...]         Loose source routing hop points (8 max)
      -G <n>                     Loose source routing hop pointer (4, 8, 12, ...)
      -m, --max-conns <n>        Maximum <n> simultaneous connections
      -h, --help                 Display this help screen
      -d, --delay <time>         Wait between read/writes
      -o, --output <filename>    Dump session data to a file
      -x, --hex-dump <filename>  Dump session data as hex to a file
      -i, --idle-timeout <time>  Idle read/write timeout
      -p, --source-port port     Specify source port to use
      -s, --source addr          Specify source address to use (doesn't affect -l)
      -l, --listen               Bind and listen for incoming connections
      -k, --keep-open            Accept multiple connections in listen mode
      -n, --nodns                Do not resolve hostnames via DNS
      -t, --telnet               Answer Telnet negotiations
      -u, --udp                  Use UDP instead of default TCP
      --sctp                 Use SCTP instead of default TCP
      -v, --verbose              Set verbosity level (can be used several times)
      -w, --wait <time>          Connect timeout
      -z                         Zero-I/O mode, report connection status only
      --append-output        Append rather than clobber specified output files
      --send-only            Only send data, ignoring received; quit on EOF
      --recv-only            Only receive data, never send anything
      --allow                Allow only given hosts to connect to Ncat
      --allowfile            A file of hosts allowed to connect to Ncat
      --deny                 Deny given hosts from connecting to Ncat
      --denyfile             A file of hosts denied from connecting to Ncat
      --broker               Enable Ncat's connection brokering mode
      --chat                 Start a simple Ncat chat server
      --proxy <addr[:port]>  Specify address of host to proxy through
      --proxy-type <type>    Specify proxy type ("http" or "socks4" or "socks5")
      --proxy-auth <auth>    Authenticate with HTTP or SOCKS proxy server
      --ssl                  Connect or listen with SSL
      --ssl-cert             Specify SSL certificate file (PEM) for listening
      --ssl-key              Specify SSL private key (PEM) for listening
      --ssl-verify           Verify trust and domain name of certificates
      --ssl-trustfile        PEM file containing trusted SSL certificates
      --ssl-ciphers          Cipherlist containing SSL ciphers to use
      --version              Display Ncat's version information and exit

举例说明
通过nc工具可以在两台设备间实现信息传输。其中一台设备负责监听指定端口,并等待 incoming connections;另一台设备则通过connect功能与该端口建立通信链接。建立通信后,在一台设备上标记为letter标识,在另一台设备上标记为digit标识即可作为区分标识。

在这里插入图片描述
在这里插入图片描述

全部评论 (0)

还没有任何评论哟~