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

Fix incorrect scope condition when populating RHOSTS using services command #18411

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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