Replace regex use with direct string checks in dbvis module
parent
3c57ff5c59
commit
b9bbb5e857
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue