rapid7/metasploit-framework

View on GitHub

Showing 7,301 of 22,004 total issues

Method create_sqlite_db has 160 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create_sqlite_db
    dbfile = Tempfile.new('ad_to_sqlite')
    db = SQLite3::Database.new(dbfile.path)
    db.type_translation = true

Severity: Major
Found in modules/post/windows/gather/ad_to_sqlite.rb - About 6 hrs to fix

    Method cmd_search has 160 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def cmd_search(*args)
                match        = ''
                row_filter  = nil
                output_file  = nil
                cached       = false
    Severity: Major
    Found in lib/msf/ui/console/command_dispatcher/modules.rb - About 6 hrs to fix

      Method run has 160 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def run
        @show_progress = datastore['ShowProgress']
        @show_percent  = datastore['ShowProgressPercent'].to_i
      
        if self.respond_to?(:session) && session
      Severity: Major
      Found in lib/msf/core/auxiliary/scanner.rb - About 6 hrs to fix

        Method html_get_hash has 159 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def html_get_hash(arg = {})
            ntlm_ver = arg[:ntlm_ver]
            if ntlm_ver == NTLM_CONST::NTLM_V1_RESPONSE or ntlm_ver == NTLM_CONST::NTLM_2_SESSION_RESPONSE
              lm_hash = arg[:lm_hash]
              nt_hash = arg[:nt_hash]
        Severity: Major
        Found in modules/auxiliary/server/capture/http_ntlm.rb - About 6 hrs to fix

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

            def on_request_uri(cli, request)
          
              # Random JavaScript variable names
              js_element_name      = rand_text_alpha(rand(10) + 5)
              js_obj_addr_name     = rand_text_alpha(rand(10) + 5)
          Severity: Major
          Found in modules/exploits/windows/browser/mozilla_mchannel.rb - About 6 hrs to fix

            Method on_client_data has 158 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def on_client_data(client)
                data = client.get_once
                return if !data
            
                print_status("SMTP: #{@state[client][:name]} Command: #{data.strip}")
            Severity: Major
            Found in modules/auxiliary/server/capture/smtp.rb - About 6 hrs to fix

              Method asm_reflective_pe_loader_x64 has 157 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def asm_reflective_pe_loader_x64(opts)
              
                    prologue = ''
                    if opts[:is_dll] == true
                      prologue = %(
              Severity: Major
              Found in lib/msf/core/payload/windows/x64/reflective_pe_loader_x64.rb - About 6 hrs to fix

                Method asm_reflective_pe_loader has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def asm_reflective_pe_loader(opts)
                
                      prologue = ''
                      if opts[:is_dll] == true
                        prologue = %(
                Severity: Major
                Found in lib/msf/core/payload/windows/reflective_pe_loader.rb - About 6 hrs to fix

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                    def process_propfind(cli, request)
                      path = request.uri
                      print_status("PROPFIND #{path}")
                      body = ''
                  
                  
                  Severity: Major
                  Found in modules/exploits/windows/browser/webdav_dll_hijacker.rb and 2 other locations - About 6 hrs to fix
                  modules/exploits/windows/browser/ubisoft_uplay_cmd_exec.rb on lines 191..307
                  modules/exploits/windows/misc/vmhgfs_webdav_dll_sideload.rb on lines 133..249

                  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 204.

                  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

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                    def process_propfind(cli, request)
                      path = request.uri
                      print_status("PROPFIND #{path}")
                      body = ''
                  
                  
                  Severity: Major
                  Found in modules/exploits/windows/misc/vmhgfs_webdav_dll_sideload.rb and 2 other locations - About 6 hrs to fix
                  modules/exploits/windows/browser/ubisoft_uplay_cmd_exec.rb on lines 191..307
                  modules/exploits/windows/browser/webdav_dll_hijacker.rb on lines 145..261

                  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 204.

                  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

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                    def process_propfind(cli, request)
                      path = request.uri
                      vprint_status("PROPFIND #{path}")
                      body = ''
                  
                  
                  Severity: Major
                  Found in modules/exploits/windows/browser/ubisoft_uplay_cmd_exec.rb and 2 other locations - About 6 hrs to fix
                  modules/exploits/windows/browser/webdav_dll_hijacker.rb on lines 145..261
                  modules/exploits/windows/misc/vmhgfs_webdav_dll_sideload.rb on lines 133..249

                  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 204.

                  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

                  Method cmd_services has 155 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def cmd_services(*args)
                      return unless active?
                      mode = :search
                      onlyup = false
                      output_file = nil
                  Severity: Major
                  Found in lib/msf/ui/console/command_dispatcher/db.rb - About 6 hrs to fix

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

                    module Payload::Linux::ReverseTcp_x64
                    
                      include Msf::Payload::TransportConfig
                      include Msf::Payload::Linux
                    
                    
                    Severity: Major
                    Found in lib/msf/core/payload/linux/x64/reverse_tcp_x64.rb and 1 other location - About 6 hrs to fix
                    lib/msf/core/payload/linux/x64/reverse_sctp_x64.rb on lines 12..179

                    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 203.

                    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

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

                    module Payload::Linux::ReverseSctp_x64
                    
                      include Msf::Payload::TransportConfig
                      include Msf::Payload::Linux
                    
                    
                    Severity: Major
                    Found in lib/msf/core/payload/linux/x64/reverse_sctp_x64.rb and 1 other location - About 6 hrs to fix
                    lib/msf/core/payload/linux/x64/reverse_tcp_x64.rb on lines 12..177

                    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 203.

                    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

                    Method run has 154 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def run
                        def check_results(passwords, results, hash_type, method)
                          passwords.each do |password_line|
                            password_line.chomp!
                            next if password_line.blank?
                    Severity: Major
                    Found in modules/auxiliary/analyze/crack_databases.rb - About 6 hrs to fix

                      Method run has 153 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def run
                          # check for meterpreter and version of ie
                          if (session.type != 'meterpreter') && session.platform !~ (/win/)
                            print_error('This module only works with Windows Meterpreter sessions')
                            return 0
                      Severity: Major
                      Found in modules/post/windows/gather/enum_ie.rb - About 6 hrs to fix

                        Method asm_reverse_named_pipe has 153 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def asm_reverse_named_pipe(opts={})
                        
                            retry_count    = [opts[:retry_count].to_i, 1].max
                            reliable       = opts[:reliable]
                            # we have to double-escape because of metasm
                        Severity: Major
                        Found in lib/msf/core/payload/windows/reverse_named_pipe.rb - About 6 hrs to fix

                          Method exploit has 152 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def exploit
                              target_endpoint = normalize_uri(target_uri.path, datastore['CONFLUENCE_TARGET_ENDPOINT'])
                          
                              print_status("Setting the application configuration's setupComplete to false via endpoint: #{target_endpoint}")
                          
                          

                            Method exploit has 152 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def exploit
                                # first let's check if SRVHOST is valid
                                if datastore['SRVHOST'] == '0.0.0.0'
                                  fail_with(Failure::Unknown, 'Please enter a valid IP address for SRVHOST')
                                end
                            Severity: Major
                            Found in modules/exploits/multi/misc/ibm_tm1_unauth_rce.rb - About 6 hrs to fix

                              Function Signaler has 151 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function Signaler(root, socketURL) {
                                      var self = this;
                              
                                      root.startBroadcasting = function () {
                                          if(!root.MediaStream) throw 'Offerer must have media stream.';
                              Severity: Major
                              Found in data/webcam/api.js - About 6 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language