Skip to content

Commit

Permalink
Make it possible to provide a non-default RPORT
Browse files Browse the repository at this point in the history
  • Loading branch information
nrathaus committed Apr 11, 2024
1 parent 0b610e4 commit eff0ba4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/auxiliary/scanner/smb/smb_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def initialize
]
)

deregister_options('RPORT', 'SMBDIRECT', 'SMB::ProtocolVersion')
deregister_options('SMBDIRECT', 'SMB::ProtocolVersion')
end

def rport
Expand Down Expand Up @@ -189,7 +189,11 @@ def smb_os_description(res, nd_smb_fingerprint)
# Fingerprint a single host
#
def run_host(ip)
smb_ports = [445, 139]
# Use a set, rather than an array, so that we can add the user provided
# RPORTS
smb_ports = Set[445, 139]
smb_ports.add(datastore['RPORT'])

lines = [] # defer status output to the very end to group lines together by host
smb_ports.each do |pnum|
@smb_port = pnum
Expand Down

0 comments on commit eff0ba4

Please sign in to comment.