rapid7/metasploit-framework

View on GitHub

Showing 22,177 of 22,177 total issues

File ssl_version.rb has 367 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class MetasploitModule < Msf::Auxiliary

  include Msf::Exploit::Remote::Tcp
  include Msf::Auxiliary::Scanner
  include Msf::Auxiliary::Report
Severity: Minor
Found in modules/auxiliary/scanner/ssl/ssl_version.rb - About 4 hrs to fix

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

      def initialize(info={})
        super(update_info(info,
          'Name'           => "SerComm Device Remote Code Execution",
          'Description'    => %q{
            This module will cause remote code execution on several SerComm devices.
    Severity: Major
    Found in modules/exploits/linux/misc/sercomm_exec.rb - About 4 hrs to fix

      Method arista_eos_config_eater has 120 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def arista_eos_config_eater(thost, tport, config)
      
            if framework.db.active
              credential_data = {
                address: thost,
      Severity: Major
      Found in lib/msf/core/auxiliary/arista.rb - About 4 hrs to fix

        Method generate has 120 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def generate(*args)
            @aix = datastore['AIX']
        
            #if not assoc_exploit.nil?
            #    note = find_note(assoc_exploit.rhost, 'AIX')
        Severity: Major
        Found in lib/msf/core/payload/aix.rb - About 4 hrs to fix

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

            def on_request_uri(cli, req)
          
              # Create a cached mapping between IP and detected target
              @targetcache ||= {}
              @targetcache[cli.peerhost] ||= {}
          Severity: Major
          Found in modules/exploits/multi/browser/java_setdifficm_bof.rb and 1 other location - About 4 hrs to fix
          modules/exploits/multi/browser/java_getsoundbank_bof.rb on lines 99..162

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 161.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

            def on_request_uri(cli, req)
          
              # Create a cached mapping between IP and detected target
              @targetcache ||= {}
              @targetcache[cli.peerhost] ||= {}
          Severity: Major
          Found in modules/exploits/multi/browser/java_getsoundbank_bof.rb and 1 other location - About 4 hrs to fix
          modules/exploits/multi/browser/java_setdifficm_bof.rb on lines 87..150

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 161.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          File bailiwicked_domain.rb has 365 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'net/dns'
          require 'resolv'
          
          class MetasploitModule < Msf::Auxiliary
            include Msf::Exploit::Capture
          Severity: Minor
          Found in modules/auxiliary/spoof/dns/bailiwicked_domain.rb - About 4 hrs to fix

            Method run_host has 119 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def run_host(target_host)
                print_status("Trying #{target_host}")
                if wordpress_and_online?
                  version = wordpress_version
                  version_string = version || '(no version detected)'
            Severity: Major
            Found in modules/auxiliary/scanner/http/wordpress_scanner.rb - About 4 hrs to fix

              Method on_request_uri has 119 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def on_request_uri(cli, request)
                  #Set target manually or automatically
                  my_target = target
                  if my_target.name == 'Automatic'
                    agent = request.headers['User-Agent']
              Severity: Major
              Found in modules/exploits/windows/browser/teechart_pro.rb - About 4 hrs to fix

                Method on_request_uri has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def on_request_uri(cli, request)
                    #Set target manually or automatically
                    my_target = target
                    if my_target.name == 'Automatic'
                      agent = request.headers['User-Agent']
                Severity: Major
                Found in modules/exploits/windows/browser/intrust_annotatex_add.rb - About 4 hrs to fix

                  Method process_db has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def process_db(db_path, user)
                      db = SQLite3::Database.new(db_path)
                  
                      # Extract information for accounts configured in Skype
                      print_status('Enumerating accounts')
                  Severity: Major
                  Found in modules/post/multi/gather/skype_enum.rb - About 4 hrs to fix

                    Method dcerpc_endpoint_list has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def dcerpc_endpoint_list
                        res = []
                    
                        print_status("Connecting to the endpoint mapper service...")
                        begin
                    Severity: Major
                    Found in lib/msf/core/exploit/remote/dcerpc_epm.rb - About 4 hrs to fix

                      Method arkeia_info has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def arkeia_info
                          connect
                      
                          info = { }
                          resp = ''
                      Severity: Major
                      Found in lib/msf/core/exploit/remote/arkeia.rb - About 4 hrs to fix

                        Method run has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def run
                            print_status("Establishing a connection to the target...")
                        
                            uri = normalize_uri(datastore['URI'], '/tiki-lastchanges.php')
                            rpath = uri + "?days=1&offset=0&sort_mode="
                        Severity: Minor
                        Found in modules/auxiliary/admin/tikiwiki/tikidblib.rb - About 4 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 run_host has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def run_host(target_host)
                            begin
                              http_opts = {
                                'uri' => normalize_uri(target_uri.path),
                                'query' => datastore['HttpQueryString']
                        Severity: Minor
                        Found in modules/auxiliary/scanner/http/title.rb - About 4 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 run_host has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def run_host(ip)
                            vprint_status('Attempting user enumeration')
                            res = send_request_cgi(
                              'uri' => normalize_uri(target_uri.path, 'api', 'index.php', 'v1', 'users'),
                              'headers' => {
                        Severity: Minor
                        Found in modules/auxiliary/scanner/http/joomla_api_improper_access_checks.rb - About 4 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 run_host has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def run_host(ip)
                        
                            conn = false
                        
                            dm = datastore['NoDetailMessages']
                        Severity: Minor
                        Found in modules/auxiliary/scanner/http/replace_ext.rb - About 4 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 scan has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def scan
                            while !@queue.empty?
                              url = @queue.pop
                              status = get_status(url , "1" , "*")
                              # Check strings only upto 6 chars in length
                        Severity: Minor
                        Found in modules/auxiliary/scanner/http/iis_shortname_scanner.rb - About 4 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 get_directory_listing has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def get_directory_listing(folder)
                            print_status("Getting directory listing for #{folder} via XXE and FTP")
                        
                            # Generate a unique callback URL
                            path = "/#{rand_text_alpha(rand(8..15))}.dtd"

                        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 exploit has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def exploit
                            opts = ssh_client_defaults.merge({
                              auth_methods: ['keyboard-interactive'],
                              port: rport,
                              password: password
                        Severity: Minor
                        Found in modules/exploits/linux/ssh/solarwinds_lem_exec.rb - About 4 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

                        Severity
                        Category
                        Status
                        Source
                        Language