Linux Netcat Commands

Source: Internet
Author: User


The netcat is used to debug and check the network and to read and write data through TCP and UDP on the network. Netcat is to establish a link between two computers and return two data streams, you can set up a server, transfer files, chat with friends, transfer streaming media or use it as a separate client for other protocols.

0x01, Port scan

NCAT-V-N 192.168.1.1 80

-V: Show more information

-N: Use a pure digital IP address without DNS to resolve IP addresses

-W 1: Set timeout time is 1

-u: Scan UDP port, default TCP

-Z: Use 0IO, close connection immediately after successful connection, no data exchange

-L: Connect and listen to incoming connections

-e: Command line to perform delivery

-K: Accepts multiple listening mode connections

0x02, Chat Service

Server

Start a TCP server on port 10086

Ncat-l 10086

Client

On the machine clent input, the server will show up

NCAT localhost 10086

0x03, File transfer

Server transfers files to client

Server

Ncat-l 10086 < Test.txt

Client

Ncat-n 127.0.0.1 10086 > Test.txt

Client transfers files to the server

Server

Touch Test.txt

Ncat-l 10086 > Test.txt

Clinet

Cat Test.txt | NCAT localhost 10086

0x03, directory Transfer

Server

Tar-czvf-python | ncat-l10086

Clinet

Ncat-n 127.0.0.1 10086 | TAR-XVF-

0x04, cloning a device

Server

DDIF=/DEV/SDA | Nc-l 10086

Clinet

Ncat-n 127.0.0.1 10086 | DD OF=/DEV/SDA

0x05, open a shell

Server

Ncat-l 10086-e/bin/bash-i

Client

Ncat-l 192.168.1.1 10086

Reverse shell

Server

Ncat-l 10086

Cliet

NCAT 127.0.0.1 10086-e/bin/bash


This article is from the "Love Affair" blog, please be sure to keep this source http://guojianglong.blog.51cto.com/9344755/1894458

Linux Netcat Commands

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.