Skip to content

Commit 6c33bf9

Browse files
authored
Land #18411, Fix incorrect scope condition when populating RHOSTS using services command
2 parents 0e62f3c + 4978610 commit 6c33bf9

File tree

1 file changed

+4
-4
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+4
-4
lines changed

lib/msf/ui/console/command_dispatcher/db.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ def cmd_hosts(*args)
642642

643643
tbl << columns
644644
if set_rhosts
645-
addr = (host.scope ? host.address + '%' + host.scope : host.address)
645+
addr = (host.scope.to_s != "" ? host.address + '%' + host.scope : host.address)
646646
rhosts << addr
647647
end
648648
end
@@ -880,7 +880,7 @@ def cmd_services(*args)
880880
columns = [host.address] + col_names.map { |n| service[n].to_s || "" }
881881
tbl << columns
882882
if set_rhosts
883-
addr = (host.scope ? host.address + '%' + host.scope : host.address )
883+
addr = (host.scope.to_s != "" ? host.address + '%' + host.scope : host.address )
884884
rhosts << addr
885885
end
886886
end
@@ -1056,7 +1056,7 @@ def cmd_vulns(*args)
10561056
tbl << row
10571057

10581058
if set_rhosts
1059-
addr = (vuln.host.scope ? vuln.host.address + '%' + vuln.host.scope : vuln.host.address)
1059+
addr = (vuln.host.scope.to_s != "" ? vuln.host.address + '%' + vuln.host.scope : vuln.host.address)
10601060
rhosts << addr
10611061
end
10621062
end
@@ -1280,7 +1280,7 @@ def cmd_notes(*args)
12801280
host = note.host
12811281
row << host.address
12821282
if set_rhosts
1283-
addr = (host.scope ? host.address + '%' + host.scope : host.address)
1283+
addr = (host.scope.to_s != "" ? host.address + '%' + host.scope : host.address)
12841284
rhosts << addr
12851285
end
12861286
else

0 commit comments

Comments
 (0)