Sha256: f6d3d7106db5e4358d7f2798b4368223756014c1b358a5fabd48e152247e78e3
Contents?: true
Size: 1 KB
Versions: 19
Compression:
Stored size: 1 KB
Contents
module CMSScanner # XML RPC class XMLRPC < InterestingFinding # @param [ String ] method # @param [ Array ] params # @param [ Hash ] request_params # # @return [ Typhoeus::Response ] def call(method, params = [], request_params = {}) NS::Browser.post(url, request_params.merge(body: request_body(method, params))) end # Might be better to use Nokogiri to create the XML body ? # # @param [ String ] method # @param [ Array ] params # # @return [ String ] The body of the XML RPC request 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.zero? body << '</methodCall>' end # Use the system.listMethods to get the list of available methods ? # def entries # # end end end
Version data entries
19 entries across 19 versions & 1 rubygems