File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
lib/msf/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,9 @@ class Core
101
101
# Constant for disclosure date formatting in search functions
102
102
DISCLOSURE_DATE_FORMAT = "%Y-%m-%d"
103
103
104
+ # Constant for a retry timeout on using modules before they're loaded
105
+ CMD_USE_TIMEOUT = 3
106
+
104
107
# Returns the list of commands supported by this command dispatcher
105
108
def commands
106
109
{
@@ -2418,9 +2421,15 @@ def cmd_use(*args)
2418
2421
mod_name = args [ 0 ]
2419
2422
2420
2423
begin
2421
- if ( ( mod = framework . modules . create ( mod_name ) ) == nil )
2422
- print_error ( "Failed to load module: #{ mod_name } " )
2423
- return false
2424
+ mod = framework . modules . create ( mod_name )
2425
+ unless mod
2426
+ # Try one more time; see #4549
2427
+ sleep CMD_USE_TIMEOUT
2428
+ mod = framework . modules . create ( mod_name )
2429
+ unless mod
2430
+ print_error ( "Failed to load module: #{ mod_name } " )
2431
+ return false
2432
+ end
2424
2433
end
2425
2434
rescue Rex ::AmbiguousArgumentError => info
2426
2435
print_error ( info . to_s )
You can’t perform that action at this time.
0 commit comments