diff --git a/documentation/plan.txt b/documentation/plan.txt index af9e9b00fd..c958367e61 100644 --- a/documentation/plan.txt +++ b/documentation/plan.txt @@ -39,7 +39,7 @@ X - logging session activity - bsd payloads - user interfaces - general - - add concept of EVASION option (high, normal, low) +X - add concept of EVASION option (high, normal, low) X - logging improvements X - provide log file setting interface X - log by default in the LogDir diff --git a/lib/msf/ui/console/driver.rb b/lib/msf/ui/console/driver.rb index d5177b49bf..b569698d4f 100644 --- a/lib/msf/ui/console/driver.rb +++ b/lib/msf/ui/console/driver.rb @@ -87,12 +87,7 @@ class Driver < Msf::Ui::Driver if (conf.group?(ConfigCore)) conf[ConfigCore].each_pair { |k, v| - case k.downcase - when "sessionlogging" - handle_session_logging(v) - when "consolelogging" - handle_console_logging(v) - end + on_variable_set(true, k, v) } end end @@ -153,6 +148,8 @@ class Driver < Msf::Ui::Driver handle_session_logging(val) if (glob) when "consolelogging" handle_console_logging(val) if (glob) + when "evasion" + handle_evasion(val) if (glob) end end @@ -166,6 +163,8 @@ class Driver < Msf::Ui::Driver handle_session_logging('0') if (glob) when "consolelogging" handle_console_logging('0') if (glob) + when "evasion" + handle_evasion(EVASION_NORMAL) if (glob) end end @@ -216,6 +215,17 @@ protected end end + # + # Evasion. Sets the global evasion level based on the supplied argument. + # + def handle_evasion(val) + if (val =~ /^(normal|low|high)$/i) + Rex::Evasion.set_level(val.downcase) + else + false + end + end + end end