Netcat命令介绍及实践

1.Windows系统nc工具使用方法

[v1.10 NT]
connect to somewhere:   nc [-options] hostname port[s] [ports] ...
listen for inbound:     nc -l -p port [options] [hostname] [port]
options:
        -d              detach from console, stealth mode

        -e prog         inbound program to exec [dangerous!!]
        -g gateway      source-routing hop point[s], up to 8
        -G num          source-routing pointer: 4, 8, 12, ...
        -h              this cruft
        -i secs         delay interval for lines sent, ports scanned
        -l              listen mode, for inbound connects
        -L              listen harder, re-listen on socket close
        -n              numeric-only IP addresses, no DNS
        -o file         hex dump of traffic
        -p port         local port number
        -r              randomize local and remote ports
        -s addr         local source address
        -t              answer TELNET negotiation
        -u              UDP mode
        -v              verbose [use twice to be more verbose]
        -w secs         timeout for connects and final net reads
        -z              zero-I/O mode [used for scanning]
port numbers can be individual or ranges: m-n [inclusive]

2.Windows版nc工具(免安装)

下载连接:https://download.csdn.net/download/Whenbeen/12393406

 

3.Linux系统nc命令使用方法

Ncat 7.50 ( https://nmap.org/ncat )
Usage: ncat [options] [hostname] [port]

Options taking a time assume seconds. Append 'ms' for milliseconds,
's' for seconds, 'm' for minutes, or 'h' for hours (e.g. 500ms).
  -4                         Use IPv4 only
  -6                         Use IPv6 only
  -U, --unixsock             Use Unix domain sockets only
  -C, --crlf                 Use CRLF for EOL sequence
  -c, --sh-exec    Executes the given command via /bin/sh
  -e, --exec       Executes the given command
      --lua-exec  Executes the given Lua script
  -g hop1[,hop2,...]         Loose source routing hop points (8 max)
  -G                     Loose source routing hop pointer (4, 8, 12, ...)
  -m, --max-conns        Maximum simultaneous connections
  -h, --help                 Display this help screen
  -d, --delay

4.实践:Windows系统nc工具配合Linux系统nc命令使用

4.1 查看Linux系统IP地址

4.2 Linux系统通过nc命令监听7777端口

4.3 查看Windows系统IP地址

4.4 Windows系统通过nc.exe与Linux系统ip地址建立TCP连接

4.5三次握手抓包信息

4.6 发送数据检查通信状态

Windows发送:

Linux接收:

Linux系统收到Windows系统发送的消息,能够正常通信。

Whenbeen创作,感谢您的浏览!祝您生活愉快!

 

 

你可能感兴趣的:(命令工具)