Class: CMSScanner::XMLRPC
- Inherits:
-
InterestingFinding
- Object
- InterestingFinding
- CMSScanner::XMLRPC
- Defined in:
- app/models/xml_rpc.rb
Overview
XML RPC
Constant Summary
Constants included from Finders::Finding
Finders::Finding::FINDING_OPTS
Instance Attribute Summary
Attributes inherited from InterestingFinding
Instance Method Summary collapse
- #call(method, params = [], request_params = {}) ⇒ Typhoeus::Response
-
#request_body(method, params = []) ⇒ String
Might be better to use Nokogiri to create the XML body ?.
Methods inherited from InterestingFinding
Methods included from Finders::Finding
#<=>, #confidence, #confidence=, #confirmed_by, #eql?, included, #interesting_entries, #parse_finding_options
Constructor Details
This class inherits a constructor from CMSScanner::InterestingFinding
Instance Method Details
#call(method, params = [], request_params = {}) ⇒ Typhoeus::Response
9 10 11 |
# File 'app/models/xml_rpc.rb', line 9 def call(method, params = [], request_params = {}) NS::Browser.post(url, request_params.merge(body: request_body(method, params))) end |
#request_body(method, params = []) ⇒ String
Might be better to use Nokogiri to create the XML body ?
19 20 21 22 23 24 25 26 27 28 |
# File 'app/models/xml_rpc.rb', line 19 def request_body(method, params = []) p_body = '' params.each { |p| p_body << "<param><value><string>#{p}</string></value></param>" } body = '<?xml version="1.0"?><methodCall>' body << "<methodName>#{method}</methodName>" body << "<params>#{p_body}</params>" unless p_body.length == 0 body << '</methodCall>' end |