From 6ea1e7aed2bb417024d042b63104e46c8d7c8bde Mon Sep 17 00:00:00 2001 From: William Vu Date: Mon, 13 May 2019 17:27:51 -0500 Subject: [PATCH] Handle TypeError in case of nil --- lib/msf/core/evasion.rb | 2 +- lib/msf/core/exploit.rb | 2 +- lib/msf/ui/console/command_dispatcher/modules.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/msf/core/evasion.rb b/lib/msf/core/evasion.rb index efda755874..740a77427d 100644 --- a/lib/msf/core/evasion.rb +++ b/lib/msf/core/evasion.rb @@ -286,7 +286,7 @@ module Msf target_idx = begin Integer(datastore['TARGET']) - rescue ArgumentError + rescue ArgumentError, TypeError datastore['TARGET'] end diff --git a/lib/msf/core/exploit.rb b/lib/msf/core/exploit.rb index eda415c1ec..eefce6d5a3 100644 --- a/lib/msf/core/exploit.rb +++ b/lib/msf/core/exploit.rb @@ -686,7 +686,7 @@ class Exploit < Msf::Module target_idx = begin Integer(datastore['TARGET']) - rescue ArgumentError + rescue ArgumentError, TypeError datastore['TARGET'] end diff --git a/lib/msf/ui/console/command_dispatcher/modules.rb b/lib/msf/ui/console/command_dispatcher/modules.rb index 71c102cacd..cf8dd266bd 100644 --- a/lib/msf/ui/console/command_dispatcher/modules.rb +++ b/lib/msf/ui/console/command_dispatcher/modules.rb @@ -643,7 +643,7 @@ module Msf mod_index = begin Integer(mod_name) - 1 - rescue ArgumentError + rescue ArgumentError, TypeError nil end