Fix pivot handler to not consume all packets

Packet handlers should only return true if they consume a packet.
Otherwise, they should return false so something else can consume it.
This fixes port forwards by allowing the socket handler to see packets
that were otherwise being discarded in the pivot handler.
MS-2855/keylogger-mettle-extension
Brent Cook 2018-02-02 18:01:05 -06:00
parent 2eca3b925b
commit d5ae2bb55b
1 changed files with 4 additions and 1 deletions

View File

@ -45,11 +45,14 @@ class Pivot
# Class request handler for all channels that dispatches requests
# to the appropriate class instance's DIO handler
def request_handler(client, packet)
handled = false
if packet.method == 'core_pivot_session_new'
handled = true
session_guid = packet.get_tlv_value(TLV_TYPE_SESSION_GUID)
listener_id = packet.get_tlv_value(TLV_TYPE_PIVOT_ID)
client.add_pivot_session(Pivot.new(client, session_guid, listener_id))
elsif packet.method == 'core_pivot_session_died'
handled = true
session_guid = packet.get_tlv_value(TLV_TYPE_SESSION_GUID)
pivot = client.find_pivot_session(session_guid)
if pivot
@ -57,7 +60,7 @@ class Pivot
client.remove_pivot_session(session_guid)
end
end
true
handled
end
end