Land #6882, fix moodle_cmd_exec HTML parsing to use REX

bug/bundler_fix
Brent Cook 2016-05-23 23:25:22 -05:00
commit 5bf8891c54
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
1 changed files with 2 additions and 10 deletions

View File

@ -9,7 +9,6 @@ require 'rexml/document'
class MetasploitModule < Msf::Exploit::Remote
Rank = GoodRanking
include Msf::Exploit::Remote::Tcp
include Msf::Exploit::Remote::HttpClient
def initialize(info={})
@ -101,17 +100,10 @@ class MetasploitModule < Msf::Exploit::Remote
'cookie' => sess
})
tinymce.body.each_line do |line|
next if line !~ /name="sesskey"/
sesskey = line[0..line.index('>')]
end
if sesskey == ''
sesskey = tinymce.get_hidden_inputs[1]['sesskey']
unless sesskey
fail_with(Failure::UnexpectedReply, "Unable to get proper session key")
end
sesskey = REXML::Document.new sesskey
sesskey = sesskey.root.attributes["value"]
else
sesskey = datastore['SESSKEY']
end