File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
lib/msf/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -706,6 +706,7 @@ def cmd_vulns_help
706
706
print_line " -p,--port <portspec> List vulns matching this port spec"
707
707
print_line " -s <svc names> List vulns matching these service names"
708
708
print_line " -S,--search Search string to filter by"
709
+ print_line " -R,--rhosts Set RHOSTS from the results of the search"
709
710
print_line " -i,--info Display Vuln Info"
710
711
print_line
711
712
print_line "Examples:"
@@ -721,7 +722,10 @@ def cmd_vulns(*args)
721
722
host_ranges = [ ]
722
723
port_ranges = [ ]
723
724
svcs = [ ]
725
+ rhosts = [ ]
726
+
724
727
search_term = nil
728
+ set_rhosts = nil
725
729
show_info = false
726
730
727
731
# Short-circuit help
@@ -754,6 +758,8 @@ def cmd_vulns(*args)
754
758
search_term = /#{ args . shift } /nmi
755
759
when '-i' , '--info'
756
760
show_info = true
761
+ when '-R' , '--rhosts'
762
+ set_rhosts = true
757
763
else
758
764
# Anything that wasn't an option is a host to search for
759
765
unless ( arg_host_range ( arg , host_ranges ) )
@@ -790,9 +796,14 @@ def cmd_vulns(*args)
790
796
next unless ports . empty? and svcs . empty?
791
797
print_status ( "Time: #{ vuln . created_at } Vuln: host=#{ host . address } name=#{ vuln . name } refs=#{ reflist . join ( ',' ) } #{ ( show_info && vuln . info ) ? "info=#{ vuln . info } " : "" } " )
792
798
end
799
+ if set_rhosts
800
+ addr = ( host . scope ? host . address + '%' + host . scope : host . address )
801
+ rhosts << addr
793
802
end
794
803
end
795
804
end
805
+ set_rhosts_from_addrs ( rhosts . uniq ) if set_rhosts
806
+ end
796
807
}
797
808
end
798
809
You can’t perform that action at this time.
0 commit comments