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