Replace regex use with direct string checks in dbvis module

bug/bundler_fix
OJ 2016-11-01 01:35:01 +10:00
parent 3c57ff5c59
commit b9bbb5e857
No known key found for this signature in database
GPG Key ID: D5DC61FB93260597
1 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ class MetasploitModule < Msf::Post
oldversion = false oldversion = false
case session.platform case session.platform
when /linux/ when 'linux'
user = session.shell_command('whoami').chomp user = session.shell_command('whoami').chomp
print_status("Current user is #{user}") print_status("Current user is #{user}")
if user =~ /root/ if user =~ /root/
@ -47,8 +47,8 @@ class MetasploitModule < Msf::Post
user_base = "/home/#{user}/" user_base = "/home/#{user}/"
end end
dbvis_file = "#{user_base}.dbvis/config70/dbvis.xml" dbvis_file = "#{user_base}.dbvis/config70/dbvis.xml"
when /windows/ when 'windows'
if session.type =~ /meterpreter/ if session.type == 'meterpreter'
user_profile = session.sys.config.getenv('USERPROFILE') user_profile = session.sys.config.getenv('USERPROFILE')
else else
user_profile = cmd_exec("echo %USERPROFILE%").strip user_profile = cmd_exec("echo %USERPROFILE%").strip