From b9bbb5e857b808add6893b0477247a75936033b3 Mon Sep 17 00:00:00 2001 From: OJ Date: Tue, 1 Nov 2016 01:35:01 +1000 Subject: [PATCH] Replace regex use with direct string checks in dbvis module --- modules/post/multi/gather/dbvis_enum.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/post/multi/gather/dbvis_enum.rb b/modules/post/multi/gather/dbvis_enum.rb index f2d174ff7e..96e50dd34b 100644 --- a/modules/post/multi/gather/dbvis_enum.rb +++ b/modules/post/multi/gather/dbvis_enum.rb @@ -38,7 +38,7 @@ class MetasploitModule < Msf::Post oldversion = false case session.platform - when /linux/ + when 'linux' user = session.shell_command('whoami').chomp print_status("Current user is #{user}") if user =~ /root/ @@ -47,8 +47,8 @@ class MetasploitModule < Msf::Post user_base = "/home/#{user}/" end dbvis_file = "#{user_base}.dbvis/config70/dbvis.xml" - when /windows/ - if session.type =~ /meterpreter/ + when 'windows' + if session.type == 'meterpreter' user_profile = session.sys.config.getenv('USERPROFILE') else user_profile = cmd_exec("echo %USERPROFILE%").strip