1
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:
Tod Beardsley 2010-02-09 23:39:27 +00:00
parent 2aa8ca08d5
commit a241e0f949

View File

@ -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]
}