Sha256: fcec088804de1f75d6a93019e38bf772a18be9357106cf12a0d65d1577a2442b
Contents?: true
Size: 1 KB
Versions: 22
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 == 0 body << '</methodCall>' end # Use the system.listMethods to get the list of available methods ? # def entries # # end end end
Version data entries
22 entries across 22 versions & 1 rubygems