Skip to content

Automatic LPORT selection #21604

Description

@dwelch-r7

Summary

This came out of a discussion here #21581 (comment) as part of the smb_to_meterpreter work.
The default port for handlers is 4444 so it's likely to have that port not be available when doing something like a session upgrade, the idea is that we would add some logic to search for an available port when the default isn't available.

Few questions still to answer here though:

  1. If a user sets a port and it's in use do we still want to attempt other ports? or do we fail if the port was set explicitly?
  2. Where should it be used? obvious example are the shell/smb/etc to_meterpreter upgrades, should it extend to other modules? or does it only make sense in cases like sessions -u -1 where we can't directly set the datastore option?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions