mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-05 14:57:30 +01:00
Reworking module_ports to be more immediately useful to include its output in other ruby scripts.
git-svn-id: file:///home/svn/framework3/trunk@8438 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
2aa8ca08d5
commit
a241e0f949
@ -44,6 +44,7 @@ tbl = Rex::Ui::Text::Table.new(
|
||||
licenses = {}
|
||||
|
||||
all_modules = $framework.exploits.merge($framework.auxiliary)
|
||||
all_ports = {}
|
||||
|
||||
all_modules.each_module { |name, mod|
|
||||
x = mod.new
|
||||
@ -61,7 +62,14 @@ all_modules.each_module { |name, mod|
|
||||
ports = ports.map{|p| p.to_i}
|
||||
ports.uniq!
|
||||
ports.sort{|a,b| a <=> b}.each do |rport|
|
||||
puts "#{rport}\t#{x.fullname}"
|
||||
# Just record the first occurance.
|
||||
all_ports[rport] = x.fullname unless all_ports[rport]
|
||||
end
|
||||
}
|
||||
|
||||
all_ports.sort.each { |k,v|
|
||||
puts "%5s # %s" % [k,v]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user