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:
- 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?
- 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?
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:
sessions -u -1where we can't directly set the datastore option?