This module acts as a base for all handler pseudo-modules. They aren‘t really modules, so don‘t get the wrong idea champs! They‘re merely mixed into dynamically generated payloads to handle monitoring for a connection. Handlers are layered in between the base payload class and any other payload class. A super cool ASCII diagram would look something like this
Module
^
|
Payload
^
|
Handler
^
|
Stager
^
|
Stage
| Claimed | = | "claimed" | Returned by handlers to indicate that a socket has been claimed for use by the payload. | |
| Unused | = | "unused" | Returned by handlers to indicate that a socket has not been claimed for use. |
| exploit_config | [RW] | Set by the exploit module to configure handler |
| parent_payload | [RW] | This will be non-nil if the handler has a parent payload that it was spawned from. Right now, this is only the case with generic payloads. The parent payload is used to create a session rather than using the instance itself. |
Handles an established connection supplied in the in and out handles. The handles are passed as parameters in case this handler is capable of handling multiple simultaneous connections. The default behavior is to attempt to create a session for the payload. This path will not be taken for mutli-staged payloads.
Checks to see if a payload connection has been established on the supplied connection. This is necessary for find-sock style payloads.
Waits for a session to be created as the result of a handler connection coming in. The return value is a session object instance on success or nil if the timeout expires.
Creates a session, if necessary, for the connection that‘s been handled. Sessions are only created if the payload that‘s been mixed in has an associated session.
Registers a session with the framework and notifies any waiters of the new session.