rapid7/metasploit-framework

View on GitHub
modules/exploits/multi/http/drupal_drupageddon.rb

Summary

Maintainability
D
2 days
Test Coverage

Method exploit_newuser has 169 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def exploit_newuser

    # TODO: Check if option admin_role exists via admin/people/permissions/roles

    # call login page to extract tokens
Severity: Major
Found in modules/exploits/multi/http/drupal_drupageddon.rb - About 6 hrs to fix

    File drupal_drupageddon.rb has 371 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class MetasploitModule < Msf::Exploit::Remote
      Rank = ExcellentRanking
    
      include Msf::Exploit::Remote::HttpClient
    
    
    Severity: Minor
    Found in modules/exploits/multi/http/drupal_drupageddon.rb - About 4 hrs to fix

      Method exploit_newuser has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

        def exploit_newuser
      
          # TODO: Check if option admin_role exists via admin/people/permissions/roles
      
          # call login page to extract tokens
      Severity: Minor
      Found in modules/exploits/multi/http/drupal_drupageddon.rb - About 3 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method initialize has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def initialize(info={})
          super(update_info(info,
            'Name'           => 'Drupal HTTP Parameter Key/Value SQL Injection',
            'Description'    => %q{
              This module exploits the Drupal HTTP Parameter Key/Value SQL Injection
      Severity: Major
      Found in modules/exploits/multi/http/drupal_drupageddon.rb - About 2 hrs to fix

        Method exploit_formcache has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def exploit_formcache
            form_build_id = 'form-' + rand_text_alphanumeric(43)
        
            # Remove the malicious cache entries upon success.
            evalstr = "cache_clear_all(array('form_" + form_build_id + "', " \
        Severity: Minor
        Found in modules/exploits/multi/http/drupal_drupageddon.rb - About 2 hrs to fix

          Method phpass_encode64 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def phpass_encode64(input, count)
              out = ''
              cur = 0
              while cur < count
                value = input[cur].ord
          Severity: Minor
          Found in modules/exploits/multi/http/drupal_drupageddon.rb - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          There are no issues that match your filters.

          Category
          Status