Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to provide a non-default RPORT #19076

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nrathaus
Copy link
Contributor

Related to: #19072

Make it possible to add a non-default (139, 445) port to the SMB test, by using Set rather than list/array and adding the datastore RPORT to the mix

@smcintyre-r7 smcintyre-r7 self-assigned this Apr 16, 2024
@smcintyre-r7
Copy link
Contributor

So now that #19095 has been landed, the #connect method has the direct keyword argument. That means this can proceed, it just needs to be rebased and then to consolidate the port options into just RPORT instead of individual datastore options for each.

The pattern now included in smb_enumusers should fit here where it'll check 139 and 445 if RPORT is not set. If RPORT is set, it'll be the only port checked. That should meet the requirements of the original request, maintain backwards compatibility and be relatively intuitive for users due to the reuse of the existing datastore options for their intended purposes.

if datastore['RPORT'].blank? || datastore['RPORT'] == 0
smb_services = [
{ port: 139, direct: false },
{ port: 445, direct: true }
]
else
smb_services = [
{ port: datastore['RPORT'], direct: datastore['SMBDirect'] }
]
end
smb_services.each do |smb_service|
run_service(smb_service[:port], smb_service[:direct])
end
end

@smcintyre-r7
Copy link
Contributor

Are you still interested in making these changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Waiting on Contributor
Development

Successfully merging this pull request may close these issues.

None yet

2 participants