Skip to content

mr-rubber-duck/Reverce-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Reverse Shell: A Pentester's Guide

Introduction

A reverse shell is a type of shell where the target machine connects back to the attacker's machine, allowing the attacker to gain remote access to the target system. This technique is commonly used in penetration testing to bypass firewalls or network restrictions that might block incoming connections.

In this guide, we will explain how to use a reverse shell and demonstrate how to set it up using Netcat (nc), one of the most popular tools for this purpose.


What is a Reverse Shell?

A reverse shell is a shell in which the victim machine connects to the attacker’s machine. Once the connection is established, the attacker can issue commands on the victim's system, gaining remote control over it.

Why Use a Reverse Shell?

  • Bypassing firewalls: Reverse shells allow attackers to bypass firewalls or NAT that block inbound connections.
  • Remote access: Once established, attackers can execute commands on the victim's machine and gain control.
  • Penetration Testing: Ethical hackers use reverse shells to simulate attacks and identify vulnerabilities.

Prerequisites

  • Attacker's machine: This is the machine running the listener (the machine receiving the reverse shell).
  • Victim's machine: This is the target machine from which the reverse shell will be initiated.

Step-by-Step Guide

Step 1: Set Up Netcat Listener on Attacker's Machine

  1. Open a terminal on the attacker's machine.
  2. Run the following command to start a listener on a specific port (e.g., port 4444):
nc -lvnp 4444

About

This script will make an outbound TCP connection to a hardcoded IP and port. // The recipient will be given a shell running as the current user (apache normally).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors