• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wpscanteam / CMSScanner / 10771931262

09 Sep 2024 11:06AM UTC coverage: 99.925%. Remained the same
10771931262

push

github

web-flow
Merge pull request #261 from wpscanteam/dependabot/bundler/webmock-tw-3.23.1

Update webmock requirement from ~> 3.19.1 to ~> 3.23.1

315 of 346 branches covered (91.04%)

1333 of 1334 relevant lines covered (99.93%)

120.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/app/finders/interesting_findings/xml_rpc.rb
1
# frozen_string_literal: true
2

3
module CMSScanner
4✔
4
  module Finders
4✔
5
    module InterestingFindings
4✔
6
      # XML RPC finder
7
      class XMLRPC < Finder
4✔
8
        # @return [ Array<String> ] The potential urls to the XMl RPC file
9
        def potential_urls
4✔
10
          @potential_urls ||= []
44✔
11
        end
12

13
        # @return [ Array<XMLRPC> ]
14
        def passive(opts = {})
4✔
15
          [passive_headers(opts), passive_body(opts)].compact
8✔
16
        end
17

18
        # @return [ XMLRPC ]
19
        def passive_headers(_opts = {})
4✔
20
          url = target.homepage_res.headers['X-Pingback']
12✔
21

22
          return unless target.in_scope?(url)
12✔
23

24
          potential_urls << url
4✔
25

26
          NS::Model::XMLRPC.new(url, confidence: 30, found_by: 'Headers (Passive Detection)')
4✔
27
        end
28

29
        # @return [ XMLRPC ]
30
        def passive_body(_opts = {})
4✔
31
          target.homepage_res.html.css('link[rel="pingback"]').each do |tag|
12✔
32
            url = tag.attribute('href').to_s
8✔
33

34
            next unless target.in_scope?(url)
8✔
35

36
            potential_urls << url
4✔
37

38
            return NS::Model::XMLRPC.new(url, confidence: 30, found_by: 'Link Tag (Passive Detection)')
4✔
39
          end
40
          nil
41
        end
42

43
        # @return [ XMLRPC ]
44
        def aggressive(_opts = {})
4✔
45
          potential_urls << target.url('xmlrpc.php')
8✔
46

47
          potential_urls.uniq.each do |potential_url|
8✔
48
            next unless target.in_scope?(potential_url)
16✔
49

50
            res = NS::Browser.post(potential_url, body: Digest::MD5.hexdigest(rand(999_999).to_s[0..5]))
8✔
51

52
            next unless /<methodResponse>/i.match?(res&.body)
8!
53

54
            return NS::Model::XMLRPC.new(potential_url, confidence: 100, found_by: DIRECT_ACCESS)
4✔
55
          end
56
          nil
57
        end
58
      end
59
    end
60
  end
61
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc