Skip to content

Commit 201ec17

Browse files
committed
Land rapid7#7844, adds protocol to RPORT (fixes rapid7#7757)
2 parents c2e4a50 + 84513fd commit 201ec17

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

lib/msf/base/serializer/readable_text.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,23 @@ 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+
case m.name
416+
when /tcp/i, /HttpClient$/
417+
desc << ' (TCP)'
418+
break
419+
when /udp/i
420+
desc << ' (UDP)'
421+
break
422+
end
423+
end
424+
end
425+
426+
tbl << [ name, opt.display_value(val), opt.required? ? "yes" : "no", desc ]
411427
end
412428

413429
return tbl.to_s

0 commit comments

Comments
 (0)