RFC: Improve Validation of Session Support #14493
Replies: 4 comments 8 replies
-
Great idea, I know I've run into a few of these issues in the past when testing things out like Python Meterpreter vs Windows Meterpreter and its not immediately apparent what the differences are. We might also want to consider some documentation page or chart which lists out the features each type supports to help end users when developing. Not not sure if that would grow unwieldy (there are a lot of items that might have to be listed). I imagine most of the info for this documentation would likely be generated whilst solving this issue but feel free to correct me if I am mistaken in this assumption. |
Beta Was this translation helpful? Give feedback.
-
As we continue to look into the compatibility of the feature set provided by Meterpreter, it may also be really beneficial to promote the system information out of the standard API and into the core so it can be available for extensions to determine whether or not they are compatible. At this time adding a normalized field to include the OS version number would be nice as well. We could use this for example to pin the |
Beta Was this translation helpful? Give feedback.
-
I think this was sufficiently addressed in #14789 which began to leverage the TLV encryption negotiation process to validate that a session is responsive within the allowed 30 second timeout period. |
Beta Was this translation helpful? Give feedback.
-
Based on how the Meterpreter command ID strings are structured, I'm thinking that a wild card string could be the best option. This would get merged up through the module data. Then, for each requirement string, Metasploit would look up all commands it knows that matches the string, and verify that the sessions support all of those commands. For example, anything requiring railgun would specify This would allow module authors to be as general or granular as they'd like. Maintaining an explicit list of each command every module requires just doesn't seem feasible. My concern that I haven't quite figured out how to address is mixins. If a mixin offers say 5 methods that require 5 different Meterpreter commands, but a module only calls one of those methods, should it only be compatible with sessions that support all 5 Meterpreter commands? I'm thinking yes because:
We could potentially add the ability to negate requirements, but that seems dangerous. In the previous example the module author, with a detailed understanding of the mixin's implementation would explicitly mark the 4 Meterpreter commands used by the 4 methods they're not using as not required. The other concern is that this requires module authors that are using Meterpreter methods to be familiar with the commands that they are using. For example, any module author that calls |
Beta Was this translation helpful? Give feedback.
-
Problem
Metasploit post and local exploit modules allow the selection of incompatible sessions. Since not all
meterpreter
sessions are created equal, when a module restricts tometerpreter
sessions and the connection does not support the api features required to execute the user is not informed until actually attempting to execute the module.Take for instance
post/windows/gather/screen_spy
, this module requires ameterpreter
session howeverpayload/python/meterpreter/bind_tcp
would meet this requirement without actually being able to support theCOMMAND_ID_START_ESPIA
command in the targeted session.Further, a core issue to address is that the handlers currently report any connection as a session. In this scenario, opening a handler on a port, any
syn
request to that listener will trigger a reported session even if no further interaction occurs on the port. This has lead to many incomplete or invalid sessions being reported as issues.Solution
improve session determination
Beta Was this translation helpful? Give feedback.
All reactions