rapid7/metasploit-framework

View on GitHub

Showing 7,301 of 22,004 total issues

Method devices_list has 189 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def devices_list
    known_devices = {
      :'AZ-D140W' =>
          {
            name: 'Azmoon', model: 'AZ-D140W', values: [
Severity: Major
Found in modules/auxiliary/admin/http/allegro_rompager_auth_bypass.rb - About 7 hrs to fix

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

      def run_host(ip)
    
        http_method = datastore['METHOD'].upcase
    
        qvars = nil
    Severity: Major
    Found in modules/auxiliary/scanner/http/error_sql_injection.rb - About 7 hrs to fix

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

        def exploit
          # Sanity check the USERNAME and PASSWORD will meet the servers password requirements.
          fail_with(Failure::BadConfig, 'USERNAME must not be empty.') if datastore['USERNAME'].empty?
          fail_with(Failure::BadConfig, 'PASSWORD must be 8 characters of more.') if datastore['PASSWORD'].length < 8
      
      

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

          def on_request_uri(cli, request)
            print_status("Sending #{request.uri} to #{request['User-Agent']}")
            escaped_payload = Rex::Text.to_unescape(payload.encoded)
            jscript = %^
        // HELPER FUNCTIONS
        Severity: Major
        Found in modules/exploits/multi/browser/chrome_array_map.rb - About 7 hrs to fix

          Method import_nmap_xml has 188 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def import_nmap_xml(args={}, &block)
              return nil if args[:data].nil? or args[:data].empty?
              wspace = Msf::Util::DBManager.process_opts_workspace(args, framework)
              bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
          
          
          Severity: Major
          Found in lib/msf/core/db_manager/import/nmap.rb - About 7 hrs to fix

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

            module Payload::Windows::MeterpreterLoader
            
              include Msf::ReflectiveDLLLoader
              include Msf::Payload::Windows
            
            
            Severity: Major
            Found in lib/msf/core/payload/windows/meterpreter_loader.rb and 1 other location - About 7 hrs to fix
            lib/msf/core/payload/windows/x64/meterpreter_loader_x64.rb on lines 13..122

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

            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::Windows::MeterpreterLoader_x64
            
              include Msf::ReflectiveDLLLoader
              include Msf::Payload::Windows
            
            
            Severity: Major
            Found in lib/msf/core/payload/windows/x64/meterpreter_loader_x64.rb and 1 other location - About 7 hrs to fix
            lib/msf/core/payload/windows/meterpreter_loader.rb on lines 12..118

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

            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 187 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def run
                check_pcaprub_loaded # Check first
                target  = rhost()
                source  = Rex::Socket.source_address(target)
                saddr   = datastore['SRCADDR']
            Severity: Major
            Found in modules/auxiliary/spoof/dns/bailiwicked_domain.rb - About 7 hrs to fix

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

                def generate(_opts = {})
              
                  strTitle = datastore['TITLE'] + "X"
                  if (strTitle.length < 1)
                    raise ArgumentError, "You must specify a title"
              Severity: Major
              Found in modules/payloads/singles/windows/messagebox.rb - About 7 hrs to fix

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

                  def run
                    check_pcaprub_loaded # Check first.
                
                    target   = rhost()
                    source   = Rex::Socket.source_address(target)
                Severity: Major
                Found in modules/auxiliary/spoof/dns/bailiwicked_host.rb - About 7 hrs to fix

                  Method unifi_config_eater has 186 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def unifi_config_eater(thost, tport, config)
                        # This is for the Ubiquiti Unifi files.  These are typically in the backup download zip file
                        # then in the db.gz file as db.  It is a MongoDB BSON file, which can be difficult to read.
                        # https://stackoverflow.com/questions/51242412/undefined-method-read-bson-document-for-bsonmodule
                        # The BSON file is a bunch of BSON Documents chained together.  There doesn't seem to be a good
                  Severity: Major
                  Found in lib/msf/core/auxiliary/ubiquiti.rb - About 7 hrs to fix

                    Method asm_bind_named_pipe has 186 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def asm_bind_named_pipe(opts={})
                    
                        reliable       = opts[:reliable]
                        timeout        = opts[:timeout] * 1000 # convert to millisecs
                        retry_wait     = 500
                    Severity: Major
                    Found in lib/msf/core/payload/windows/x64/bind_named_pipe_x64.rb - About 7 hrs to fix

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

                          elif args['VERSION'] == "2-4":
                              try:
                                  username = args['USERNAME']
                                  cookie = encrypt_version4(args['USERNAME'])
                                  module.log("Encrypted remember cookie: "+cookie, "good")
                      Severity: Major
                      Found in modules/auxiliary/admin/http/grafana_auth_bypass.py and 1 other location - About 7 hrs to fix
                      modules/auxiliary/admin/http/grafana_auth_bypass.py on lines 114..128

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

                      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

                          if args['VERSION'] == "5":
                              try:
                                  username = args['USERNAME']
                                  cookie = encrypt_version5(args['USERNAME'])
                                  module.log("Encrypted remember cookie: "+cookie, "good")
                      Severity: Major
                      Found in modules/auxiliary/admin/http/grafana_auth_bypass.py and 1 other location - About 7 hrs to fix
                      modules/auxiliary/admin/http/grafana_auth_bypass.py on lines 129..143

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

                      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 generate has 185 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def self.generate(cmd)
                            mscorlib = Assemblies::VERSIONS['4.0.0.0'].fetch('mscorlib')
                            system = Assemblies::VERSIONS['4.0.0.0'].fetch('System')
                      
                            library = Types::RecordValues::BinaryLibrary.new(

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

                          def exploit
                            # Encode the shellcode.
                            shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
                        
                            # Create some nops.
                        Severity: Major
                        Found in modules/exploits/windows/fileformat/etrust_pestscan.rb and 2 other locations - About 7 hrs to fix
                        modules/exploits/windows/fileformat/activepdf_webgrabber.rb on lines 52..102
                        modules/exploits/windows/fileformat/mcafee_hercules_deletesnapshot.rb on lines 51..101

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

                        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 exploit
                            # Encode the shellcode.
                            shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
                        
                            # Create some nops.
                        modules/exploits/windows/fileformat/activepdf_webgrabber.rb on lines 52..102
                        modules/exploits/windows/fileformat/etrust_pestscan.rb on lines 49..95

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

                        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 exploit
                            # Encode the shellcode.
                            shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
                        
                            # Create some nops.
                        Severity: Major
                        Found in modules/exploits/windows/fileformat/activepdf_webgrabber.rb and 2 other locations - About 7 hrs to fix
                        modules/exploits/windows/fileformat/etrust_pestscan.rb on lines 49..95
                        modules/exploits/windows/fileformat/mcafee_hercules_deletesnapshot.rb on lines 51..101

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

                        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

                        Class RbMysql has 51 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class RbMysql
                        
                          require "rbmysql/constants"
                          require "rbmysql/error"
                          require "rbmysql/charset"
                        Severity: Major
                        Found in lib/rbmysql.rb - About 7 hrs to fix

                          Class RPC_Db has 51 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                          class RPC_Db < RPC_Base
                          
                          private
                          
                            include Metasploit::Credential::Creation
                          Severity: Major
                          Found in lib/msf/core/rpc/v10/rpc_db.rb - About 7 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language