rapid7/metasploit-framework

View on GitHub

Showing 22,004 of 22,004 total issues

Method dispatch_request has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def dispatch_request(from, buf)
    type = buf.unpack('C').first
    if (type != Constants::Request)
      #dlog("Unknown DHCP request type: #{type}")
      return
Severity: Major
Found in lib/rex/proto/dhcp/server.rb - About 4 hrs to fix

    Method cmd_jobs has 105 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def cmd_jobs(*args)
                # Make the default behavior listing all jobs if there were no options
                # or the only option is the verbose flag
                args.unshift("-l") if args.empty? || args == ["-v"]
    
    
    Severity: Major
    Found in lib/msf/ui/console/command_dispatcher/jobs.rb - About 4 hrs to fix

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

          this.assignSub = operation(function sub(a, b) {
              var carry = 0;
              for (var i = 0; i < 8; i++) {
                  var cur = a.byteAt(i) - b.byteAt(i) - carry;
                  carry = cur < 0 | 0;
      Severity: Major
      Found in data/exploits/javascript_utils/int64.js and 1 other location - About 4 hrs to fix
      data/exploits/javascript_utils/int64.js on lines 143..151

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

      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

          this.assignAdd = operation(function add(a, b) {
              var carry = 0;
              for (var i = 0; i < 8; i++) {
                  var cur = a.byteAt(i) + b.byteAt(i) + carry;
                  carry = cur > 0xff | 0;
      Severity: Major
      Found in data/exploits/javascript_utils/int64.js and 1 other location - About 4 hrs to fix
      data/exploits/javascript_utils/int64.js on lines 154..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 119.

      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 bypassuac_injection_winsxs.rb has 341 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class MetasploitModule < Msf::Exploit::Local
        Rank = ExcellentRanking
      
        include Exploit::EXE
        include Exploit::FileDropper
      Severity: Minor
      Found in modules/exploits/windows/local/bypassuac_injection_winsxs.rb - About 4 hrs to fix

        File mimipenguin.rb has 341 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'unix_crypt'
        
        class MetasploitModule < Msf::Post
          include Msf::Post::Linux::Priv
          include Msf::Post::Linux::System
        Severity: Minor
        Found in modules/post/linux/gather/mimipenguin.rb - About 4 hrs to fix

          File linux.rb has 341 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module Msf::Payload::Linux
          
            #
            # This mixin is chained within payloads that target the Linux platform.
            # It provides special prepends, to support things like chroot and setuid.
          Severity: Minor
          Found in lib/msf/core/payload/linux.rb - About 4 hrs to fix

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

                script = %Q|
                var #{rand1} = unescape("#{shellcode}");
                var #{rand2} ="";
                for (#{rand3}=128;#{rand3}>=0;--#{rand3}) #{rand2} += unescape("#{nops}");
                #{rand4} = #{rand2} + #{rand1};
            modules/exploits/windows/browser/hyleos_chemviewx_activex.rb on lines 100..116

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

            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

                content = %Q|<html>
            <object classid='clsid:#{clsid}' id='#{chemview}'></object>
            <script>
            #{j_shellcode}=unescape('#{shellcode}');
            #{j_nops}=unescape('#{nops}');
            Severity: Major
            Found in modules/exploits/windows/browser/hyleos_chemviewx_activex.rb and 1 other location - About 4 hrs to fix
            modules/exploits/windows/fileformat/adobe_collectemailinfo.rb on lines 73..89

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

            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 Fs has 33 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Console::CommandDispatcher::Stdapi::Fs
            
              Klass = Console::CommandDispatcher::Stdapi::Fs
            
              include Console::CommandDispatcher
            Severity: Minor
            Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb - About 4 hrs to fix

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

                def run
                  res = xymon_send('ping').to_s
              
                  unless res.starts_with? 'xymond'
                    print_error 'Target is not a Xymon daemon'
              Severity: Major
              Found in modules/auxiliary/gather/xymon_info.rb - About 4 hrs to fix

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

                  def run
                    headings = [
                      ["Database", "Schema", "Table", "Column", "Data Type", "Row Count"]
                    ]
                
                
                Severity: Major
                Found in modules/auxiliary/admin/mssql/mssql_idf.rb - About 4 hrs to fix

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

                    def run
                      base_addr = datastore['BASEDNS']
                      targ_addr = datastore['TARGDNS']
                      check_ar  = datastore['CHECK_ADDITIONAL']
                      check_aa  = datastore['CHECK_AUTHORITY']
                  Severity: Major
                  Found in modules/auxiliary/spoof/dns/compare_results.rb - About 4 hrs to fix

                    Method defines has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def defines
                        %^
                            #define _SEED 0x#{@hash.to_s(16)}
                            #define _ROR8(v) (v >> 8 | v << 24)
                            #define MAX_SYSCALLS 500
                    Severity: Major
                    Found in modules/evasion/windows/syscall_inject.rb - About 4 hrs to fix

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

                        def initialize(info = {})
                          super(update_info(info,
                            'Name'            => 'Wireshark LWRES Dissector getaddrsbyname_request Buffer Overflow (loop)',
                            'Description'    => %q{
                                The LWRES dissector in Wireshark version 0.9.15 through 1.0.10 and 1.2.0 through
                      Severity: Major
                      Found in modules/exploits/multi/misc/wireshark_lwres_getaddrbyname_loop.rb - About 4 hrs to fix

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

                          def exploit
                        
                            # Generate the WAR containing the payload
                            app_base = rand_text_alphanumeric(4+rand(32-4))
                            jsp_name = rand_text_alphanumeric(8+rand(8))
                        Severity: Major
                        Found in modules/exploits/windows/http/zenworks_assetmgmt_uploadservlet.rb - About 4 hrs to fix

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

                            def initialize(info = {})
                              super(
                                update_info(
                                  info,
                                  'Name' => 'SaltStack Salt Master/Minion Unauthenticated RCE',
                          Severity: Major
                          Found in modules/exploits/linux/misc/saltstack_salt_unauth_rce.rb - About 4 hrs to fix

                            File header.rb has 340 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            require 'net/dns/dns'
                            
                            module Net # :nodoc:
                              module DNS 
                            
                            
                            Severity: Minor
                            Found in lib/net/dns/header.rb - About 4 hrs to fix

                              Method mssql_parse_tds_reply has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def mssql_parse_tds_reply(data, info)
                                  info[:errors] ||= []
                                  info[:colinfos] ||= []
                                  info[:colnames] ||= []
                              
                              
                              Severity: Major
                              Found in lib/rex/proto/mssql/client_mixin.rb - About 4 hrs to fix

                                Method cmd_exploit has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def cmd_exploit(*args, opts: {})
                                    if (args.include?('-r') || args.include?('--reload-libs')) && !opts[:previously_reloaded]
                                      driver.run_single('reload_lib -a')
                                    end
                                
                                
                                Severity: Major
                                Found in lib/msf/ui/console/command_dispatcher/exploit.rb - About 4 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language