From 395e1b696a07770c35cbbfe818213181873045a5 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Sun, 2 Oct 2005 07:58:26 +0000 Subject: [PATCH] evasion setting git-svn-id: file:///home/svn/incoming/trunk@2948 4d416f70-5f16-0410-b530-b9f4589650da --- documentation/plan.txt | 2 +- lib/msf/ui/console/driver.rb | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) 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