From dc33921b982fd0170ee7b39aa4f61462c2baec20 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Fri, 4 Nov 2005 00:55:46 +0000 Subject: [PATCH] bugs bugs, messing with win32 git-svn-id: file:///home/svn/incoming/trunk@3016 4d416f70-5f16-0410-b530-b9f4589650da --- documentation/bugs | 9 +++++++++ lib/msf/base/config.rb | 13 ++++++++++++- lib/rex/ui/text/shell.rb | 6 +++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/documentation/bugs b/documentation/bugs index 760eee7efc..bd70e4cb11 100644 --- a/documentation/bugs +++ b/documentation/bugs @@ -7,3 +7,12 @@ meterpreter msfconsole - jobs -k on the same exploit twice leads to exception + + +win32 bugs + + - 'gets' blocks + - http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/151367 + - works in cmd.exe + - does not work in rxvt (kbhit just keeps returning 0) +X - no HOME variable by default -- need to use another directory diff --git a/lib/msf/base/config.rb b/lib/msf/base/config.rb index d0bde2e051..3c7ebbaa26 100644 --- a/lib/msf/base/config.rb +++ b/lib/msf/base/config.rb @@ -15,13 +15,24 @@ class Config < Hash # InstallRoot = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..')) + # + # Determines the base configuration directory. + # + def self.get_config_root + begin + File.expand_path("~#{FileSep}.msf3") + rescue ArgumentError + InstallRoot + ".msf3" + end + end + # # Default values # FileSep = File::SEPARATOR Defaults = { - 'ConfigDirectory' => File.expand_path("~#{FileSep}.msf3"), + 'ConfigDirectory' => get_config_root, 'ConfigFile' => "config", 'ModuleDirectory' => "modules", 'LogDirectory' => "logs", diff --git a/lib/rex/ui/text/shell.rb b/lib/rex/ui/text/shell.rb index ac8a532baf..6b237a47ff 100644 --- a/lib/rex/ui/text/shell.rb +++ b/lib/rex/ui/text/shell.rb @@ -171,7 +171,11 @@ module Shell # console # def supports_color? - return (ENV['TERM'].match(/(?:vt10[03]|xterm(?:-color)?|linux|screen)/i) != nil) + begin + (ENV['TERM'].match(/(?:vt10[03]|xterm(?:-color)?|linux|screen)/i) != nil) + rescue + false + end end #