@@ -2033,6 +2033,11 @@ def cmd_set_tabs(str, words)
2033
2033
end
2034
2034
end
2035
2035
2036
+ unless str . blank?
2037
+ res = res . select { |term | term . upcase . start_with? ( str . upcase ) }
2038
+ res = res . map { |term | str << term [ str . length ..-1 ] }
2039
+ end
2040
+
2036
2041
return res
2037
2042
end
2038
2043
@@ -2737,6 +2742,8 @@ def tab_complete_option(str, words)
2737
2742
p = framework . payloads . create ( mod . datastore [ 'PAYLOAD' ] )
2738
2743
if ( p and p . options . include? ( opt ) )
2739
2744
res . concat ( option_values_dispatch ( p . options [ opt ] , str , words ) )
2745
+ elsif ( p and p . options . include? ( opt . upcase ) )
2746
+ res . concat ( option_values_dispatch ( p . options [ opt . upcase ] , str , words ) )
2740
2747
end
2741
2748
end
2742
2749
@@ -2770,8 +2777,10 @@ def option_values_dispatch(o, str, words)
2770
2777
end
2771
2778
2772
2779
when 'Msf::OptAddressRange'
2773
-
2774
2780
case str
2781
+ when /^file:(.*)/
2782
+ files = tab_complete_filenames ( $1, words )
2783
+ res += files . map { |f | "file:" << f } if files
2775
2784
when /\/ $/
2776
2785
res << str +'32'
2777
2786
res << str +'24'
@@ -2802,9 +2811,20 @@ def option_values_dispatch(o, str, words)
2802
2811
o . enums . each do |val |
2803
2812
res << val
2804
2813
end
2814
+
2805
2815
when 'Msf::OptPath'
2806
2816
files = tab_complete_filenames ( str , words )
2807
2817
res += files if files
2818
+
2819
+ when 'Msf::OptBool'
2820
+ res << 'true'
2821
+ res << 'false'
2822
+
2823
+ when 'Msf::OptString'
2824
+ if ( str =~ /^file:(.*)/ )
2825
+ files = tab_complete_filenames ( $1, words )
2826
+ res += files . map { |f | "file:" << f } if files
2827
+ end
2808
2828
end
2809
2829
2810
2830
return res
0 commit comments