Skip to content

Commit 89b2f08

Browse files
committed
Add TCP/UDP hint to RPORT
Caveat: works with mixins only (tenuously).
1 parent c2e4a50 commit 89b2f08

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

lib/msf/base/serializer/readable_text.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,22 @@ def self.dump_options(mod, indent = '', missing = false)
407407
next if (opt.evasion?)
408408
next if (missing && opt.valid?(val))
409409

410-
tbl << [ name, opt.display_value(val), opt.required? ? "yes" : "no", opt.desc ]
410+
desc = opt.desc.dup
411+
412+
# Hint at RPORT proto by regexing mixins
413+
if name == 'RPORT' && opt.kind_of?(Msf::OptPort)
414+
mod.class.included_modules.each do |m|
415+
if m.name =~ /tcp/i
416+
desc << ' (TCP)'
417+
break
418+
elsif m.name =~ /udp/i
419+
desc << ' (UDP)'
420+
break
421+
end
422+
end
423+
end
424+
425+
tbl << [ name, opt.display_value(val), opt.required? ? "yes" : "no", desc ]
411426
end
412427

413428
return tbl.to_s

0 commit comments

Comments
 (0)