Jarred’s Custom Reverse Shell

Steps to create a reverse shell tool

Reverse Shell

– The victim machine sends an outbound request to the attacker machine via TCP

– This allows the attacker to perform remote execution on the victim’s machine at the user level

How does this work?

– A reverse shell is created by establishing a socket connection from the victim’s machine to the attacker’s machine

How do I do that?

– Utilize Metasploit Framework

– Create your own reverse shell

How do I create my own reverse shell

– Write two programs: The payload, for the victim, and the reverse shell, for the attacker

What can I do when I have created a reverse shell?

– Execute commands from the attacker’s machine on the victim’s machine via terminal

The payload

– Create C++ console application that will establish a socket connection with the reverse shell

– Once the connection is established, open a read loop that will make read calls from the reverse shell via TCP socket

– Process each read on the victim’s machine

The reverse shell

– Open a TCP socket connection that will listen for incoming connnections

– Once a connection is established, then process input from the attacker

– Send the input from the attacker to the victim’s machine

What is a reverse shell?

To answer this question, we need to know what a “shell” is in the first place. A shell is basically a command line, whether it’s the windows Command Prompt or Unix or Mac Terminal. Shells let the user give the system commands to execute. A reverse shell is when an attacker gets access to run a shell of their own on your system — that’s bad!

Reverse shells are dangerous because the attacker does not need to infiltrate your network; they work by using your machine on the network. To start a reverse shell, an attacker simply needs for you to establish a connection on the port they’re listening on. This can happen in several ways:

  1. Phyiscally installed on your machine
  2. Social engineering – clicking on a bad link, getting phished, plugging in an infected USB, etc.
  3. Download a legitimate program with a reverse shell hidden inside

Kali has many tools that can help an attacker establish a listener, among them Netcat, Cryptcat, DNS tunnel, etc. You can also easily create your own custom reverse shell.

Create your own website, free on WordPress.com.Create your own website.
Start free