File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,6 @@ def commands
43
43
# This method handles the fuzzy_use command.
44
44
#
45
45
def cmd_fzuse ( *args )
46
- unless Msf ::Util ::Helper . which ( 'fzf' )
47
- print_error ( 'This command requires that the `fzf` utility be installed.' )
48
- return
49
- end
50
-
51
46
previewer = File . join ( Msf ::Config . install_root , 'tools' , 'modules' , 'print.py' )
52
47
53
48
module_types = framework . modules . module_types
@@ -87,6 +82,17 @@ def cmd_fzuse(*args)
87
82
#
88
83
def initialize ( framework , opts )
89
84
super
85
+
86
+ missing_requirements = [ ]
87
+ missing_requirements << 'fzf' unless Msf ::Util ::Helper . which ( 'fzf' )
88
+ missing_requirements << 'python' unless Msf ::Util ::Helper . which ( 'python' )
89
+ missing_requirements << 'python-rich' unless system ( "python -c 'import rich'" , out : File ::NULL , err : File ::NULL )
90
+
91
+ unless missing_requirements . empty?
92
+ print_error ( "The FuzzyUse plugin has loaded but the following requirements are missing: #{ missing_requirements . join ( ', ' ) } " )
93
+ print_error ( "Please install the missing requirements, then reload the plugin by running: `unload fzuse` and `load fzuse`." )
94
+ return
95
+ end
90
96
91
97
# If this plugin is being loaded in the context of a console application
92
98
# that uses the framework's console user interface driver, register
You can’t perform that action at this time.
0 commit comments