From dbe239bc750cf5a921f018dbb6f284b7fac8dd76 Mon Sep 17 00:00:00 2001 From: Spencer McIntyre Date: Thu, 2 Jul 2015 08:23:02 -0400 Subject: [PATCH] Pymet fix transport next and prev for one transport --- data/meterpreter/meterpreter.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/data/meterpreter/meterpreter.py b/data/meterpreter/meterpreter.py index 30aa8dba1b..99c76d38a7 100644 --- a/data/meterpreter/meterpreter.py +++ b/data/meterpreter/meterpreter.py @@ -715,8 +715,6 @@ class PythonMeterpreter(object): return time.time() > self.session_expiry_end def transport_change(self, new_transport=None): - if new_transport == self.transport: - return if new_transport is None: new_transport = self.transport_next() self.transport.deactivate() @@ -898,13 +896,19 @@ class PythonMeterpreter(object): return ERROR_SUCCESS, response def _core_transport_next(self, request, response): + new_transport = self.transport_next() + if new_transport == self.transport: + return ERROR_FAILURE, response self.send_packet(tlv_pack_response(ERROR_SUCCESS, response)) - self.transport_change(self.transport_next()) + self.transport_change(new_transport) return None def _core_transport_prev(self, request, response): + new_transport = self.transport_prev() + if new_transport == self.transport: + return ERROR_FAILURE, response self.send_packet(tlv_pack_response(ERROR_SUCCESS, response)) - self.transport_change(self.transport_prev()) + self.transport_change(new_transport) return None def _core_transport_remove(self, request, response):