Browse Source

fix Failure scoping (needed for libraries)

Brent Cook 1 month ago
parent
commit
0308f80c0e
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      lib/msf/core/exploit/smb/client/psexec.rb
  2. 1
    1
      tools/dev/msftidy.rb

+ 1
- 1
lib/msf/core/exploit/smb/client/psexec.rb View File

@@ -265,7 +265,7 @@ module Exploit::Remote::SMB::Client::Psexec
265 265
     begin
266 266
       psexec(command)
267 267
     rescue StandardError => exec_command_error
268
-      fail_with(Failure::Unknown, "#{peer} - Unable to execute specified command: #{exec_command_error}")
268
+      fail_with(Msf::Exploit::Failure::Unknown, "#{peer} - Unable to execute specified command: #{exec_command_error}")
269 269
     end
270 270
   end
271 271
 

+ 1
- 1
tools/dev/msftidy.rb View File

@@ -608,7 +608,7 @@ class Msftidy
608 608
       end
609 609
 
610 610
       if ln =~ /^\s*fail_with\(/
611
-        unless ln =~ /^\s*fail_with\(Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),/
611
+        unless ln =~ /^\s*fail_with\(.*Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),/
612 612
           error("fail_with requires a valid Failure:: reason as first parameter: #{ln}", idx)
613 613
         end
614 614
       end

Loading…
Cancel
Save