Skip to content

Commit

Permalink
Land #18411, Fix incorrect scope condition when populating RHOSTS usi…
Browse files Browse the repository at this point in the history
…ng services command
  • Loading branch information
adfoster-r7 authored Oct 11, 2023
2 parents 0e62f3c + 4978610 commit 6c33bf9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/msf/ui/console/command_dispatcher/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ def cmd_hosts(*args)

tbl << columns
if set_rhosts
addr = (host.scope ? host.address + '%' + host.scope : host.address)
addr = (host.scope.to_s != "" ? host.address + '%' + host.scope : host.address)
rhosts << addr
end
end
Expand Down Expand Up @@ -880,7 +880,7 @@ def cmd_services(*args)
columns = [host.address] + col_names.map { |n| service[n].to_s || "" }
tbl << columns
if set_rhosts
addr = (host.scope ? host.address + '%' + host.scope : host.address )
addr = (host.scope.to_s != "" ? host.address + '%' + host.scope : host.address )
rhosts << addr
end
end
Expand Down Expand Up @@ -1056,7 +1056,7 @@ def cmd_vulns(*args)
tbl << row

if set_rhosts
addr = (vuln.host.scope ? vuln.host.address + '%' + vuln.host.scope : vuln.host.address)
addr = (vuln.host.scope.to_s != "" ? vuln.host.address + '%' + vuln.host.scope : vuln.host.address)
rhosts << addr
end
end
Expand Down Expand Up @@ -1280,7 +1280,7 @@ def cmd_notes(*args)
host = note.host
row << host.address
if set_rhosts
addr = (host.scope ? host.address + '%' + host.scope : host.address)
addr = (host.scope.to_s != "" ? host.address + '%' + host.scope : host.address)
rhosts << addr
end
else
Expand Down

0 comments on commit 6c33bf9

Please sign in to comment.