Linux NC Commands

Source: Internet
Author: User
Tags file copy

First, Introduction

NetCat, a "Swiss Army Knife" in Web tools, has a version of Windows and Linux. Because it is short and short (the 1.84 version is 25k, the old version or the reduced version is even smaller), functional, is designed as a simple, reliable network tool, can transmit read and write data through TCP or UDP protocol. At the same time, it is a network application debug parser, because it can create a variety of different types of network connections as needed.

Second, the grammar

NC [-hlnruz][-g< Gateway ...>][-g< number of points >][-i< delay seconds >][-o< output file >][-p< communication port >][-s< Source address >][ -V ...] [-W< timeout of seconds;] [Host name] [Communication port ...]
-g< Gateway >-g< number of points >-H  -i< delay seconds >-l  -N   -o< output file >-p< Communication port >-R  -s< Source Address >-  U  -v Verbose output--with two--w< timeout seconds >-Z  uses 0 in/out mode, only used when scanning communication ports.

Iii. Examples of application

Example 1: Port scan

Nc-v-w2192.168. 2.34 -

Example 2: File copy (from 192.168.2.33 copy files to 192.168.2.34)

In the 192. 168.2 1234 > test.txt in 192. 168.2 192.168. 2.34 < Test.txt

Example 3: Simple Chat

In the 192. 168.2 1234 in 192. 168.2 192.168. 2.34 1234 in this way, the two sides can communicate with each other. Use CTRL+c (or D) to exit.

Example 4: Remote execution (connect to host and execute)

Echo " get/http/1.0 "r"n"r"n"

Example 5: Remote connection (establish 80-port connection from local 1234 port to host.example.com, 5-second timeout)

1234 -w5

Linux NC Commands

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.